Browse Source

no message

duqinya 6 years ago
parent
commit
d70700b5f7
1 changed files with 6 additions and 3 deletions
  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();