From 78332ca6b7a90fe04c548d2172ff31ba3e176183 Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Wed, 16 Aug 2023 16:50:24 +0800 Subject: [PATCH] add log to jpush --- app/api/controller/GpsController.php | 2 +- app/api/logic/LogisticsLogic.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/controller/GpsController.php b/app/api/controller/GpsController.php index be74c0a3..0897e0ff 100644 --- a/app/api/controller/GpsController.php +++ b/app/api/controller/GpsController.php @@ -61,7 +61,7 @@ class GpsController extends BaseApiController 'title' => '测试消息', 'msg_content' => '这是一条新的推送消息' ]; - $res = push_message('18071adc021402b58fb','这是条测试信息'); + $res = push_message('18071adc021402b58fb2','这是条测试信息'); dump($res); return !($res['code'] == 0); } diff --git a/app/api/logic/LogisticsLogic.php b/app/api/logic/LogisticsLogic.php index 0927c530..08b4e60d 100644 --- a/app/api/logic/LogisticsLogic.php +++ b/app/api/logic/LogisticsLogic.php @@ -22,6 +22,7 @@ use app\common\model\logistics\Order; use app\common\model\logistics\Product; use app\common\model\logistics\LogisticsRecord; use app\common\model\logistics\User; +use think\facade\Log; /** @@ -218,7 +219,10 @@ class LogisticsLogic extends BaseLogic ]); //推送消息 if(!empty($courier['register_id'])){ - push_message($courier['register_id'],'您有一条新的配送任务,请尽快处理!!'); + $push_result = push_message($courier['register_id'],'您有一条新的配送任务,请尽快处理!!'); + if($push_result['code'] == 0) { + Log::write('["极光推送:"]'.$push_result['msg'],'error'); + } } Logistics::commit(); return ['code'=>1, 'msg'=>'操作成功','data'=>['nickname'=>$courier['nickname'],'phone'=>$courier['mobile']]];