Commit 9f1431cd by 杨树贤

品牌加上筛选

parent 8737b0ec
......@@ -10,7 +10,9 @@ class BrandController extends Controller
{
public function index(Request $request, SelfBrandModel $model)
{
$list = $model->getBrandList();
$map = $request->only(['brand_area']);
$list = $model->getBrandList($map);
return $this->Export(0, 'ok', ['data' => $list]);
}
}
\ No newline at end of file
......@@ -57,11 +57,11 @@ class SelfBrandModel extends Model
}
//品牌列表
public function getBrandList()
public function getBrandList($map = [])
{
$expireMinutes = 5;
return Cache::remember('brandListsss', $expireMinutes, function () {
return Cache::remember('brandList_'.json_encode($map), $expireMinutes, function () use ($map) {
$field = [
'brand_id',
'brand_name',
......@@ -71,7 +71,7 @@ class SelfBrandModel extends Model
'brand_brief',
];
return $this->select($field)->where('status', 1)->limit(10)
return $this->select($field)->where($map)->where('status', 1)->limit(10)
->get()->toArray();
});
}
......
1575440662a:10:{i:0;a:6:{s:8:"brand_id";i:1;s:10:"brand_name";s:7:"ALLEGRO";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:1;a:6:{s:8:"brand_id";i:2;s:10:"brand_name";s:14:"ADI(亚德诺)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:2;a:6:{s:8:"brand_id";i:3;s:10:"brand_name";s:20:"ALTERA(阿尔特拉)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:3;a:6:{s:8:"brand_id";i:4;s:10:"brand_name";s:19:"Atmel(爱特梅尔)";s:10:"brand_logo";s:79:"http://img.ichunt.com/images/ichunt/uploadfiles/20150616/201506161031403697.jpg";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:262:"Atmel 公司为全球性的业界领先企业,致力于设计和制造各类微控制器、电容式触摸解决方案、先进逻辑、混合信号、非易失性存储器和射频 (RF) 元件。凭借业界最广泛的知识产权 (IP) 技术组合之一,A";}i:4;a:6:{s:8:"brand_id";i:5;s:10:"brand_name";s:16:"AVAGO(安华高)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:5;a:6:{s:8:"brand_id";i:10;s:10:"brand_name";s:16:"intel(英特尔)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:6;a:6:{s:8:"brand_id";i:12;s:10:"brand_name";s:14:"LINEAR(凌特)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:7;a:6:{s:8:"brand_id";i:15;s:10:"brand_name";s:17:"MICROCHIP(微芯)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:8;a:6:{s:8:"brand_id";i:16;s:10:"brand_name";s:11:"MPS(芯源)";s:10:"brand_logo";s:70:"http://img.ichunt.com/images/ichunt/brand/2016-11-30/583e6e5019f69.jpg";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:62:"MPS公司(中文名称:美国芯源)是电源管理IC供应商";}i:9;a:6:{s:8:"brand_id";i:21;s:10:"brand_name";s:10:"ST(意法)";s:10:"brand_logo";s:79:"http://img.ichunt.com/images/ichunt/uploadfiles/20150616/201506161031403697.jpg";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}}
\ No newline at end of file
1575440701a:10:{i:0;a:6:{s:8:"brand_id";i:6;s:10:"brand_name";s:9:"Brand REX";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:1;a:6:{s:8:"brand_id";i:7;s:10:"brand_name";s:8:"BUSSMANN";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:2;a:6:{s:8:"brand_id";i:11;s:10:"brand_name";s:7:"INTERSI";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:3;a:6:{s:8:"brand_id";i:13;s:10:"brand_name";s:5:"Magic";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:4;a:6:{s:8:"brand_id";i:14;s:10:"brand_name";s:8:" MAXIM";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:5;a:6:{s:8:"brand_id";i:18;s:10:"brand_name";s:9:"Omnivison";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:6;a:6:{s:8:"brand_id";i:19;s:10:"brand_name";s:8:"Permacel";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:7;a:6:{s:8:"brand_id";i:20;s:10:"brand_name";s:4:"RFMD";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:8;a:6:{s:8:"brand_id";i:22;s:10:"brand_name";s:7:"SUPREME";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:9;a:6:{s:8:"brand_id";i:24;s:10:"brand_name";s:5:"TRACO";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}}
\ No newline at end of file
1575440677a:10:{i:0;a:6:{s:8:"brand_id";i:1;s:10:"brand_name";s:7:"ALLEGRO";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:1;a:6:{s:8:"brand_id";i:2;s:10:"brand_name";s:14:"ADI(亚德诺)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:2;a:6:{s:8:"brand_id";i:3;s:10:"brand_name";s:20:"ALTERA(阿尔特拉)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:3;a:6:{s:8:"brand_id";i:4;s:10:"brand_name";s:19:"Atmel(爱特梅尔)";s:10:"brand_logo";s:79:"http://img.ichunt.com/images/ichunt/uploadfiles/20150616/201506161031403697.jpg";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:262:"Atmel 公司为全球性的业界领先企业,致力于设计和制造各类微控制器、电容式触摸解决方案、先进逻辑、混合信号、非易失性存储器和射频 (RF) 元件。凭借业界最广泛的知识产权 (IP) 技术组合之一,A";}i:4;a:6:{s:8:"brand_id";i:5;s:10:"brand_name";s:16:"AVAGO(安华高)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}i:5;a:6:{s:8:"brand_id";i:6;s:10:"brand_name";s:9:"Brand REX";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:6;a:6:{s:8:"brand_id";i:7;s:10:"brand_name";s:8:"BUSSMANN";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:0;s:11:"brand_brief";s:0:"";}i:7;a:6:{s:8:"brand_id";i:8;s:10:"brand_name";s:17:"EVERLIGHT(亿光)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:3;s:11:"brand_brief";s:0:"";}i:8;a:6:{s:8:"brand_id";i:9;s:10:"brand_name";s:6:"ILITEK";s:10:"brand_logo";s:79:"http://img.ichunt.com/images/ichunt/uploadfiles/20150710/201507100953371396.jpg";s:11:"create_time";i:1510329451;s:10:"brand_area";i:3;s:11:"brand_brief";s:282:"奕力科技是由一群拥有多年模拟集成电路设计经验的资深团队于2004年7月创立,并于同年11月获准进入新竹科学园区。藉由对多种IC成功量产之经验,本团队运用最佳化模拟混合技术,提供创新且高质量之产品以服务";}i:9;a:6:{s:8:"brand_id";i:10;s:10:"brand_name";s:16:"intel(英特尔)";s:10:"brand_logo";s:0:"";s:11:"create_time";i:1510329451;s:10:"brand_area";i:1;s:11:"brand_brief";s:0:"";}}
\ No newline at end of file
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