Commit c0af7e7c authored by hujun's avatar hujun

区和商区

parent 73426aaf
......@@ -322,6 +322,13 @@ class Shop extends Basic
$result["area"][$i]["disc"][] = $item;
}
}
foreach ($v['business_district'] as $item2) {
if (!empty($item2)) {
$result["area"][$i]["business_district"][] = $item2;
}
}
break; //目前只有上海和杭州其余的先不显示
}
......
......@@ -94,9 +94,16 @@ class Regions extends Model
public function getRegionsCitySH($code) {
$data = [];
$city_data = $this->field('code,fullName')->where('parentCode in ( '.$code.')')->select();
$business = new GBusinessDistrict();
foreach ($city_data as $k=>$v) {
$data[$k]['name'] = $v['fullName'];
$data[$k]['city'] = $this->where('parentCode',$v['code'])->column('fullName');
//区和商圈
foreach ($data[$k]['city'] as $k2=>$v2) {
$data[$k]['business_district'][$k2]['district'] = $v2;
$data[$k]['business_district'][$k2]['business'] = $business->field('id,name')->where('city',$v['fullName'])->where('disc', $v2)->select();
}
}
return $data;
}
......
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