0
This commit is contained in:
1 parent
3c95c4ff7a
commit
5e1a0b7b2a
4 files changed
+47
-39
No files matched your search
@@ -81,13 +81,20 @@ class Admin extends BaseModel
|
||||
,'school_id' => ''
|
||||
];
|
||||
$src = array_cover($srcfrom, $src);
|
||||
trim($src['str']);
|
||||
// 如果有数据则查询教师信息
|
||||
$list = self::field('id, xingming, school_id, shengri, sex')
|
||||
->whereOr('xingming', 'like', '%' . $src['str'] . '%')
|
||||
->whereOr('shoupin', 'like', $src['str'] . '%')
|
||||
->when(strlen($src['school_id']) > 0, function ($query) use($src) {
|
||||
$query->where('school_id', $src['danwei_id']);
|
||||
})
|
||||
->when(strlen($src['str']) <= 0, function ($query) use($src) {
|
||||
$query->where('id', '<=', 0);
|
||||
})
|
||||
->when(strlen($src['str']) > 0, function ($query) use($src) {
|
||||
$query
|
||||
->whereOr('xingming', 'like', '%' . $src['str'] . '%')
|
||||
->whereOr('shoupin', 'like', $src['str'] . '%');
|
||||
})
|
||||
->with(
|
||||
[
|
||||
'adSchool' => function($query){
|
||||
@@ -97,7 +104,7 @@ class Admin extends BaseModel
|
||||
)
|
||||
->append(['age'])
|
||||
->select();
|
||||
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user