|
@@ -1084,8 +1084,8 @@ HTML;
|
|
|
'remark' => '点击查看订单详情'
|
|
'remark' => '点击查看订单详情'
|
|
|
];
|
|
];
|
|
|
@file_put_contents('quanju.txt', json_encode($postageData)."-测试模版消息\r\n", 8);
|
|
@file_put_contents('quanju.txt', json_encode($postageData)."-测试模版消息\r\n", 8);
|
|
|
|
|
+ $goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
|
|
|
if ($postageData['delivery_type'] == 'express') {//快递
|
|
if ($postageData['delivery_type'] == 'express') {//快递
|
|
|
- $goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
|
|
|
|
|
if ($order['is_channel'] == 1) {
|
|
if ($order['is_channel'] == 1) {
|
|
|
//小程序送货模版消息
|
|
//小程序送货模版消息
|
|
|
RoutineTemplate::sendOrderPostage($order);
|
|
RoutineTemplate::sendOrderPostage($order);
|
|
@@ -1098,21 +1098,21 @@ HTML;
|
|
|
// 'keyword4' => $postageData['delivery_name'],
|
|
// 'keyword4' => $postageData['delivery_name'],
|
|
|
// 'keyword5' => $postageData['delivery_id']
|
|
// 'keyword5' => $postageData['delivery_id']
|
|
|
// ]);
|
|
// ]);
|
|
|
- var_dump($goodsName);die();
|
|
|
|
|
- if ($goodsName === ''){
|
|
|
|
|
- $goodsName = '商品';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// var_dump($goodsName);die();
|
|
|
|
|
+// if ($goodsName === ''){
|
|
|
|
|
+// $goodsName = '商品';
|
|
|
|
|
+// }
|
|
|
$group = array_merge($group, [
|
|
$group = array_merge($group, [
|
|
|
- 'thing4' => '测试商品',
|
|
|
|
|
- 'character_string2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
|
|
|
|
|
|
|
+ 'thing4' => $goodsName, //商品名称
|
|
|
|
|
+// 'character_string2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
|
|
|
// 'phone_number21' => $order['user_address'],
|
|
// 'phone_number21' => $order['user_address'],
|
|
|
- 'phone_number21' => '15356590576',
|
|
|
|
|
- 'thing13' => $postageData['delivery_name'],
|
|
|
|
|
- 'character_string14' => $postageData['delivery_id']
|
|
|
|
|
|
|
+// 'phone_number21' => '15356590576',
|
|
|
|
|
+ 'thing13' => $postageData['delivery_name'], //快递公司
|
|
|
|
|
+ 'character_string14' => $postageData['delivery_id'] //快递单号
|
|
|
]);
|
|
]);
|
|
|
- @file_put_contents('quanju.txt', json_encode($group)."-模版消息\r\n", 8);
|
|
|
|
|
- $res= WechatTemplateService::sendTemplate($openid, WechatTemplateService::ORDER_DELIVER_SUCCESS, $group, $url);
|
|
|
|
|
- @file_put_contents('quanju.txt', json_encode($res)."-模版消息返回\r\n", 8);
|
|
|
|
|
|
|
+ @file_put_contents('quanju.txt', json_encode($group)."-模版消息1\r\n", 8);
|
|
|
|
|
+ $res= WechatTemplateService::sendTemplate($openid, WechatTemplateService::ORDER_POSTAGE_SUCCESS, $group, $url);
|
|
|
|
|
+ @file_put_contents('quanju.txt', json_encode($res)."-模版消息返回1\r\n", 8);
|
|
|
}
|
|
}
|
|
|
} else if ($postageData['delivery_type'] == 'send') {//送货
|
|
} else if ($postageData['delivery_type'] == 'send') {//送货
|
|
|
if ($order['is_channel'] == 1) {
|
|
if ($order['is_channel'] == 1) {
|
|
@@ -1120,11 +1120,25 @@ HTML;
|
|
|
RoutineTemplate::sendOrderPostage($order, 1);
|
|
RoutineTemplate::sendOrderPostage($order, 1);
|
|
|
} else {//公众号
|
|
} else {//公众号
|
|
|
try {
|
|
try {
|
|
|
- @file_put_contents('quanju.txt', "-模版消息22\r\n", 8);
|
|
|
|
|
$openid = WechatUser::where('uid', $order['uid'])->value('openid');
|
|
$openid = WechatUser::where('uid', $order['uid'])->value('openid');
|
|
|
- $content = "亲,您的订单{$order['order_id']}已发货,请注意查收!\n快递公司:{$order['delivery_name']}\n快递单号:{$order['delivery_id']}\n";
|
|
|
|
|
- $content .= '<a href="https://m.kuaidi100.com/result.jsp?nu=' . $order['delivery_id'] . '">点击查看物流信息</a>';
|
|
|
|
|
- WechatService::staffService()->message($content)->to($openid)->send();
|
|
|
|
|
|
|
+ $group = array_merge($group, [
|
|
|
|
|
+ 'thing6' => $goodsName, //商品名称
|
|
|
|
|
+// 'character_string2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
|
|
|
|
|
+// 'phone_number21' => $order['user_address'],
|
|
|
|
|
+// 'phone_number21' => '15356590576',
|
|
|
|
|
+ 'thing10' => $postageData['delivery_name'], //送货人员
|
|
|
|
|
+ 'phone_number11' => $postageData['delivery_id'], //送货电话
|
|
|
|
|
+ 'thing3' => $order['user_address'] //配送地址
|
|
|
|
|
+ ]);
|
|
|
|
|
+ @file_put_contents('quanju.txt', json_encode($group)."-模版消息2\r\n", 8);
|
|
|
|
|
+ $res= WechatTemplateService::sendTemplate($openid, WechatTemplateService::ORDER_DELIVER_SUCCESS, $group, $url);
|
|
|
|
|
+ @file_put_contents('quanju.txt', json_encode($res)."-模版消息返回2\r\n", 8);
|
|
|
|
|
+
|
|
|
|
|
+// @file_put_contents('quanju.txt', "-模版消息22\r\n", 8);
|
|
|
|
|
+// $openid = WechatUser::where('uid', $order['uid'])->value('openid');
|
|
|
|
|
+// $content = "亲,您的订单{$order['order_id']}已发货,请注意查收!\n快递公司:{$order['delivery_name']}\n快递单号:{$order['delivery_id']}\n";
|
|
|
|
|
+// $content .= '<a href="https://m.kuaidi100.com/result.jsp?nu=' . $order['delivery_id'] . '">点击查看物流信息</a>';
|
|
|
|
|
+// WechatService::staffService()->message($content)->to($openid)->send();
|
|
|
}catch (\Exception $e){
|
|
}catch (\Exception $e){
|
|
|
|
|
|
|
|
}
|
|
}
|