|
|
@@ -100,19 +100,15 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
|
|
|
//新订单通知 shish 20210529
|
|
|
- public static function newOrderNotice($shop, $order)
|
|
|
+ public static function newOrderInform($shop, $order)
|
|
|
{
|
|
|
$shopId = $shop->id;
|
|
|
$ptStyle = $shop->ptStyle;
|
|
|
- $wxBase = [
|
|
|
- dict::getDict('ptStyle', 'hd') => \bizHd\wx\classes\WxOpenClass::getWxInfo(),
|
|
|
- dict::getDict('ptStyle', 'ghs') => \bizHd\wx\classes\WxOpenClass::getGhsWxInfo(),
|
|
|
- dict::getDict('ptStyle', 'mall') => \bizHd\wx\classes\WxOpenClass::getMallWxInfo(),
|
|
|
- ];
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
$wx = $wxBase[$ptStyle] ?? [];
|
|
|
$message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
- $shortTempId = 'OPENTM417875155';//收入提醒
|
|
|
- $tempId = isset($message[$shortTempId]) ? $message[$shortTempId] : '';
|
|
|
+ $shortTempId = 'OPENTM417875155';//新订单通知
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
if (empty($tempId)) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -128,16 +124,16 @@ class WxMessageClass extends BaseClass
|
|
|
"template_id" => $tempId,
|
|
|
"url" => Yii::$app->params['ghsDomain'],
|
|
|
"data" => [
|
|
|
- "first" => ["value" => "恭喜,您获得一张优惠劵。", "color" => "#173177"],
|
|
|
- "keyword1" => ["value" => '查看', "color" => "#173177"],
|
|
|
- "keyword2" => ["value" => '优惠劵', "color" => "#173177"],
|
|
|
+ "first" => ["value" => "您有新的订单,请注意查收", "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => $order->orderSn, "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => $order->actPrice, "color" => "#173177"],
|
|
|
"keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
|
|
|
"remark" => ["value" => "点击查看详情", "color" => "#173177"]
|
|
|
]
|
|
|
];
|
|
|
$data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
$data['miniprogram']['pagepath'] = 'pagesOrder/detail?id=' . $orderId;
|
|
|
- wxUtil::sendTaskInform($data, $wx);
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
}
|
|
|
}
|
|
|
|