Parcourir la source

Merge branch 'liuzj-1000959-dev' into test

liuzejian il y a 1 an
Parent
commit
c452cab0f3

+ 2 - 2
modules/Tuiguang/Http/Controllers/PromotionController.php

@@ -56,7 +56,7 @@ class PromotionController extends CatchController
                 'promotions.callback_config_id', 'promotions.video_id', 'promotions.remark', 'promotions.status',
             'promotions.first_charge_template_id', 'promotions.not_first_charge_template_id')
             ->paginate($request->input('limit', 15));
-        $chargeTemplateIds = $result->pluck('first_charge_template_id')->merge('not_first_charge_template_id')->unique();
+        $chargeTemplateIds = $result->pluck('first_charge_template_id')->merge($result->pluck('not_first_charge_template_id'))->unique();
 
         $payTemplates = DB::table('pay_templates')->whereIn('id', $chargeTemplateIds)
             ->select('id', 'name')
@@ -98,7 +98,7 @@ class PromotionController extends CatchController
         DB::table('promotions')
             ->where(['id' => $request->input('id'), 'uid' => $this->getLoginUserId(), 'is_enabled' => 1])
             ->update(['series_sequence' => $request->input('series_sequence'),
-                'remark' => $request->input('remark', ''),
+                'remark' => $request->input('remark') ?? '',
                 'first_charge_template_id' => $request->input('first_charge_template_id'),
                 'not_first_charge_template_id' => $request->input('not_first_charge_template_id'),
                 'updated_at' => date('Y-m-d H:i:s')]);

+ 5 - 2
tests/Tuiguang/Http/Controllers/PromotionControllerTest.php

@@ -40,8 +40,11 @@ class PromotionControllerTest extends UsedTestCase
         $res = $this->withHeaders([
             'Authorization' => 'Bearer '. $this->token,
         ])->json('post','http://localhost/api/tuiguang/promotion/updateSeriesSequence', [
-            'id' => 2,
-            'series_sequence' => 5
+            'id' => 136,
+            'series_sequence' => 5,
+            'remark' => '',
+            'first_charge_template_id' => 1,
+            'not_first_charge_template_id' => 2
         ]);
 
         $res->dump();