|
|
|
@ -95,7 +95,7 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
'character_string2' => $item->order_num, |
|
|
|
'date3' => $item->created_at_text??'', |
|
|
|
'thing4' => implode(";", $goods_temp_all), |
|
|
|
'thing7' => $item->note, |
|
|
|
'thing7' => $item->note??'无备注', |
|
|
|
], |
|
|
|
$page |
|
|
|
); |
|
|
|
@ -227,7 +227,7 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
'thing10' => implode(';', $goodsInfo), |
|
|
|
'amount3' => $refundStoreAmount, |
|
|
|
'date4' => $order->updated_at_text ?? '', |
|
|
|
'thing5' => $order->refund_note, |
|
|
|
'thing5' => $order->refund_note ?? '退款', |
|
|
|
], |
|
|
|
$page |
|
|
|
); |
|
|
|
@ -249,7 +249,7 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
$goodsInfo = OrderGoods::query()->whereIn('order_id', $orderIds)->pluck('name'); |
|
|
|
|
|
|
|
// 骑手信息
|
|
|
|
$horseman = Employees::query()->where(['id' => $orderMain->horseman_id])->whereJsonContains('positions', [(string)Employee::TYPE_HORSEMAN])->first(); |
|
|
|
$horseman = Employees::query()->where(['id' => $orderMain->horseman_id])->whereJsonContains('position', [(string)Employee::TYPE_HORSEMAN])->first(); |
|
|
|
|
|
|
|
// 发送给用户的
|
|
|
|
// 订单编号:{{character_string6.DATA}}\n商品名称:{{thing8.DATA}}\n骑手信息:{{thing7.DATA}}\n送出时间:{{date3.DATA}}\n温馨提示:{{thing4.DATA}}\n
|
|
|
|
@ -289,6 +289,42 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @inheritDoc |
|
|
|
*/ |
|
|
|
public function subscribeMsgForOrderComplete($orderMain) |
|
|
|
{ |
|
|
|
|
|
|
|
// 主订单信息
|
|
|
|
if (!($orderMain instanceof OrderMain)) { |
|
|
|
$orderMain = OrderMain::query()->where(['global_order_id' => $orderMain])->first(); |
|
|
|
} |
|
|
|
if (!$orderMain) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 骑手信息
|
|
|
|
$horseman = Employees::query()->where(['id' => $orderMain->horseman_id])->whereJsonContains('position', [(string)Employee::TYPE_HORSEMAN])->first(); |
|
|
|
|
|
|
|
// 发送小程序订阅消息给用户提示用户订单完成
|
|
|
|
// 订单编号:{{character_string2.DATA}}\n订单金额:{{amount5.DATA}}\n配送地址:{{thing3.DATA}}\n配送人员:{{thing4.DATA}}\n送达时间:{{time6.DATA}}\n
|
|
|
|
$userTmplId = 'slYHfLTzKDGWRxnNLyJBr7sb__PEhh9OCrSBpMW_pdE'; |
|
|
|
$userPage = 'pages/orderDetail/orderDetail?global_order_id=' . $orderMain->global_order_id; |
|
|
|
$userOpenid = User::query()->where(['id' => $orderMain->user_id])->value('openid'); |
|
|
|
$this->sendSubscribeMessage( |
|
|
|
$userOpenid, |
|
|
|
$userTmplId, |
|
|
|
[ |
|
|
|
'character_string2' => $orderMain->global_order_id, |
|
|
|
'amount5' => $orderMain->money, |
|
|
|
'thing3' => $orderMain->name . ' - ' . $orderMain->address . '(电话:'.$orderMain->tel.')', |
|
|
|
'thing4' => $horseman->name.'(电话:'.$horseman->tel.')', |
|
|
|
'time6' => date('Y-m-d H:i:s', $orderMain->complete_time_text), |
|
|
|
], |
|
|
|
$userPage |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @inheritDoc |
|
|
|
*/ |
|
|
|
|