getListByIds(helper::getArrayColumn($dataSource, $goodsIndex)); $goodsList = helper::arrayColumn2Key($goodsData, 'goods_id'); // 整理列表数据 foreach ($dataSource as &$item) { $item['goods'] = isset($goodsList[$item[$goodsIndex]]) ? $goodsList[$item[$goodsIndex]] : null; } return $data; } /** * 商品多规格信息 * @param GoodsModel|null $model * @return null|array */ public static function getSpecData($model = null) { // 商品sku数据 if (!is_null($model) && $model['spec_type'] == 20) { return $model->getManySpecData($model['spec_rel'], $model['sku']); } return null; } }