shish 1 жил өмнө
parent
commit
c6edbcc185

+ 22 - 20
app-mall/controllers/NoticeController.php

@@ -154,29 +154,31 @@ class NoticeController extends PublicController
             echo "SUCCESS";
 
             //解决重复通知
-            $cacheKey = 'mall_order_pay_' . $orderSn;
-            $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
-            if (empty($has)) {
-                Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
+            if ($capitalType == dict::getDict('capitalType', 'xhOrder', 'id')) {
+                $cacheKey = 'mall_order_pay_' . $orderSn;
+                $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
+                if (empty($has)) {
+                    Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 864000, 'has']);
+
+                    //打印小票和语音播报
+                    $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
+                    ShopExtClass::hdGatheringReport($order);
+                    OrderClass::onlinePrint($order);
 
-                //打印小票和语音播报
-                $order = OrderClass::getByCondition(['orderSn' => $orderSn], true);
-                ShopExtClass::hdGatheringReport($order);
-                OrderClass::onlinePrint($order);
+                    $shopId = $order->shopId ?? 0;
+                    $shop = ShopClass::getById($shopId, true);
+                    if (in_array($order->fromType, [dict::getDict("fromType", "shop"), dict::getDict("fromType", "friend")])) {
+                        //您有新的收入提醒
+                        WxMessageClass::gatheringIncomeInform($shop, $order);
+                    }
+                    if ($order->fromType == dict::getDict("fromType", "mall")) {
+                        //来自商城的新订单微信通知
+                        WxMessageClass::hdNewOrderInform($shop, $order);
+                    }
 
-                $shopId = $order->shopId ?? 0;
-                $shop = ShopClass::getById($shopId, true);
-                if (in_array($order->fromType, [dict::getDict("fromType", "shop"), dict::getDict("fromType", "friend")])) {
-                    //您有新的收入提醒
-                    WxMessageClass::gatheringIncomeInform($shop, $order);
-                }
-                if ($order->fromType == dict::getDict("fromType", "mall")) {
-                    //来自商城的新订单微信通知
-                    WxMessageClass::hdNewOrderInform($shop, $order);
+                    $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+                    ShopExtClass::newWorkRemind($shopExt, $order);
                 }
-
-                $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
-                ShopExtClass::newWorkRemind($shopExt, $order);
             }
         } catch (\Exception $e) {
             $transaction->rollBack();

+ 9 - 3
biz-hd/recharge/classes/RechargeClass.php

@@ -74,20 +74,26 @@ class RechargeClass extends BaseClass
 
         $custom = CustomClass::getLockById($customId);
         if (empty($custom)) {
-            util::fail('充值回调失败,没有找到客户');
+            $msg = '充值回调失败,没有找到客户';
+            Yii::info($msg);
+            util::fail($msg);
         }
         $custom->balance = bcadd($custom->balance, $amount, 2);
         $custom->save();
 
         $hd = HdClass::getLockById($hdId);
         if (empty($hd)) {
-            util::fail('充值回调失败,没有找到花店');
+            $msg = '充值回调失败,没有找到花店';
+            Yii::info($msg);
+            util::fail($msg);
         }
         $hd->balance = bcadd($custom->balance, $amount, 2);
         $hd->save();
 
         if ($hd->balance != $custom->balance) {
-            util::fail('充值回调失败,金额不一致');
+            $msg = '充值回调失败,金额不一致';
+            Yii::info($msg);
+            util::fail($msg);
         }
 
         $change = [