Commit d7745fa8 authored by hujun's avatar hujun

部门列表修改

parent 0a549ae7
......@@ -31,7 +31,7 @@ class District extends Basic
$agents = new AAgents();
$field = 'id,name,create_time,phone,district_id';
$where = '';
$where .= 'level=40 AND status=0';
$where .= 'level in (30,40) AND status=0';
if ($search != NULL) {
$where .= " AND (phone like '{$search}%' or name like '{$search}%')";
......
......@@ -185,14 +185,9 @@ public function saveList(){
$result[$k]['district_name'] = Db::table('a_district')->where($district_where)->value('district_name');
if ($result[$k]['district_name']) {
$store_where['district_id'] = $v->district_id;
$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, ',');
$result[$k]['store_num'] = Db::table('a_store')->where($store_where)->count('store_name');
} else {
$result[$k]['store_name'] = '';
$result[$k]['store_num'] = '';
}
}
}
......
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