Explorar el Código

Merge branch 'master' of git.huaml.com:zhh/huahuibao

shizhongqi hace 4 años
padre
commit
a9315fb193

+ 1 - 1
app-pt/controllers/CashController.php

@@ -112,7 +112,7 @@ class CashController extends BaseController
 
             NoticeClass::cashPassNotice($shop, $cash);
 
-            //微信通知申请提现人
+            //微信通知申请提现人和超管
             WxMessageClass::cashInform($shop, $cash);
 
             //通知管理员

+ 6 - 4
biz-hd/purchase/classes/PurchaseClearClass.php

@@ -87,7 +87,7 @@ class PurchaseClearClass extends BaseClass
     }
 
     //第三方支付回调 ssh 2021.4.28
-    public static function thirdPay($payWay, $orderSn, $totalFee, $attach)
+    public static function thirdPay($payWay, $orderSn, $totalFee, $attach, $transactionId)
     {
         $info = self::getByCondition(['orderSn' => $orderSn], true);
         if (empty($info)) {
@@ -105,6 +105,10 @@ class PurchaseClearClass extends BaseClass
         $id = $info->id;
         $info = self::getLockById($id);
 
+        $info->onlinePay = dict::getDict('onlinePay', 'yes');
+        $info->thirdNo = $transactionId;
+        $info->save();
+
         self::complete($info, $payWay);
     }
 
@@ -185,9 +189,7 @@ class PurchaseClearClass extends BaseClass
         //客户付供应商款减少
         CustomClass::clearDebtAmountReduce($custom, $ghs, $order->actPrice, $order);
 
-        if (isset($order->customShopAdminId) && !empty($order->customShopAdminId)) {
-            WxMessageClass::clearInform($shop, $order, $custom);
-        }
+        WxMessageClass::clearInform($shop, $order, $custom);
 
     }
 

+ 4 - 1
biz/ghs/classes/GhsClass.php

@@ -177,7 +177,10 @@ class GhsClass extends BaseClass
             $list[$key]['tjFlAmount'] = $tjFlAmount;
             $list[$key]['miniKilo'] = $shopInfo[$currentShopId]['miniKilo'] ?? 0;
             $list[$key]['kiloFee'] = $shopInfo[$currentShopId]['kiloFee'] ?? 0;
-            $isOpen = ShopClass::isOpen($shopInfo[$currentShopId]);
+            $isOpen = 0;
+            if (isset($shopInfo[$currentShopId])) {
+                $isOpen = ShopClass::isOpen($shopInfo[$currentShopId]);
+            }
             //营业状态
             $list[$key]['isOpen'] = $isOpen;
             $list[$key]['openStartTime'] = $shopInfo[$currentShopId]['openStartTime'] ?? '';

+ 31 - 27
biz/wx/classes/WxMessageClass.php

@@ -2,7 +2,6 @@
 
 namespace biz\wx\classes;
 
-use biz\admin\classes\AdminClass;
 use biz\base\classes\BaseClass;
 use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
@@ -441,35 +440,40 @@ class WxMessageClass extends BaseClass
             return false;
         }
         $amount = $cash->amount;
-
-        $shopAdminId = $cash->shopAdminId ?? 0;
-        $staff = ShopAdminClass::getById($shopAdminId, true);
-        if (empty($staff)) {
-            return false;
-        }
-        $adminId = $staff->adminId ?? 0;
-        $admin = AdminClass::getById($adminId, true);
-        if (empty($admin)) {
+        $adminList = ShopAdminClass::getRemainAdmin($shop);
+        if (empty($adminList)) {
             return false;
         }
-        $openId = isset($admin['openId']) ? $admin['openId'] : '';
-        if (empty($openId)) {
-            return false;
+        $mainId = $shop->mainId ?? 0;
+        $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', 'adminId');
+
+        foreach ($adminList as $admin) {
+            $openId = isset($admin['openId']) ? $admin['openId'] : '';
+            if (empty($openId)) {
+                continue;
+            }
+            $adminId = $admin['id'] ?? 0;
+            $super = $staffList[$adminId]['super'] ?? 0;
+            //提现管理员才通知
+            if ($super == 0) {
+                continue;
+            }
+            $data = [
+                "touser" => $openId,
+                "template_id" => $tempId,
+                "url" => Yii::$app->params['ghsDomain'],
+                "data" => [
+                    "first" => ["value" => "您的提现已经到帐。", "color" => "#173177"],
+                    "keyword1" => ["value" => $amount, "color" => "#173177"],
+                    "keyword2" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
+                    "remark" => ["value" => "感谢您的使用", "color" => "#173177"]
+                ]
+            ];
+            $data['miniprogram']['appid'] = $wx['miniAppId'];
+            $data['miniprogram']['pagepath'] = 'pagesStore/me/withdraw';
+
+            wxUtil::sendTaskInform($data, $wx, $ptStyle);
         }
-        $data = [
-            "touser" => $openId,
-            "template_id" => $tempId,
-            "url" => Yii::$app->params['ghsDomain'],
-            "data" => [
-                "first" => ["value" => "您的提现已经到帐。", "color" => "#173177"],
-                "keyword1" => ["value" => $amount, "color" => "#173177"],
-                "keyword2" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
-                "remark" => ["value" => "感谢您的使用", "color" => "#173177"]
-            ]
-        ];
-        $data['miniprogram']['appid'] = $wx['miniAppId'];
-        $data['miniprogram']['pagepath'] = 'pagesStore/me/withdraw';
-        wxUtil::sendTaskInform($data, $wx, $ptStyle);
     }
 
     //订单送达通知 ssh 20210607

+ 1 - 1
common/components/dict.php

@@ -57,7 +57,7 @@ class dict
         'showMaxStock' => 260,
 
         //余额满miniCashAmount才能提现
-        'miniCashAmount' => 100,
+        'miniCashAmount' => 1,
 
         //本条流水的余额是否可以提现
         'yeTx' => [

+ 1 - 1
common/components/payUtil.php

@@ -44,7 +44,7 @@ class payUtil
                 break;
             case dict::getDict('capitalType', 'hdPurchaseClear', 'id'):
                 //零售结帐
-                PurchaseClearClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
+                PurchaseClearClass::thirdPay($payWay, $orderSn, $totalFee, $attach,$transactionId);
                 break;
             case dict::getDict('capitalType', 'xhOrder', 'id'):
                 //花粉下单