shish 2 лет назад
Родитель
Сommit
07f7a1c503
1 измененных файлов с 10 добавлено и 4 удалено
  1. 10 4
      app-ghs/controllers/RefundController.php

+ 10 - 4
app-ghs/controllers/RefundController.php

@@ -189,10 +189,16 @@ class RefundController extends BaseController
         }
         $string = $get['ids'];
         $ids = json_decode($string, true);
-        $itemList = ProductClass::getAllByCondition(['mainId' => $this->mainId, 'classId' => ['in', $ids]], null, 'id', 'id');
-        if (!empty($itemList)) {
-            $productIds = array_keys($itemList);
-            $productIds = array_unique($productIds);
+        if (!empty($ids)) {
+            $productIds = [];
+            $itemList = ProductClass::getAllByCondition(['mainId' => $this->mainId, 'classId' => ['in', $ids]], null, 'id', 'id');
+            if (!empty($itemList)) {
+                $productIds = array_keys($itemList);
+                $productIds = array_unique($productIds);
+            }
+            if (empty($productIds)) {
+                util::success(['list' => [], 'moreData' => 0, 'totalAmount' => 0, 'totalNum' => 0, 'totalPage' => 1]);
+            }
             $where['productId'] = ['in', $productIds];
         }