Commit aad130d3 authored by suntengda's avatar suntengda

add 批量获取自提点信息接口

parent e78036e3
......@@ -19,6 +19,20 @@ class TakeplaceController extends Base
$res = TakePlaceService::detail($this->params['take_place_id']);
$this->success(['result'=>$res]);
}
/**
* 批量获取自提点信息
* @throws Exception
*/
public function get_detail_by_idsAction()
{
if (empty($this->params['take_place_ids'])) {
$this->success(['result'=>[]]);
}
$res = TakePlaceService::getDetailByIds($this->params['take_place_ids']);
$this->success(['result'=>$res]);
}
/**
* 获取自提点列表
......
......@@ -34,6 +34,17 @@ class TakePlaceService
return TakePlace::get('*',['take_place_id'=>$takePlaceId]);
}
/**
* 批量获取自提点信息
* @param $takePlaceIds
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public static function getDetailByIds($takePlaceIds)
{
$result = TakePlace::select('*',['take_place_id'=>$takePlaceIds]);
return $result ? array_column($result,null,'take_place_id') : [];
}
/**
* 添加自提点
* @param $params
......
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