$where = "(first_company_type > 0 AND first_company_id NOT IN ({$has_company_id}) ) OR ( second_company_type > 0 AND second_company_id NOT IN ({$has_company_id}) )";
@ -97,7 +97,7 @@ class CompanyStatementSetController extends Controller {
* 上游结算
* @param [string] $type 0:周结 1:月结 2:周结补点
*/
public function cpStatement($type,$stime,$company_id=false)
public function cpStatement($type,$stime,$company_id=false,$recount=true)
{
$t = $this->setBeginAndEndTime($type,$stime);;
$begintime = $t[0];
@ -109,7 +109,7 @@ class CompanyStatementSetController extends Controller {
];
}else{
$where = [
"_string"=>"(first_company_type = '1' AND first_company_id = '{$company_id}') OR (second_company_type = '1' AND second_company_id = '{$company_id}')"
"_string"=>"(first_company_type = '1' AND first_company_id in ({$company_id}) ) OR (second_company_type = '1' AND second_company_id in ({$company_id}) )"
];
}
//获取哪些要结算
@ -339,12 +339,11 @@ class CompanyStatementSetController extends Controller {
return;
}
//添加
if($company_id === false){
if($recount && $company_id !== false){
//非重算
$StatementDb->add($add_data);
}else{
return $add_data;
}
$StatementDb->add($add_data);
}
}
@ -402,9 +401,8 @@ class CompanyStatementSetController extends Controller {
/**
* 下游结算
*/
public function promoteCompanyStatement($type,$stime,$company_id=false)
public function promoteCompanyStatement($type,$stime,$company_id=false,$recount=true)
{
$t = $this->setBeginAndEndTime($type,$stime);
$begintime = $t[0];
$endtime = $t[1];
@ -416,7 +414,7 @@ class CompanyStatementSetController extends Controller {
];
}else{
$where = [
"_string"=>"(first_company_type = '2' AND first_company_id = '{$company_id}') OR (second_company_type = '2' AND second_company_id = '{$company_id}')"
"_string"=>"(first_company_type = '2' AND first_company_id in ({$company_id}) ) OR (second_company_type = '2' AND second_company_id in ({$company_id}) )"
];
}
//获取哪些要结算
@ -549,7 +547,6 @@ class CompanyStatementSetController extends Controller {