Commit 9040d1a5 authored by 王源's avatar 王源 🎧

优化产品rpc接口文件

parent eec8b9b4
...@@ -15,17 +15,13 @@ interface ProductServiceInterface ...@@ -15,17 +15,13 @@ interface ProductServiceInterface
* 获取单个数据 * 获取单个数据
* @param int $id 产品id * @param int $id 产品id
* @param array $relations 产品的关联关系,支持:["brand","category","ingredient","product_name","status","type","images","price_info","product_children"] * @param array $relations 产品的关联关系,支持:["brand","category","ingredient","product_name","status","type","images","price_info","product_children"]
* @param array $columns 产品表的字段,默认['id', 'sku', 'name', 'en_name', 'brand_id' * @param array $columns 产品表的字段,默认全部字段
* , 'team_id', 'hs_code', 'origin_country_id', 'production_address', 'unit', 'category_id' * ['id', 'sku', 'name', 'en_name', 'brand_id', 'team_id', 'hs_code', 'origin_country_id', 'production_address',
* , 'ingredient_id', 'product_name_id', 'type_id', 'status_id', 'style', 'info_completed' * 'unit', 'category_id', 'ingredient_id', 'product_name_id', 'type_id', 'status_id', 'style', 'info_completed'
* , 'bar_code', 'bar_code_image', 'creator_id', 'hot'] * , 'bar_code', 'bar_code_image', 'creator_id', 'hot']
* @return array * @return array|null
*/ */
public function get($id, array $relations = [] public function get($id, array $relations = [], $columns = ['*']);
, $columns = ['id', 'sku', 'name', 'en_name', 'brand_id', 'team_id'
, 'hs_code', 'origin_country_id', 'production_address', 'unit', 'category_id'
, 'ingredient_id', 'product_name_id', 'type_id', 'status_id', 'style'
, 'info_completed', 'bar_code', 'bar_code_image', 'creator_id', 'hot']): array;
/** /**
* 通过id列表获取产品数组 * 通过id列表获取产品数组
...@@ -37,11 +33,7 @@ interface ProductServiceInterface ...@@ -37,11 +33,7 @@ interface ProductServiceInterface
* , 'bar_code', 'bar_code_image', 'creator_id', 'hot'] * , 'bar_code', 'bar_code_image', 'creator_id', 'hot']
* @return array * @return array
*/ */
public function getByIdList(array $idList, array $relations = [] public function getByIdList(array $idList, array $relations = [], array $columns = ['*']): array;
, array $columns = ['id', 'sku', 'name', 'en_name', 'brand_id', 'team_id'
, 'hs_code', 'origin_country_id', 'production_address', 'unit', 'category_id'
, 'ingredient_id', 'product_name_id', 'type_id', 'status_id', 'style'
, 'info_completed', 'bar_code', 'bar_code_image', 'creator_id', 'hot']): array;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment