Browse Source

顺序修改

duqinya 6 years ago
parent
commit
37fcfe7b41
1 changed files with 5 additions and 4 deletions
  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) {