|
|
@@ -37,6 +37,7 @@ class WxMessageClass extends BaseClass
|
|
|
'OPENTM407280253' => '退款成功通知',
|
|
|
'OPENTM411530050' => '充值成功提醒',
|
|
|
'OPENTM408238177' => '反馈进度通知',
|
|
|
+ 'OPENTM203447669' => '新客户加入通知',
|
|
|
],
|
|
|
//供货商
|
|
|
dict::getDict('ptStyle', 'ghs') => [
|
|
|
@@ -891,4 +892,54 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //花店新客户通知 ssh 20220919
|
|
|
+ public static function newHdCustomInform($shop, $custom, $introduce = [])
|
|
|
+ {
|
|
|
+ $ptStyle = $shop->ptStyle ?? 0;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'OPENTM203447669';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $customId = $custom->id ?? 0;
|
|
|
+ $customName = $custom->name ?? '';
|
|
|
+ $date = date("Y-m-d H:i:s");
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shop);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $first = '';
|
|
|
+ if (!empty($introduce)) {
|
|
|
+ $introName = $introduce->name ?? '';
|
|
|
+ $first = "此客户由【{$introName}】介绍";
|
|
|
+ }
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
+ if ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
|
|
|
+ $openId = isset($admin['ghsOpenId']) ? $admin['ghsOpenId'] : '';
|
|
|
+ }
|
|
|
+ if (empty($openId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "first" => ["value" => $first, "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => $customId, "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => $customName, "color" => "#D52B4D"],
|
|
|
+ "keyword3" => ["value" => $date, "color" => "#173177"],
|
|
|
+ "remark" => ["value" => '点击查看详情', "color" => "#173177"]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'admin/member/detail?id=' . $customId;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|