Commit d6875c4d by 杨树贤

修改过滤

parent 9f1431cd
...@@ -61,7 +61,7 @@ class SelfBrandModel extends Model ...@@ -61,7 +61,7 @@ class SelfBrandModel extends Model
{ {
$expireMinutes = 5; $expireMinutes = 5;
return Cache::remember('brandList_'.json_encode($map), $expireMinutes, function () use ($map) { return Cache::remember('brandList_' . json_encode($map), $expireMinutes, function () use ($map) {
$field = [ $field = [
'brand_id', 'brand_id',
'brand_name', 'brand_name',
...@@ -71,8 +71,14 @@ class SelfBrandModel extends Model ...@@ -71,8 +71,14 @@ class SelfBrandModel extends Model
'brand_brief', 'brand_brief',
]; ];
return $this->select($field)->where($map)->where('status', 1)->limit(10) $query = $this->select($field)->where('status', 1);
->get()->toArray();
if (!empty($map['brand_area'])) {
$areaIds = explode(',', $map['brand_area']);
$query->whereIn('brand_area', $areaIds);
}
return $query->get()->toArray();
}); });
} }
} }
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment