Просмотр исходного кода

修改存储多条数据为一条

duqinya лет назад: 6
Родитель
Сommit
8291f4963a
1 измененных файлов с 1 добавлено и 8 удалено
  1. 1 8
      app/Repositories/CmsContentTemplateSetRepository.php

+ 1 - 8
app/Repositories/CmsContentTemplateSetRepository.php

@@ -30,12 +30,8 @@ class CmsContentTemplateSetRepository {
                 if (count($rules)>10) {
                     throw new HttpException(500, '最多只能添加10个banner海报');
                 }
-//                    $decode_floor = json_decode($request['rule'], true);
-                    $count = count($rules);
-                    if ($count > 0) {
-                        for ($i = 0; $i < $count; $i++) {
                             $subject = [
-                                'rule' => json_encode($rules[$i]),
+                                'rule' => json_encode($rules),
                                 'tpl_id' => $request['tpl_id'],
                                 'area_type' => $request['area_type'],
                                 'status' => 0,
@@ -50,9 +46,6 @@ class CmsContentTemplateSetRepository {
                                     throw new HttpException(500, '添加失败');
                                 }
                             }
-
-                        }
-                    }
             }else{
                 throw new HttpException(500, '参数格式有误');
             }