|
@@ -0,0 +1,33 @@
|
|
|
+<?php
|
|
|
+use app\common\model\MobileOrder;
|
|
|
+use think\Db;
|
|
|
+use think\Log;
|
|
|
+use Workerman\Worker as WO;
|
|
|
+
|
|
|
+class MobileOrderUnPayNotify{
|
|
|
+ public static function run()
|
|
|
+ {
|
|
|
+ $work=new WO();
|
|
|
+ $work->onWorkerStart=function ($conn){
|
|
|
+ while (true){
|
|
|
+ $orders= MobileOrder::waitPay()
|
|
|
+ ->where('type',1)
|
|
|
+ ->whereRaw('create_time+300<'.time())
|
|
|
+ ->field('id')
|
|
|
+ ->whereNotExists('select * from mobile_order_mind where mobile_order.id=mobile_order_mind.mobile_order_id')
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+ user_log(class_basename(__CLASS__),sprintf('%d条数据',count($orders)));
|
|
|
+ foreach ($orders as $orderId){
|
|
|
+ $order=MobileOrder::find($orderId);
|
|
|
+ if(!$order){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ sleep(1);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+}
|
|
|
+MobileOrderUnPayNotify::run();
|