搜索词为空时的逻辑

This commit is contained in:
ellis7 2019-07-17 14:26:10 +08:00
parent 5bce5133e6
commit 6bb3c1f15d

View File

@ -34,7 +34,9 @@ class AppGroup extends Base {
if ($type) {
switch ($type) {
case 1:
$obj = $obj->where('hash', $keywords);
if (strlen($keywords)) {
$obj = $obj->where('hash', $keywords);
}
break;
case 2:
$obj = $obj->whereLike('name', "%{$keywords}%");