|
|
@@ -658,6 +658,92 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //供货商的客户介绍新客并且下单,获得红包通知商家 shish 20211027
|
|
|
+ public static function ghsCustomTjGetGiftInform($shop, $custom, $beTjCustom)
|
|
|
+ {
|
|
|
+ $shopId = $shop->id ?? 0;
|
|
|
+ $ptStyle = $shop->ptStyle ?? 0;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'OPENTM408238177';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $customId = $custom->id ?? 0;
|
|
|
+ $customName = $custom->name ?? '';
|
|
|
+ $beTjCustomName = $beTjCustom->name ?? '';
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
+ if (empty($openId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "first" => ["value" => $beTjCustomName . " 推荐的客户 {$customName} 下单" . "获得推荐新客红包", "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => "推荐新客红包", "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => "已领取", "color" => "#173177"],
|
|
|
+ "remark" => ["value" => '点击查看客户', "color" => "#173177"]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'pagesClient/member/detail?id=' . $customId;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //花店推荐供货商客户获得红包 shish 20211027
|
|
|
+ public static function hdTjGhsCustomGetGiftInform($shop, $ghs, $beTjCustom)
|
|
|
+ {
|
|
|
+ $shopId = $shop->id ?? 0;
|
|
|
+ $ptStyle = $shop->ptStyle ?? 0;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'OPENTM408238177';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $beTjCustomName = $beTjCustom->name ?? '';
|
|
|
+ $ghsName = $ghs->name ?? '';
|
|
|
+
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
+ if (empty($openId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "first" => ["value" => "您推荐的客户 {$beTjCustomName} 在 {$ghsName} 下单" . "获得推荐新客红包", "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => "推荐新客红包", "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => "已获得", "color" => "#173177"],
|
|
|
+ "remark" => ["value" => '点击查看客户', "color" => "#173177"]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'admin/coupon/couponList';
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//供应商新客户通知 shish 20210909
|
|
|
public static function newGhsCustomInform($shop, $custom, $introduce)
|
|
|
{
|
|
|
@@ -681,7 +767,7 @@ class WxMessageClass extends BaseClass
|
|
|
$first = '';
|
|
|
if (!empty($introduce)) {
|
|
|
$introName = $introduce->name ?? '';
|
|
|
- $first = "本客户由【{$introName}】介绍";
|
|
|
+ $first = "此客户由【{$introName}】介绍";
|
|
|
}
|
|
|
foreach ($adminList as $admin) {
|
|
|
$openId = isset($admin['openId']) ? $admin['openId'] : '';
|