瀏覽代碼

顺序修改

duqinya 6 年之前
父節點
當前提交
37fcfe7b41
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      app/Repositories/CmsContentTemplateSetRepository.php

+ 5 - 4
app/Repositories/CmsContentTemplateSetRepository.php

@@ -233,15 +233,16 @@ class CmsContentTemplateSetRepository {
             }
         }
 
-        $update_tpl = $this->cmsContentTemplate->where('id', $request['tpl_id'])->update(['status' => 1]);
-        if (!$update_tpl) {
-            throw new HttpException(500, '修改失败,请重试');
-        }
         $update_open = $this->cmsContentTemplate->whereIn('id', $update_is_open_ids)->delete();
         if (!$update_open) {
             throw new HttpException(500, '删除失败,请重试');
         }
 
+        $update_tpl = $this->cmsContentTemplate->where('id', $request['tpl_id'])->update(['status' => 1]);
+        if (!$update_tpl) {
+            throw new HttpException(500, '修改失败,请重试');
+        }
+
         $update_open = $this->cmsContentTemplateSet->whereIn('tpl_id', $update_is_open_ids)->update(['status' => 0]);
 
         if (!$update_open) {