modified 完成查询优化

This commit is contained in:
zhaoxiang 2019-06-22 17:09:53 +08:00
parent 27f9c4fd45
commit de1160bdb7

View File

@ -33,15 +33,15 @@ class User extends Base {
$obj = new AdminUser();
if (strlen($status)) {
$obj->where('status', $status);
$obj = $obj->where('status', $status);
}
if ($type) {
switch ($type) {
case 1:
$obj->whereLike('username', "%{$keywords}%");
$obj = $obj->whereLike('username', "%{$keywords}%");
break;
case 2:
$obj->whereLike('nickname', "%{$keywords}%");
$obj = $obj->whereLike('nickname', "%{$keywords}%");
break;
}
}