diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index 1dc77c810..7dc8fa918 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -172,12 +172,14 @@ class AggregateRelationController extends AdminController } // $this->checkListOrCountAuthRestMap($where);//导出权限 - $dbres = $this->DBlogModel->where("first_company_type = 3 or second_company_type = 3")->where($where)->order("FIELD(status,0,1,-1,-2,2),id desc"); + $dbress = $this->DBlogModel->where("first_company_type = 3 or second_company_type = 3")->order("FIELD(status,0,1,-1,-2,2),id desc")->select(false); + if(isset($params['export'])){ - $dbres = $dbres->select(); + $dbres = M()->table("({$dbress})a")->where($where)->select(); }else{ - $dbres = $dbres->page($page, $row)->select(); + $dbres = M()->table("({$dbress})a")->page($page, $row)->where($where)->select(); } + foreach($dbres as $k=>&$v){ $v['settlement_type'] =$this->SettlementType[$v['settlement_type']]; $v['first_company_type'] =$this->CompanyType[$v['first_company_type']]; @@ -239,7 +241,7 @@ class AggregateRelationController extends AdminController )); } - $count = $this->DBlogModel->field("count(id) count")->where($where)->where("first_company_type = 3 or second_company_type = 3")->find()['count']; + $count = M()->table("({$dbress})a")->field("count(id) count")->where($where)->find()['count']; $this->assign('data', $dbres); $page = set_pagination($count, $row,$params); if($page) {