Browse Source

音频,视频,私聊,礼物,充值

lizhen_gitee 1 year ago
parent
commit
31fab5f65e

+ 71 - 0
app/Console/Commands/Plantaskaudio.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+
+use Illuminate\Support\Facades\DB;
+use App\Jobs\AudioJob;
+
+class Plantaskaudio extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:Plantaskaudio';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        $map = [
+            ['plantask_status', '=' ,0],
+            ['updatetime'     , '<' ,time()-300],
+        ];
+        $list = DB::table('mt_user_match_audio_log')->where($map)->orderBy('id','asc')->get()->toArray();
+        //dd($list);
+
+        if(!empty($list)){
+            foreach($list as $key => $val){
+                $msg_id = $val->id;
+                dispatch((new AudioJob($msg_id))->delay(0));//加入队列
+            }
+
+            //更新
+            $ids = array_column($list,'id');
+
+            $update = [
+                'plantask_status' => 1,
+            ];
+
+            DB::table('mt_user_match_audio_log')->whereIn('id',$ids)->update($update);
+        }
+
+
+
+        return 0;
+    }
+}

+ 16 - 11
app/Console/Commands/Plantask.php → app/Console/Commands/Plantaskgift.php

@@ -8,14 +8,14 @@ use Illuminate\Console\Command;
 use Illuminate\Support\Facades\DB;
 use App\Jobs\GiftJob;
 
-class Plantask extends Command
+class Plantaskgift extends Command
 {
     /**
      * The name and signature of the console command.
      *
      * @var string
      */
-    protected $signature = 'command:Plantask';
+    protected $signature = 'command:Plantaskgift';
 
     /**
      * The console command description.
@@ -41,24 +41,29 @@ class Plantask extends Command
      */
     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);
-        //
+
         if(!empty($list)){
             foreach($list as $key => $val){
                 $msg_id = $val->id;
                 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;
     }

+ 72 - 0
app/Console/Commands/Plantaskrecharge.php

@@ -0,0 +1,72 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+
+use Illuminate\Support\Facades\DB;
+use App\Jobs\RechargeJob;
+
+class Plantaskrecharge extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:Plantaskrecharge';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        $map = [
+            ['table_name'      ,'=', 'gold_recharge'],
+            ['order_status'    ,'=', 1],
+            ['plantask_status' ,'=', 0],
+        ];
+        $list = DB::table('mt_pay_order')->where($map)->orderBy('id','asc')->get()->toArray();
+        //dd($list);
+
+        if(!empty($list)){
+            foreach($list as $key => $val){
+                $msg_id = $val->id;
+                dispatch((new RechargeJob($msg_id))->delay(0));//加入队列
+            }
+
+            //更新
+            $ids = array_column($list,'id');
+
+            $update = [
+                'plantask_status' => 1,
+            ];
+
+            DB::table('mt_pay_order')->whereIn('id',$ids)->update($update);
+        }
+
+
+
+        return 0;
+    }
+}

+ 70 - 0
app/Console/Commands/Plantasktyping.php

@@ -0,0 +1,70 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+
+use Illuminate\Support\Facades\DB;
+use App\Jobs\TypingJob;
+
+class Plantasktyping extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:Plantasktyping';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        $map = [
+            ['plantask_status', '=' ,0]
+        ];
+        $list = DB::table('mt_gift_user_typing')->where($map)->orderBy('id','asc')->get()->toArray();
+        //dd($list);
+
+        if(!empty($list)){
+            foreach($list as $key => $val){
+                $msg_id = $val->id;
+                dispatch((new TypingJob($msg_id))->delay(0));//加入队列
+            }
+
+            //更新
+            $ids = array_column($list,'id');
+
+            $update = [
+                'plantask_status' => 1,
+            ];
+
+            DB::table('mt_gift_user_typing')->whereIn('id',$ids)->update($update);
+        }
+
+
+
+        return 0;
+    }
+}

+ 71 - 0
app/Console/Commands/Plantaskvideo.php

@@ -0,0 +1,71 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+
+use Illuminate\Support\Facades\DB;
+use App\Jobs\VideoJob;
+
+class Plantaskvideo extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'command:Plantaskvideo';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+        $map = [
+            ['plantask_status', '=' ,0],
+            ['updatetime'     , '<' ,time()-300],
+        ];
+        $list = DB::table('mt_user_match_video_log')->where($map)->orderBy('id','asc')->get()->toArray();
+        //dd($list);
+
+        if(!empty($list)){
+            foreach($list as $key => $val){
+                $msg_id = $val->id;
+                dispatch((new VideoJob($msg_id))->delay(0));//加入队列
+            }
+
+            //更新
+            $ids = array_column($list,'id');
+
+            $update = [
+                'plantask_status' => 1,
+            ];
+
+            DB::table('mt_user_match_video_log')->whereIn('id',$ids)->update($update);
+        }
+
+
+
+        return 0;
+    }
+}

+ 5 - 1
app/Console/Kernel.php

@@ -16,7 +16,11 @@ class Kernel extends ConsoleKernel
     protected function schedule(Schedule $schedule)
     {
         // $schedule->command('inspire')->hourly();
-        $schedule->command('command:Plantask')->everyMinute();// 每分钟定时处理
+        $schedule->command('command:Plantaskaudio')->everyMinute();// 每分钟定时处理
+        $schedule->command('command:Plantaskgift')->everyMinute();// 每分钟定时处理
+        $schedule->command('command:Plantaskrecharge')->everyMinute();// 每分钟定时处理
+        $schedule->command('command:Plantasktyping')->everyMinute();// 每分钟定时处理
+        $schedule->command('command:Plantaskvideo')->everyMinute();// 每分钟定时处理
     }
 
     /**