...
|
...
|
@@ -53,15 +53,38 @@ class HouseActivity extends Backend |
|
|
return $this->selectpage();
|
|
|
}
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
|
|
|
// 城市或区县代理
|
|
|
$group_id_arr = array_column($this->auth->getGroups(), 'group_id');
|
|
|
$where1 = [];
|
|
|
if(!in_array(1,$group_id_arr) && array_intersect([6,7],$group_id_arr)){
|
|
|
$area_arr = \app\admin\model\AdminArea::where('admin_id',$this->auth->id)->column('area');
|
|
|
foreach ($area_arr as $v) {
|
|
|
$where1[] = "area like '%{$v}%'";
|
|
|
}
|
|
|
if($where1){
|
|
|
$where2 = [];
|
|
|
$house_id_arr = \app\admin\model\House::where(implode(' or ',$where1))->column('id');
|
|
|
foreach ($house_id_arr as $v) {
|
|
|
$where2[] = "find_in_set($v,house_ids)";
|
|
|
}
|
|
|
$where1 = $where2 ? implode(' or ', $where2) : 'id = 0';
|
|
|
}else{
|
|
|
$where1 = 'id = 0';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$total = $this->model
|
|
|
|
|
|
->where($where)
|
|
|
->where($where1)
|
|
|
->order($sort, $order)
|
|
|
->count();
|
|
|
|
|
|
$list = $this->model
|
|
|
|
|
|
->where($where)
|
|
|
->where($where1)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
|
|
->select();
|
...
|
...
|
|