|
|
@@ -129,8 +129,10 @@ class WxMessageClass extends BaseClass
|
|
|
if (!empty($customName)) {
|
|
|
$first = '下单客户:' . $customName;
|
|
|
}
|
|
|
-
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -170,6 +172,9 @@ class WxMessageClass extends BaseClass
|
|
|
$orderId = $order->id;
|
|
|
$actPrice = $order->actPrice;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -261,6 +266,9 @@ class WxMessageClass extends BaseClass
|
|
|
$orderSn = (string)$order->orderSn;
|
|
|
$totalFee = $order->actPrice;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -305,6 +313,9 @@ class WxMessageClass extends BaseClass
|
|
|
$orderId = $order->id;
|
|
|
$orderSn = (string)$order->orderSn;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
$ghsShopAdminName = $order->ghsShopAdminName ?? '';
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
@@ -347,6 +358,9 @@ class WxMessageClass extends BaseClass
|
|
|
$name = $custom->name ?? '';
|
|
|
$customId = $custom->id;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -387,6 +401,9 @@ class WxMessageClass extends BaseClass
|
|
|
$actPrice = $order->actPrice;
|
|
|
$orderId = $order->id;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -427,6 +444,9 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
$amount = $cash->amount;
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -467,6 +487,9 @@ class WxMessageClass extends BaseClass
|
|
|
$orderSn = (string)$order->orderSn ?? '';
|
|
|
$customName = $order->customName ?? '';
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -507,6 +530,9 @@ class WxMessageClass extends BaseClass
|
|
|
$orderId = $cg->id ?? '';
|
|
|
$orderSn = (string)$cg->orderSn ?? '';
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -549,6 +575,9 @@ class WxMessageClass extends BaseClass
|
|
|
$shopName = $shop->shopName ?? '';
|
|
|
$date = date("Y-m-d H:i:s");
|
|
|
$adminList = ShopAdminClass::getRemainAdmin($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
foreach ($adminList as $admin) {
|
|
|
if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
|
|
|
continue;
|
|
|
@@ -573,4 +602,47 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //供应商新客户通知 shish 20210909
|
|
|
+ public static function newGhsCustomInform($shop, $custom)
|
|
|
+ {
|
|
|
+ $shopId = $shop['id'] ?? 0;
|
|
|
+ $ptStyle = $shop['ptStyle'] ?? 0;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'OPENTM206773265';
|
|
|
+ $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($shopId);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ 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" => $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'] = 'pagesClient/member/detail?id=' . $customId;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|