|
|
@@ -92,7 +92,14 @@ class SystemStore extends BaseModel
|
|
|
$model = $model->where('id|name|introduction', 'like', '%' . $where['name'] . '%');
|
|
|
}
|
|
|
if (isset($where['cid']) && $where['cid'] != '') {
|
|
|
- $model = $model->where('find_in_set("'.$where['cid'].'",cid)');
|
|
|
+ $cid = $where['cid'];
|
|
|
+ $model = $model->where(function ($query) use ($cid) {
|
|
|
+ $query->where('find_in_set("' . $cid . '",cid)');
|
|
|
+ $cids = SystemStoreCategory::where('pid', $cid)->column('id');
|
|
|
+ foreach ($cids as $v) {
|
|
|
+ $query->whereOr('find_in_set("' . $v . '",cid)');
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
if (isset($where['type']) && $where['type'] != '' && ($data = self::setData($where['type']))) {
|
|
|
$model = $model->where($data);
|