shish 2 jaren geleden
bovenliggende
commit
ed257247bf
1 gewijzigde bestanden met toevoegingen van 0 en 16 verwijderingen
  1. 0 16
      app-ghs/controllers/StatBookController.php

+ 0 - 16
app-ghs/controllers/StatBookController.php

@@ -69,22 +69,6 @@ class StatBookController extends BaseController
         }
         $where['bookSn'] = $bookSn;
         $list = BookItemClass::getAllByCondition($where, 'addTime DESC', '*');
-        if (!empty($list)) {
-            $ids = array_column($list, 'itemId');
-            $itemList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, 'id,stock', 'id', true);
-            foreach ($list as $key => $val) {
-                $productId = $val['itemId'] ?? 0;
-                $product = $itemList[$productId] ?? null;
-                if (empty($product)) {
-                    util::fail('没有花材信息,ID:' . $productId);
-                }
-                $stock = $product->stock;
-                $list[$key]['stock'] = floatval($stock);
-                $time = $val['time'];
-                $shortTime = substr($time, 4, 4);
-                $list[$key]['shortTime'] = $shortTime;
-            }
-        }
         util::success(['list' => $list]);
     }