Переглянути джерело

创建推广时,增加puid

liuzejian 1 рік тому
батько
коміт
f4bf6cf7dc

+ 3 - 1
modules/Tuiguang/Http/Controllers/PromotionController.php

@@ -116,9 +116,11 @@ class PromotionController extends CatchController
             'not_first_charge_template_id' => 'required',
         ]);
         $now = date('Y-m-d H:i:s');
+        $currentUser = $this->getCurrentUser();
         DB::table('promotions')
             ->insert([
-                'uid' => $this->getLoginUserId(),
+                'uid' => $currentUser->id,
+                'puid' => $currentUser->pid,
                 'miniprogram_id' => $request->input('miniprogram_id'),
                 'name' => $request->input('name'),
                 'video_id' => $request->input('video_id'),

+ 3 - 1
tests/Tuiguang/Http/Controllers/PromotionControllerTest.php

@@ -16,8 +16,10 @@ class PromotionControllerTest extends UsedTestCase
         ])->json('post','http://localhost/api/tuiguang/promotion/add', [
             'video_id' => 6,
             'series_sequence'  => 4,
-            'name' => 'kkkkddd',
+            'name' => 'kkkkddd的发的',
             'miniprogram_id' => 2,
+            'first_charge_template_id' => 1,
+            'not_first_charge_template_id' => 2
         ]);
 
         $res->dump();

+ 2 - 2
tests/UsedTestCase.php

@@ -15,9 +15,9 @@ abstract class UsedTestCase extends BaseTestCase
         $tokenInfo = $this->post('http://localhost/api/login', [
 //            'email' => 'catch@admin.com',
             'remember' => false,
-            'email' => 'xiaoli@qq.com',
+//            'email' => 'xiaoli@qq.com',
             'password' => 'catchadmin',
-//            'email' => 'aa4@test.com',
+            'email' => 'aa4@test.com',
         ])->json();
         $this->token = $tokenInfo['data']['token'];
     }