request->get(); $shopId = $get['shopId']??0; $sjId = $get['sjId']??0; //获取所有当前供应商的分类 (全部、常用) //根据分类组装分类下的花材信息 $classIds = ItemClassClass::getGhsItemClassAll($sjId); $where['sjId'] = $sjId; $where['shopId'] = $shopId; $where['delStatus'] = 0; $itemInfoData = ProductClass::getAllByCondition($where,['actualSold'=>SORT_DESC,'inTurn'=>SORT_DESC],"*"); $itemInfoData = ProductClass::groupProductInfo($itemInfoData); //常用的itemIds $oftenItemIds = ProductClass::getOftenItemIds($shopId); //获取供应商下所有花材ID (itemIds) $itemIdsInfo = ItemService::getGhsItemIds($this->sjId); //dd($itemInfoData); //组装数据: [{classId:'','className:'',child:[{itemInfoData}]}] $data = ProductService::assembleData($classIds, $itemIdsInfo,$itemInfoData, $oftenItemIds, '',true); ShopService::totalViewPlus($shopId); util::success($data); } }