|
@@ -8,14 +8,14 @@ use Illuminate\Console\Command;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
use App\Jobs\GiftJob;
|
|
use App\Jobs\GiftJob;
|
|
|
|
|
|
-class Plantask extends Command
|
|
|
|
|
|
+class Plantaskgift extends Command
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
* The name and signature of the console command.
|
|
* The name and signature of the console command.
|
|
*
|
|
*
|
|
* @var string
|
|
* @var string
|
|
*/
|
|
*/
|
|
- protected $signature = 'command:Plantask';
|
|
|
|
|
|
+ protected $signature = 'command:Plantaskgift';
|
|
|
|
|
|
/**
|
|
/**
|
|
* The console command description.
|
|
* The console command description.
|
|
@@ -41,24 +41,29 @@ class Plantask extends Command
|
|
*/
|
|
*/
|
|
public function handle()
|
|
public function handle()
|
|
{
|
|
{
|
|
- $list = DB::table('hx_gift_user_party')->where('new_task_status',0)->orderBy('id','asc')->get()->toArray();
|
|
|
|
|
|
+ $map = [
|
|
|
|
+ ['plantask_status', '=' ,0]
|
|
|
|
+ ];
|
|
|
|
+ $list = DB::table('mt_gift_user_typing')->where($map)->orderBy('id','asc')->get()->toArray();
|
|
//dd($list);
|
|
//dd($list);
|
|
- //
|
|
|
|
|
|
+
|
|
if(!empty($list)){
|
|
if(!empty($list)){
|
|
foreach($list as $key => $val){
|
|
foreach($list as $key => $val){
|
|
$msg_id = $val->id;
|
|
$msg_id = $val->id;
|
|
dispatch((new GiftJob($msg_id))->delay(0));//加入队列
|
|
dispatch((new GiftJob($msg_id))->delay(0));//加入队列
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- //更新
|
|
|
|
- $ids = array_column($list,'id');
|
|
|
|
|
|
+ //更新
|
|
|
|
+ $ids = array_column($list,'id');
|
|
|
|
+
|
|
|
|
+ $update = [
|
|
|
|
+ 'plantask_status' => 1,
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ DB::table('mt_gift_user_typing')->whereIn('id',$ids)->update($update);
|
|
|
|
+ }
|
|
|
|
|
|
- $update = [
|
|
|
|
- 'new_task_status' => 1,
|
|
|
|
- ];
|
|
|
|
|
|
|
|
- DB::table('hx_gift_user_party')->whereIn('id',$ids)->update($update);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|