|
|
|
@ -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']];
|
|
|
|
|