shish 1 سال پیش
والد
کامیت
ac89ca4661
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 3 1
      biz-ghs/book/classes/BookItemClass.php
  2. 3 5
      biz-ghs/notify/classes/NotifyClass.php

+ 3 - 1
biz-ghs/book/classes/BookItemClass.php

@@ -192,7 +192,9 @@ class BookItemClass extends BaseClass
             $bookCustomRes = BookCustomClass::delOnNum($bookCustomRes, $thirdNeedSubNum, $num, $order, $shop, $product, $params);
 
             //预订减少造成下架而产生通知
-            NotifyClass::bookReduceOutItem($bookItemCustomRes, $thirdNeedSubNum, $shop);
+            if($thirdNeedSubNum>0){
+                NotifyClass::bookReduceOutItem($bookItemCustomRes, $thirdNeedSubNum, $shop);
+            }
 
             if ($thirdRemainSubNum <= 0) {
                 util::unlock($cacheKey);

+ 3 - 5
biz-ghs/notify/classes/NotifyClass.php

@@ -49,11 +49,9 @@ class NotifyClass extends BaseClass
                 $staff->save();
             }
         }
-        if ($num > 0) {
-            $noticeText = json_encode(['id' => $id, 'num' => $num, 'shopId' => $shopId]);
-            $noticeKey = "bookChangeOffItem";
-            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
-        }
+        $noticeText = json_encode(['id' => $id, 'num' => $num, 'shopId' => $shopId]);
+        $noticeKey = "bookChangeOffItem";
+        Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
     }
 
     //新增售后申请通过 ssh 20230814