diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index ad3ee02..1184e90 100644 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -6,6 +6,7 @@ use app\admin\logic\operation\OpurchaseclassLogic; use app\admin\validate\tools\GenerateTableValidate; use app\admin\logic\tools\GeneratorLogic; use app\common\service\pay\PayService; +use app\common\service\PushService; use app\common\service\wechat\WeChatMnpService; use app\common\service\wechat\WeChatOaService; use DateTime; @@ -20,11 +21,12 @@ class IndexController extends BaseApiController public function index() { - +// PushService::push('store_merchant_502', 502, '支付超时,订单已被取消,请重新提交订单'); +// d(1); // $extra=$this->request->post(); // Redis::send('push-supplier-products', ['order_id'=>11]); // createSupplierGoods - d(OpurchaseclassLogic::createSupplierGoods(['goods'=>99])); + // d(OpurchaseclassLogic::createSupplierGoods(['goods'=>99])); $queue = 'send-mail'; // 数据,可以直接传数组,无需序列化 $data = ['to' => 'tom@gmail.com', 'content' => 'hello']; diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 0c2d416..288bd08 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -107,9 +107,9 @@ class PayNotifyLogic extends BaseLogic } if ($order->pay_type == 9) { - PushService::push('cash_register_' . $order['user_id'], $order['user_id'], '您有一笔订单已支付'); + PushService::push('store_merchant_' . $order['merchant'], $order['merchant'], ['type'=>'cash_register','msg'=>'您有一笔订单已支付']); } else { - PushService::push('store_merchant_' . $order['merchant'], $order['merchant'], '您有一笔新的订单'); + PushService::push('store_merchant_' . $order['merchant'], $order['merchant'], ['type'=>'store_merchant','msg'=>'您有一笔新的订单']); } if (!empty($extra['payer']['openid']) && $order->pay_type != 9) { Redis::send('push-delivery', ['order_id' => $orderSn, 'openid' => $extra['payer']['openid']], 5); diff --git a/app/queue/redis/CodePaySend.php b/app/queue/redis/CodePaySend.php index 9ca8d8c..783442c 100644 --- a/app/queue/redis/CodePaySend.php +++ b/app/queue/redis/CodePaySend.php @@ -47,7 +47,7 @@ class CodePaySend implements Consumer if($find){ $order = Cashierclass::update($data); if($order){ - PushService::push('cash_register_'.$package['data']['user_id'], $package['data']['user_id'], '支付超时,订单已被取消,请重新提交订单'); + PushService::push('store_merchant_' . $order['merchant'], $order['merchant'], ['type'=>'cash_register','msg'=>'支付超时,订单已被取消,请重新提交订单']); } } } diff --git a/app/queue/redis/MyMailSend.php b/app/queue/redis/MyMailSend.php index eae0923..e5fa3bc 100644 --- a/app/queue/redis/MyMailSend.php +++ b/app/queue/redis/MyMailSend.php @@ -2,6 +2,7 @@ namespace app\queue\redis; +use app\common\service\PushService; use Webman\RedisQueue\Consumer; use Webman\Push\Api; use support\exception\BusinessException; @@ -46,9 +47,6 @@ class MyMailSend implements Consumer */ public function onConsumeFailure(\Throwable $e, $package) { - echo "consume failure\n"; - echo $e->getMessage() . "\n"; - // 无需反序列化 - var_export($package); + PushService::push('user-1', 1, '支付超时,订单已被取消,请重新提2222交订单'); } } \ No newline at end of file diff --git a/support/log/MonologExtendHandler.php b/support/log/MonologExtendHandler.php index 2560853..82217d1 100644 --- a/support/log/MonologExtendHandler.php +++ b/support/log/MonologExtendHandler.php @@ -106,7 +106,7 @@ class MonologExtendHandler extends StreamHandler // archive latest file clearstatcache(true, $fullLogFilename); if (file_exists($fullLogFilename)) { - $target = $logBasePath. time() . '_' . $filename; + $target = $logBasePath. date('Y-m') . '_' . $filename; rename($fullLogFilename, $target); }else{ if (!is_dir($logBasePath))