|
@@ -1,11 +1,10 @@
|
|
|
<?php
|
|
|
use app\common\model\MobileOrder;
|
|
|
use app\common\service\SmsSend;
|
|
|
-use think\Db;
|
|
|
-use think\Log;
|
|
|
+
|
|
|
use Workerman\Worker as WO;
|
|
|
|
|
|
-class MobileOrderUnPayNotify{
|
|
|
+class MobileOrderUnPayNotify extends Com{
|
|
|
public static function run()
|
|
|
{
|
|
|
$work=new WO();
|
|
@@ -18,17 +17,26 @@ class MobileOrderUnPayNotify{
|
|
|
->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)));
|
|
|
+ self::log(sprintf('%d条数据',count($orders)));
|
|
|
foreach ($orders as $orderId){
|
|
|
- $order=MobileOrder::find($orderId);
|
|
|
- if(!$order){
|
|
|
- continue;
|
|
|
+ try {
|
|
|
+ $order=MobileOrder::find($orderId);
|
|
|
+ if(!$order){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ SmsSend::orderUnPay($order['phone'],$order['no']);
|
|
|
+ $order->mind()->save([]);
|
|
|
+ }catch (\Exception $e){
|
|
|
+ self::logError($e);
|
|
|
}
|
|
|
- SmsSend::orderUnPay($order['phone'],$order['no']);
|
|
|
}
|
|
|
sleep(1);
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
+ public static function logname(){
|
|
|
+ return class_basename(__CLASS__);
|
|
|
+ }
|
|
|
}
|
|
|
MobileOrderUnPayNotify::run();
|