Commit ba979cdb authored by clone's avatar clone

bug

parent e5c440d8
...@@ -213,9 +213,11 @@ class Shop extends Basic ...@@ -213,9 +213,11 @@ class Shop extends Basic
*/ */
public function filtrateCondition() public function filtrateCondition()
{ {
$params = $this->params;
$city_code = isset($params["city"]) ? $params["city"] : "31000"; //上海31000 浙江 33000
$regions = new Regions(); $regions = new Regions();
$cityList = $regions->getRegionsCitySH(); $cityList = $regions->getRegionsCitySH($city_code);
$i = 0; $i = 0;
$result["area"][$i]["city"] = "全部"; $result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部"; $result["area"][$i]["disc"][] = "全部";
......
...@@ -91,9 +91,9 @@ class Regions extends Model ...@@ -91,9 +91,9 @@ class Regions extends Model
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getRegionsCitySH() { public function getRegionsCitySH($code) {
$data = []; $data = [];
$city_data = $this->field('code,fullName')->where('parentCode in ( 310000)')->select(); $city_data = $this->field('code,fullName')->where('parentCode in ( '.$code.')')->select();
foreach ($city_data as $k=>$v) { foreach ($city_data as $k=>$v) {
$data[$k]['name'] = $v['fullName']; $data[$k]['name'] = $v['fullName'];
$data[$k]['city'] = $this->where('parentCode',$v['code'])->column('fullName'); $data[$k]['city'] = $this->where('parentCode',$v['code'])->column('fullName');
......
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