Commit cce8796c by mushishixian

gix

parent 62ff3ad4
Showing with 8 additions and 10 deletions
......@@ -40,23 +40,21 @@ class BrandModel extends Model
$data = $redis->hgetall('Self_Brand');
foreach ($data as $key => $item) {
$item = json_decode($item, true);
if (!$item['brand_id'])continue;
if (!$item['brand_id']) {
continue;
}
$brandList[] = [
'brand_id' => $item['brand_id'],
'brand_name' => $item['brand_name'],
];
}
} else {
$data = $redis->get('brand_select');
if (empty($data)) {
$data = DB::connection('spu')->table('brand')->where('status',1)->orderBy('brand_id','asc')->pluck('brand_name', 'brand_id');
$redis->set('brand_select', json_encode($data));
$redis->expire('brand_select', 3600);
}else{
$data = json_decode($data, true);
}
$data = DB::connection('spu')->table('brand')->where('status', 1)->orderBy('brand_id',
'asc')->pluck('brand_name', 'brand_id');
foreach ($data as $brandId => $brandName) {
if (!$brandId)continue;
if (!$brandId) {
continue;
}
$brandList[] = [
'brand_id' => $brandId,
'brand_name' => trim($brandName),
......
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