From 8921d0c70e527db66ce10864714b759feeab258c Mon Sep 17 00:00:00 2001 From: weiz Date: Wed, 22 Nov 2023 11:08:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=97=B6=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LogisticsLogic.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/api/logic/LogisticsLogic.php b/app/api/logic/LogisticsLogic.php index a5d18e1e..e376cd4d 100644 --- a/app/api/logic/LogisticsLogic.php +++ b/app/api/logic/LogisticsLogic.php @@ -243,17 +243,19 @@ class LogisticsLogic extends BaseLogic return ['code'=>0, 'msg'=>$e->getMessage()]; } //推送消息 - $register_id = Courier::field('register_id')->where('id',$courier['user_id'])->find(); - if($register_id && !empty($register_id['register_id'])){ - $push_result1 = push_message($register_id['register_id'],'您有一条新的配送任务,请尽快处理!!'); - $push_result2 = push_message($register_id['register_id'],'您有一条新的配送任务,请尽快处理!!'); - if($push_result1['code'] == 0) { - Log::write('["极光推送:"]'.$push_result1['msg'],'error'); - } - if($push_result2['code'] == 0) { - Log::write('["极光推送:"]'.$push_result2['msg'],'error'); - } - } + $register_id = Courier::field('register_id,ytj_register_id')->where('id',$courier['user_id'])->findOrEmpty(); + if(!$register_id->isEmpty() && !empty($register_id['register_id'])){ + $push_result = push_message($register_id['register_id'],'您有一条新的配送任务,请尽快处理!!'); + if($push_result['code'] == 0) { + Log::write('["极光推送:"]'.$push_result['msg'],'error'); + } + } + if(!$register_id->isEmpty() && !empty($register_id['ytj_register_id'])){ + $push_result = push_message($register_id['ytj_register_id'],'您有一条新的配送任务,请尽快处理!!'); + if($push_result['code'] == 0) { + Log::write('["极光推送:"]'.$push_result['msg'],'error'); + } + } return ['code'=>1, 'msg'=>'操作成功','data'=>['nickname'=>$courier['master_name'],'phone'=>$courier['master_phone']]]; }