|
|
@@ -18,6 +18,7 @@ use think\db\exception\ModelNotFoundException;
|
|
|
use think\facade\Cache;
|
|
|
use crmeb\traits\ModelTrait;
|
|
|
use crmeb\basic\BaseModel;
|
|
|
+use think\facade\Route as Url;
|
|
|
|
|
|
/**
|
|
|
* TODO 用户消费新增金额明细 model
|
|
|
@@ -73,22 +74,36 @@ class UserSpread extends BaseModel
|
|
|
// 通知上级
|
|
|
$openid = WechatUser::where('uid', $spread_uid)->value('openid');
|
|
|
if (!empty($openid)){
|
|
|
+ $url = Url::buildUrl('/order/detail/wx175446111846779570')->suffix('')->domain(true)->build();
|
|
|
$group = [
|
|
|
'first' => '下级用户绑定成功通知',
|
|
|
'remark' => '点击查看订单详情'
|
|
|
];
|
|
|
$group = array_merge($group, [
|
|
|
-// 'thing1' => $user['nickname'], //用户姓名
|
|
|
+ 'thing4' => 'cs', //商品名称
|
|
|
// 'character_string2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
|
|
|
// 'phone_number21' => $order['user_address'],
|
|
|
// 'phone_number21' => '15356590576',
|
|
|
- 'character_string7' => $user['account'], //用户账号
|
|
|
- 'time3' => time(), //绑定时间
|
|
|
+ 'thing13' => 'cs', //快递公司
|
|
|
+ 'character_string14' => 12345789//快递单号
|
|
|
]);
|
|
|
- @file_put_contents('quanju.txt', $openid."-openid\r\n", 8);
|
|
|
- @file_put_contents('quanju.txt', json_encode($group)."-模版消息3\r\n", 8);
|
|
|
- $res= WechatTemplateService::sendTemplate($openid, WechatTemplateService::BARGAIN_SUCCESS, $group);
|
|
|
- @file_put_contents('quanju.txt', json_encode($res)."-模版消息返回3\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);
|
|
|
+
|
|
|
+// $group = array_merge($group, [
|
|
|
+//// 'thing1' => $user['nickname'], //用户姓名
|
|
|
+//// 'character_string2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
|
|
|
+//// 'phone_number21' => $order['user_address'],
|
|
|
+//// 'phone_number21' => '15356590576',
|
|
|
+// 'character_string7' => $user['account'], //用户账号
|
|
|
+// 'time3' => time(), //绑定时间
|
|
|
+// ]);
|
|
|
+
|
|
|
+// @file_put_contents('quanju.txt', $openid."-openid\r\n", 8);
|
|
|
+// @file_put_contents('quanju.txt', json_encode($group)."-模版消息3\r\n", 8);
|
|
|
+// $res= WechatTemplateService::sendTemplate($openid, WechatTemplateService::BARGAIN_SUCCESS, $group);
|
|
|
+// @file_put_contents('quanju.txt', json_encode($res)."-模版消息返回3\r\n", 8);
|
|
|
|
|
|
}
|
|
|
|