request->get(); $id = $get['id'] ?? 0; $cg = PurchaseClass::getById($id, true); if (empty($cg)) { util::fail('没有找到采购信息'); } if ($cg->mainId != $this->mainId) { util::fail('没有权限操作'); } $orderSn = $cg->orderSn ?? ''; $list = PurchaseItemClass::getAllByCondition(['orderSn' => $orderSn], null, '*'); if (!empty($list)) { foreach ($list as $key => $item) { $shortCover = $item['cover'] ?? ''; $cover = imgUtil::groupImg($shortCover); $list[$key]['cover'] = $cover; $list[$key]['shortCover'] = $shortCover; } } $shop = $this->shop; $onlyCg = $shop->onlyCg ?? 1; util::success(['list' => $list, 'onlyCg' => $onlyCg]); } }