/** * 从缓存中读取品牌列表 * @return array */ public function getAllBrands() { S('brands', null); if (!S('brands')) { $brandLogic = new l\BrandLogic(); $brandList = $brandLogic->getAllBrandList(); for ($i = 0; $i < count($brandList); $i++) { $brandName = $brandList[$i]['brand_name']; $brandNameList[$i] = $brandName; $brandNameMap[$brandName] = $brandList[$i]['brand_id']; } $brandMap['NameList'] = $brandNameList; $brandMap['Map'] = $brandNameMap; S('brands', $brandMap); } return S('brands'); }
public function showBrand() { $applyId = I('apply_id'); $merId = I('mer_id'); $brandAuthLogic = new l\BrandAuthLogic(); $achieveBrandList = $brandAuthLogic->getAchieveBrandList($merId); $brandLogic = new l\BrandLogic(); $brandList = $brandLogic->getAllBrandList(); $role = session('user_info.role'); $this->assign('apply_id', $applyId); $this->assign('mer_id', $merId); $this->assign('role', $role); $this->assign('brandList', $brandList); $this->assign('achieveList', $achieveBrandList); $this->display(); }
public function del() { $id = I('brand_id'); $brandLogic = new l\BrandLogic(); $result = $brandLogic->delBrand($id); $data['message'] = $result['message']; $this->ajaxReturn($data, 'JSON'); S('brands', NULL); }