cmsContentTemplateSet = $cmsContentTemplateSet; } /** * banner配置 */ public function bannerSet($request) { $rules = json_decode($request['rule'],true); if (is_array($rules)){ if (count($rules)>10) { throw new HttpException(500, '最多只能添加10个banner海报'); } $subject = [ 'tpl_id' => $request['tpl_id'], 'rule' => $request['rule'], 'area_type' => $request['area_type'], 'status' => $request['status'], ]; if (!$this->cmsContentTemplateSet->create($subject)) { throw new HttpException(500, '添加失败'); } }else{ throw new HttpException(500, '参数格式有误'); } } /** * 专题广告配置 */ public function advertisementSet($request) { $rules = json_decode($request['rule'],true); if (is_array($rules)){ $subject = [ 'tpl_id' => $request['tpl_id'], 'rule' => $request['rule'], 'area_type' => $request['area_type'], 'status' => $request['status'], ]; if (!$this->cmsContentTemplateSet->create($subject)) { throw new HttpException(500, '添加失败'); } }else{ throw new HttpException(500, '参数格式有误'); } } /** * 商品楼层配置 */ public function floorSet($request) { $rules = json_decode($request['rule'],true); if (is_array($rules)){ $subject = [ 'tpl_id' => $request['tpl_id'], 'rule' => $request['rule'], 'area_type' => $request['area_type'], 'status' => $request['status'], ]; if (!$this->cmsContentTemplateSet->create($subject)) { throw new HttpException(500, '添加失败'); } }else{ throw new HttpException(500, '参数格式有误'); } } /** * 分类专题配置 */ public function categorySet($request) { $rules = json_decode($request['rule'],true); if (is_array($rules)){ $subject = [ 'tpl_id' => $request['tpl_id'], 'rule' => $request['rule'], 'area_type' => $request['area_type'], 'status' => $request['status'], ]; if (!$this->cmsContentTemplateSet->create($subject)) { throw new HttpException(500, '添加失败'); } }else{ throw new HttpException(500, '参数格式有误'); } } }