|
@@ -71,16 +71,12 @@ class CmsContentTemplateRepository {
|
|
|
public function edit($request)
|
|
|
{
|
|
|
$template_id = $this->cmsContentTemplate->find($request['id']);
|
|
|
- $where = ['city_id'=>$template_id->city_id,'apply_type'=>$template_id->apply_type];
|
|
|
- $template = $this->cmsContentTemplate->where($where)->get();
|
|
|
- foreach ($template->toArray() as $v){
|
|
|
- if ($v['is_open'] == 1 && $request['is_open'] == 0){
|
|
|
- throw new HttpException(500, '请先关闭该城市模块下已开启的模板后操作');
|
|
|
- }
|
|
|
- }
|
|
|
if ($request['city_id'] == 610100 && $request['is_open'] == 0){
|
|
|
throw new HttpException(500, '城市为西安的模板不允许手动关闭');
|
|
|
}
|
|
|
+ if ($request['is_open'] == 1 && $template_id->status == 0){
|
|
|
+ throw new HttpException(500, '请先配置模板并发布之后再开启');
|
|
|
+ }
|
|
|
|
|
|
$template_id->is_open = $request['is_open'];
|
|
|
$template_id->updated_at = date('Y-m-d H:i:s');
|