request->get(); $id = $get['id'] ?? 0; $product = ProductClass::getById($id, true); if (isset($product->mainId) == false || $product->mainId != $this->mainId) { util::fail('没有权限'); } $where = ['productId' => $id]; $searchTime = $get['searchTime'] ?? ''; if (!empty($searchTime)) { $startTime = $get['startTime'] ?? ''; $endTime = $get['endTime'] ?? ''; $period = dateUtil::formatTime($searchTime, $startTime, $endTime); $where['addTime'] = ['between', [$period['startTime'], $period['endTime']]]; } $list = OnStockRecordClass::getRecordList($where); util::success($list); } }