Jelajahi Sumber

新客户加入app通知

shish 4 tahun lalu
induk
melakukan
d2f8bc62d5
2 mengubah file dengan 25 tambahan dan 1 penghapusan
  1. 3 0
      biz/ghs/classes/GhsClass.php
  2. 22 1
      biz/notice/classes/NoticeClass.php

+ 3 - 0
biz/ghs/classes/GhsClass.php

@@ -2,6 +2,7 @@
 
 namespace biz\ghs\classes;
 
+use biz\notice\classes\NoticeClass;
 use biz\shop\classes\ShopClass;
 use biz\shop\services\ShopService;
 use biz\sj\classes\MerchantAssetClass;
@@ -116,6 +117,8 @@ class GhsClass extends BaseClass
 
         //有新客户提醒供货商
         WxMessageClass::newGhsCustomInform($ghsShop, $custom, $introduce);
+        //新客户加入app通知
+        NoticeClass::newCustomNotice($ghsShop, $custom);
 
         if ($type == 1) {
             return $ghs;

+ 22 - 1
biz/notice/classes/NoticeClass.php

@@ -48,7 +48,28 @@ class NoticeClass extends BaseClass
                 continue;
             }
             $adminId = $admin['id'] ?? 0;
-            pushNotice::push($adminId, $clientId, '提现到账通知', $amount.'元已到账,请查收');
+            pushNotice::push($adminId, $clientId, '提现到账通知', $amount . '元已到账,请查收');
+        }
+    }
+
+    //新客户通知 shish 20210115
+    public static function newCustomNotice($shop, $custom)
+    {
+        $shopId = $shop->id;
+        $ptStyle = $shop->ptStyle;
+        $name = $custom->name ?? '';
+        Yii::$app->params['ptStyle'] = $ptStyle;
+        $adminList = ShopAdminClass::getRemainAdmin($shopId);
+        if (empty($adminList)) {
+            return false;
+        }
+        foreach ($adminList as $admin) {
+            $clientId = $admin['clientId'] ?? '';
+            if (empty($clientId)) {
+                continue;
+            }
+            $adminId = $admin['id'] ?? 0;
+            pushNotice::push($adminId, $clientId, '新客户加入', $name);
         }
     }