|
|
@@ -238,28 +238,35 @@ class HdDeliveryOrderClass extends BaseClass
|
|
|
if (isset($ret['msg'])) {
|
|
|
Yii::error("hd-orderId={$orderId}, 创建跑腿失败:" . $ret['msg']);
|
|
|
noticeUtil::push("hd-orderId={$orderId}, 创建跑腿失败:" . $ret['msg']);
|
|
|
+ self::sendAppNotice($shopId, $orderId, "hd-orderId={$orderId}, 创建跑腿失败:" . $ret['msg']); // 发 App 通知
|
|
|
return ConsumerInterface::MSG_REJECT;
|
|
|
}
|
|
|
|
|
|
- Yii::error("ghs-orderId={$orderId}, 创建跑腿失败");
|
|
|
- noticeUtil::push("ghs-orderId={$orderId}, 创建跑腿失败");
|
|
|
+ Yii::error("hd-orderId={$orderId}, 创建跑腿失败");
|
|
|
+ noticeUtil::push("hd-orderId={$orderId}, 创建跑腿失败");
|
|
|
+ self::sendAppNotice($shopId, $orderId, '创建跑腿失败'); // 发 App 通知
|
|
|
return ConsumerInterface::MSG_REJECT;
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
Yii::error("hd-orderId={$orderId} 创建跑腿失败:" . $e->getMessage());
|
|
|
noticeUtil::push("hd-orderId={$orderId} 创建跑腿失败:" . $e->getMessage());
|
|
|
-
|
|
|
// 发 App 通知
|
|
|
- $title = '发跑腿失败';
|
|
|
- $msg = "零售订单:{$orderId}, 创建跑腿失败:" . $e->getMessage();
|
|
|
- $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
|
|
|
- $cids = array_column($allDevices, 'clientId');
|
|
|
- $push = new push('hd', push::MSG_TYPE_WORK);
|
|
|
- $push->pushByCloud($cids, $title, $msg, []);
|
|
|
+ self::sendAppNotice($shopId, $orderId, $e->getMessage());
|
|
|
|
|
|
return ConsumerInterface::MSG_REJECT;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // 发 App 通知
|
|
|
+ public static function sendAppNotice($shopId, $orderId, $msg)
|
|
|
+ {
|
|
|
+ $title = '发跑腿失败';
|
|
|
+ $msg = "零售订单:{$orderId}, 创建跑腿失败:" . $msg;
|
|
|
+ $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
|
|
|
+ $cids = array_column($allDevices, 'clientId');
|
|
|
+ $push = new push('hd', push::MSG_TYPE_WORK);
|
|
|
+ $push->pushByCloud($cids, $title, $msg, []);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 在同文件末尾追加一个内联的 AR 类
|