|
|
@@ -3,6 +3,7 @@
|
|
|
namespace biz\message\classes;
|
|
|
|
|
|
use biz\merchant\classes\MerchantClass;
|
|
|
+use common\components\httpUtil;
|
|
|
use common\components\sms;
|
|
|
use common\components\stringUtil;
|
|
|
use common\components\wxUtil;
|
|
|
@@ -16,18 +17,21 @@ class InformUserClass extends BaseClass
|
|
|
public static $baseFile = '\biz\message\models\InformUser';
|
|
|
|
|
|
//花送到了通知客户 shish
|
|
|
- public static function sendComplete($user, $order)
|
|
|
+ public static function sendComplete($user, $order, $merchant)
|
|
|
{
|
|
|
//通知客户
|
|
|
$openId = $user['openId'];
|
|
|
- $merchantId = $user['merchantId'];
|
|
|
- $merchant = MerchantClass::getById($merchantId);
|
|
|
+ $merchantId = $merchant['id'];
|
|
|
if (isset($user['subscribe']) && $user['subscribe'] == 1) {
|
|
|
$allTM = xhTMessageService::getList($merchantId);
|
|
|
$shortTempId = 'OPENTM201205968';//订单送达通知
|
|
|
$tempId = $allTM[$shortTempId];
|
|
|
- $data = ["touser" => $openId, "template_id" => $tempId,
|
|
|
- "url" => Yii::$app->params['mDomain'] . "/#/pages/order/detail?id={$order['id']}&account=" . $merchantId,
|
|
|
+ $url = Yii::$app->params['mDomain'] . "/#/pages/order/detail?id={$order['id']}&account=" . $merchantId;
|
|
|
+ $url = httpUtil::becomeHttps($url);
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => $url,
|
|
|
"data" => [
|
|
|
"first" => ["value" => '您的订单已送达', "color" => "#173177"],
|
|
|
"keyword1" => ["value" => (string)$order['orderSn'], "color" => "#173177"],
|
|
|
@@ -35,15 +39,15 @@ class InformUserClass extends BaseClass
|
|
|
"keyword3" => ["value" => '已送达', "color" => "#173177"],
|
|
|
"remark" => ["value" => '感谢您惠顾,祝你生活愉快!', "color" => "#173177"]]];
|
|
|
wxUtil::sendTaskInform($data, $merchant);
|
|
|
- return true;
|
|
|
+ } else {
|
|
|
+ if (isset($order['bookMobile']) && !empty($order['bookMobile']) && stringUtil::isMobile($order['bookMobile'])) {
|
|
|
+ $mobile = $order['bookMobile'];
|
|
|
+ $msg = '您的鲜花已送达,感谢惠顾,祝您生活愉快。';
|
|
|
+ sms::send($mobile, $msg, $merchant);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if (isset($order['bookMobile']) && !empty($order['bookMobile']) && stringUtil::isMobile($order['bookMobile'])) {
|
|
|
- $mobile = $order['bookMobile'];
|
|
|
- $msg = '您的鲜花已送达,感谢惠顾,祝您生活愉快。';
|
|
|
- sms::send($mobile, $msg, $merchant);
|
|
|
- }
|
|
|
-
|
|
|
+ //通知商家
|
|
|
}
|
|
|
|
|
|
}
|