|
@@ -3,6 +3,7 @@
|
|
|
namespace biz\wx\classes;
|
|
namespace biz\wx\classes;
|
|
|
|
|
|
|
|
use biz\base\classes\BaseClass;
|
|
use biz\base\classes\BaseClass;
|
|
|
|
|
+use biz\shop\classes\ShopAdminClass;
|
|
|
use common\components\dict;
|
|
use common\components\dict;
|
|
|
use common\components\util;
|
|
use common\components\util;
|
|
|
use common\components\wxUtil;
|
|
use common\components\wxUtil;
|
|
@@ -24,7 +25,6 @@ class WxMessageClass extends BaseClass
|
|
|
'TM00006' => '充值通知',
|
|
'TM00006' => '充值通知',
|
|
|
'OPENTM201205968' => '订单送达通知',
|
|
'OPENTM201205968' => '订单送达通知',
|
|
|
'OPENTM207777535' => '付款提醒',
|
|
'OPENTM207777535' => '付款提醒',
|
|
|
- 'OPENTM200605630' => '任务处理通知',
|
|
|
|
|
'OPENTM207422813' => '收入提醒',
|
|
'OPENTM207422813' => '收入提醒',
|
|
|
'OPENTM202297555' => '下单成功通知',
|
|
'OPENTM202297555' => '下单成功通知',
|
|
|
'OPENTM207327227' => '宝贝售出提醒',
|
|
'OPENTM207327227' => '宝贝售出提醒',
|
|
@@ -38,7 +38,6 @@ class WxMessageClass extends BaseClass
|
|
|
'TM00006' => '充值通知',
|
|
'TM00006' => '充值通知',
|
|
|
'OPENTM201205968' => '订单送达通知',
|
|
'OPENTM201205968' => '订单送达通知',
|
|
|
'OPENTM207777535' => '付款提醒',
|
|
'OPENTM207777535' => '付款提醒',
|
|
|
- 'OPENTM200605630' => '任务处理通知',
|
|
|
|
|
'OPENTM207422813' => '收入提醒',
|
|
'OPENTM207422813' => '收入提醒',
|
|
|
'OPENTM202297555' => '下单成功通知',
|
|
'OPENTM202297555' => '下单成功通知',
|
|
|
'OPENTM207327227' => '宝贝售出提醒',
|
|
'OPENTM207327227' => '宝贝售出提醒',
|
|
@@ -100,4 +99,46 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //新订单通知 shish 20210529
|
|
|
|
|
+ public static function newOrderNotice($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(),
|
|
|
|
|
+ ];
|
|
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
|
|
+ $shortTempId = 'OPENTM417875155';//收入提醒
|
|
|
|
|
+ $tempId = isset($message[$shortTempId]) ? $message[$shortTempId] : '';
|
|
|
|
|
+ if (empty($tempId)) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $orderId = $order->id;
|
|
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
|
|
+ if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
|
|
+ $data = [
|
|
|
|
|
+ "touser" => $openId,
|
|
|
|
|
+ "template_id" => $tempId,
|
|
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
|
|
+ "data" => [
|
|
|
|
|
+ "first" => ["value" => "恭喜,您获得一张优惠劵。", "color" => "#173177"],
|
|
|
|
|
+ "keyword1" => ["value" => '查看', "color" => "#173177"],
|
|
|
|
|
+ "keyword2" => ["value" => '优惠劵', "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);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|