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