Parcourir la source

调整代码位置

liuzejian il y a 1 an
Parent
commit
ab27ec23d6

+ 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

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