Explorar el Código

Merge branch 'liuzj-1000967-dev' into test

# Conflicts:
#	modules/Statistic/routes/route.php
liuzejian hace 1 año
padre
commit
0eb223f3b6

+ 11 - 2
app/Console/Commands/ContentManage/ContentTest.php

@@ -4,6 +4,7 @@ namespace App\Console\Commands\ContentManage;
 
 use http\Exception\RuntimeException;
 use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Redis;
 use Modules\Common\Errors\Errors;
 use Modules\Common\Exceptions\CommonBusinessException;
@@ -29,7 +30,15 @@ class ContentTest extends Command
      */
     public function handle(): void
     {
-       myLog('kkkkk')->info(date('Y-m-d H:i:s'));
-       throw new RuntimeException('kljkjljkjkl');
+       $result = DB::table('promotions')
+           ->where(['puid' => 0])
+           ->get();
+       foreach ($result as $item) {
+           DB::table('promotions')
+               ->where('id', $item->id)
+               ->update([
+                   'puid' => DB::table('users')->where('id', $item->uid)->value('pid')
+               ]);
+       }
     }
 }

+ 1 - 1
tests/Statistic/Http/Controllers/ROITJController.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Tests\Statistic\Http\Controllers;
+namespace Modules\Statistic\Http\Controllers;
 
 use Catch\Base\CatchController;
 use Illuminate\Foundation\Validation\ValidatesRequests;

+ 1 - 1
modules/Statistic/routes/route.php

@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Route;
 use Modules\Statistic\Http\Controllers\ChargeTJController;
 use Modules\Statistic\Http\Controllers\UserStatisticsController;
 use Modules\Statistic\Http\Controllers\VideoStatController;
-use Tests\Statistic\Http\Controllers\ROITJController;
+use Modules\Statistic\Http\Controllers\ROITJController;
 
 Route::prefix('statistic')->group(function(){
     //next

+ 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'];
     }