diff --git a/Application/Admin/Controller/AggregateRelationController.class.php b/Application/Admin/Controller/AggregateRelationController.class.php index d764db912..d193ae28d 100644 --- a/Application/Admin/Controller/AggregateRelationController.class.php +++ b/Application/Admin/Controller/AggregateRelationController.class.php @@ -73,10 +73,10 @@ class AggregateRelationController extends AdminController $where['_string'] = '1 = 1'; if(isset($params['company_type'])){ - $where['_string'] .= " AND (first_company_type='{$params['company_type']}' OR second_company_type='{$params['company_type']}')"; + $where['_string'] .= " AND (second_company_type='{$params['company_type']}')"; } if(isset($params['company_name'])){ - $where['_string'] .= " AND (first_company_name LIKE '%{$params['company_name']}%' OR second_company_name LIKE '%{$params['company_name']}%')"; + $where['_string'] .= " AND (second_company_name LIKE '%{$params['company_name']}%')"; } if(isset($params['settlement_type'])){ @@ -89,11 +89,15 @@ class AggregateRelationController extends AdminController $where['is_payment'] = $params['is_payment']; } - $dbres = $this->DBModel->where($where)->where("first_company_type = 3 or second_company_type = 3")->order("id desc");; + $dbres = $this->DBModel->where("first_company_type = 3 or second_company_type = 3")->order("id desc")->select(false); if(isset($params['export'])){ - $dbres = $dbres->select(); + + $dbres = M()->table("({$dbres})a")->where($where)->select(); + +// $dbres = $dbres->select(); }else{ - $dbres = $dbres->page($page, $row)->select(); + $dbres = M()->table("({$dbres})a")->page($page, $row)->where($where)->select(); +// $dbres = $dbres->page($page, $row); } foreach($dbres as $k=>&$v){ $v['settlement_type'] =$this->SettlementType[$v['settlement_type']]; diff --git a/Application/Admin/Controller/AggregateStatementPoolController.class.php b/Application/Admin/Controller/AggregateStatementPoolController.class.php index b0cddf627..c8a7b9942 100644 --- a/Application/Admin/Controller/AggregateStatementPoolController.class.php +++ b/Application/Admin/Controller/AggregateStatementPoolController.class.php @@ -118,10 +118,7 @@ class AggregateStatementPoolController extends ThinkController $v['company_type_str'] = $this->CompanyType[$v['company_type']]; $v['is_payment_str'] = $this->IsPayment[$v['is_payment']]; - $v['can_export'] = $v['statement_money'] == 0 ? "0" : '1'; - if($v['company_type'] == 2){ - $v['can_export'] = 1; - } + $v['can_export'] = $v['statement_money'] == 0 ? "0" : '1'; $v['op_time'] = date('Y-m-d H:i:s',$v['op_time']); $v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; @@ -263,8 +260,8 @@ class AggregateStatementPoolController extends ThinkController $v['statement_count'] = count($v['statement_info']); } if($is_export){ - $count["platform_amount"] = "=SUM(J2:J".$line.")"; - $count["sum_money"] = "=SUM(O2:O".$line.")"; + $count["platform_amount"] = "=SUM(G2:G".$line.")"; + $count["sum_money"] = "=SUM(L2:L".$line.")"; } $this->assign("data",$infolist);