|
@@ -0,0 +1,50 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Jobs;
|
|
|
+
|
|
|
+use App\Wen\Utils\Settings;
|
|
|
+use App\Wen\Utils\UserUtils;
|
|
|
+use Illuminate\Bus\Queueable;
|
|
|
+use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
|
+use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
+use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
+use Illuminate\Queue\InteractsWithQueue;
|
|
|
+use Illuminate\Queue\SerializesModels;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
+
|
|
|
+class AskFinishJob implements ShouldQueue
|
|
|
+{
|
|
|
+ use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Create a new job instance.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Execute the job.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function handle()
|
|
|
+ {
|
|
|
+ //已支付状态,且倒计时时间已经到了。给修改为结束
|
|
|
+ $where = [
|
|
|
+ ['status','=',10],
|
|
|
+ ['countdown_time','<',time() - 120], //延迟2分钟
|
|
|
+ ];
|
|
|
+
|
|
|
+ $update = [
|
|
|
+ 'status' => 20,
|
|
|
+ 'finish_time' => time(),
|
|
|
+ ];
|
|
|
+
|
|
|
+ DB::table('ask_order')->where($where)->update($update);
|
|
|
+
|
|
|
+ }
|
|
|
+}
|