Commit 9e6ad70c authored by hujun's avatar hujun

总监列表小组门店

parent 6cd20ffd
...@@ -179,6 +179,9 @@ class Broker extends Basic ...@@ -179,6 +179,9 @@ class Broker extends Basic
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getDistrictList () { public function getDistrictList () {
$data['status'] = 200;
$data['data'] = '';
$data['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$agents = new AAgents(); $agents = new AAgents();
...@@ -194,9 +197,9 @@ class Broker extends Basic ...@@ -194,9 +197,9 @@ class Broker extends Basic
$where['phone'] = ['LIKE',$this->params['phone'].'%']; $where['phone'] = ['LIKE',$this->params['phone'].'%'];
} }
$this->data['list'] = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where); $data['list'] = $agents->getListDistrict($pageNo, $pageSize, 'id DESC', $field, $where);
$this->data['total'] = $agents->getListDistrictTotal($where); $data['total'] = $agents->getListDistrictTotal($where);
return $this->response($this->code, $this->msg, $this->data); return $this->response($data['status'], $data['msg'], $data);
} }
/** /**
......
...@@ -139,6 +139,7 @@ public function saveList(){ ...@@ -139,6 +139,7 @@ public function saveList(){
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
$district_where['status'] = 0; $district_where['status'] = 0;
$store_where['status'] = 0; $store_where['status'] = 0;
foreach ($data as $k=>$v){ foreach ($data as $k=>$v){
...@@ -148,7 +149,12 @@ public function saveList(){ ...@@ -148,7 +149,12 @@ public function saveList(){
$result[$k]['district_name'] = Db::table('a_district')->where($district_where)->value('district_name'); $result[$k]['district_name'] = Db::table('a_district')->where($district_where)->value('district_name');
if ($result[$k]['district_name']) { if ($result[$k]['district_name']) {
$store_where['district_id'] = $v->district_id; $store_where['district_id'] = $v->district_id;
$result[$k]['store_name'] = Db::table('a_store')->where($store_where)->column('store_name'); $store = Db::table('a_store')->where($store_where)->column('store_name');
$store_str = '';
foreach ($store as $kk=>$vv) {
$store_str .= $vv.',';
}
$result[$k]['store_name'] = rtrim($store_str, ',');
} else { } else {
$result[$k]['store_name'] = ''; $result[$k]['store_name'] = '';
} }
......
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