浏览代码

no message

duqinya 6 年之前
父节点
当前提交
d70700b5f7
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      app/Repositories/CmsContentTemplateSetRepository.php

+ 6 - 3
app/Repositories/CmsContentTemplateSetRepository.php

@@ -325,9 +325,12 @@ class CmsContentTemplateSetRepository {
             }
         }
 
-        $update_tpl = $this->cmsContentTemplate->where('id', $request['tpl_id'])->update(['status' => 1]);
-        if (!$update_tpl) {
-            throw new HttpException(500, '修改失败,请重试');
+        $update_tpl = $this->cmsContentTemplate->where('id', $request['tpl_id'])->first();
+        if ($update_tpl){
+            $result = $this->cmsContentTemplate->where('id', $request['tpl_id'])->update(['status' => 1]);
+            if (!$result) {
+                throw new HttpException(500, '修改失败,请重试');
+            }
         }
 
         $template_id = $this->cmsContentTemplateSet->where('tpl_id',$request['tpl_id'])->get();