From d4fa1514ddfb0ccf074bb5bb831bb7291d7bd392 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Thu, 13 Jul 2023 13:46:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E7=94=A8=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E5=90=8E=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/JgPush.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/app/common/service/JgPush.php b/app/common/service/JgPush.php index 8b792781..5c41bc5f 100644 --- a/app/common/service/JgPush.php +++ b/app/common/service/JgPush.php @@ -2,6 +2,7 @@ namespace app\common\service; +use app\common\model\store\order\StoreGroupOrder; use app\common\model\system\merchant\Merchant; use app\common\model\user\User; use app\common\repositories\store\order\StoreGroupOrderRepository; @@ -34,9 +35,10 @@ class JgPush if (empty($jgRegisterId)) { continue; } + $msg = $order['pay_type'] == StoreGroupOrder::PAY_TYPE_CREDIT_BUY ? '您有新的订单已结算,请注意查看。' : '您有新的订单,请注意查看。'; $this->addRegistrationId($jgRegisterId); - $this->androidNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]); - $this->iosNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]); + $this->androidNotification($msg, ['extras' => ['route' => $route]]); + $this->iosNotification($msg, ['extras' => ['route' => $route]]); $this->push->send(); } } @@ -67,6 +69,22 @@ class JgPush $this->iosNotification('您的先货后款订单即将逾期,请尽快处理!', ['extras' => ['route' => $route]]); $this->push->send(); break; + case 'ORDER_CREATE': + $order = app()->make(StoreOrderRepository::class)->get($data['id']); + if ($order->pay_type != StoreGroupOrder::PAY_TYPE_CREDIT_BUY) { + break; + } + $route = "/pages/admin/orderDetail/index?id={$order['order_id']}&mer_id={$order['mer_id']}"; + $merUserId = Merchant::where('mer_id', $order['mer_id'])->value('uid'); + $jgRegisterId = User::where('uid', $merUserId)->value('jg_register_id'); + if (empty($jgRegisterId)) { + break; + } + $this->addRegistrationId($jgRegisterId); + $this->androidNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]); + $this->iosNotification('您有新的订单,请注意查看。', ['extras' => ['route' => $route]]); + $this->push->send(); + break; default: break; }