Commit d7e80ccc authored by luhongguang's avatar luhongguang

Merge branch 'feature_take_place_20210916' into develop

parents 72674320 8aef4bf0
......@@ -25,7 +25,7 @@ class TakePlaceService
$lifeAccountId = MarketingService::getPublicLifeAccountId();
$keywords = $params['keywords'] ?? '';
$takePlaceIds = $params['take_place_id'] ?? [];
$tagIds = $params['tag_ids'] ?? [];
$tagIds = isset($params['tag_ids']) ? $params['tag_ids'] : [];
$businessCircleIds = $params['business_circle_ids'] ?? [];
$offset = $params['offset'] ?? 0;
$limit = $params['limit'] ?? 20;
......@@ -36,7 +36,7 @@ class TakePlaceService
if ($lifeAccountId) {
$where['life_account_id'] = $lifeAccountId;
}
if ($tagIds) {
if ($tagIds || $tagIds == 0) {
$where['tag_id'] = $tagIds;
}
if ($businessCircleIds) {
......@@ -273,7 +273,19 @@ class TakePlaceService
}
//本页按距离返回列表
$res['list'] = self::sortByDistance($latitude, $longitude, TakePlace::select('*', $takePlaceWhere));
$list = self::sortByDistance($latitude, $longitude, TakePlace::select('*', $takePlaceWhere));
$tagIds = array_unique(array_column($list, "tag_id"));
$businessCircleIds = array_unique(array_column($list, "business_circle_id"));
list ($tagArr, $businessCircleArr) = self::getTagAndBusinessCircle($tagIds, $businessCircleIds);
$data = [];
foreach ($list as $key => $item) {
$data[$key] = $item;
$data[$key]["tag_name"] = empty($tagArr[$item["tag_id"]]) ? "" : $tagArr[$item["tag_id"]]["tag_name"];
$data[$key]["business_circle_name"] = empty($businessCircleArr[$item["business_circle_id"]]) ? "" : $businessCircleArr[$item["business_circle_id"]]["business_circle_name"];
}
$res['list'] = $data;
unset($where['ORDER'], $where['LIMIT']);
$res['total'] = MarketingTakePlace::count('*', $where);
......
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