request->get(); $shopId = $get['shopId']??0; $sjId = $get['sjId']??0; $py = $get['py']??''; //获取所有当前供应商的分类 (全部、常用) //根据分类组装分类下的花材信息 $classIds = ItemClassClass::getGhsItemClassAll($sjId); //获取供应商下所有花材ID (itemIds) $itemIdsInfo = ItemService::getGhsItemIds($sjId); $itemIds = array_column($itemIdsInfo,'itemId'); if($py){ $pyNameItemIds = ItemClass::getItemIdsByPyName($py); $itemIds = array_intersect($itemIds,$pyNameItemIds); } $itemInfoData = ProductClass::getProductInfoByItemIds($itemIds,$shopId); //常用的itemIds $oftenItemIds = ProductClass::getOftenItemIds($shopId); //组装数据: [{classId:'','className:'',child:[{itemInfoData}]}] $data = ProductService::assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds); AdminClass::addRecentShop($shopId,$this->admin); util::success($data); } }