优化下游公司结算时间审核

master
chenzhi 5 years ago
parent a14f0abb88
commit 92ccc96dcd

@ -517,9 +517,14 @@ class CompanyStatementSetController extends Controller {
//无需处理
return ;
}
$pc_map = [
"id"=>["IN",$pc_id],
"_string"=>"(validity_start_time > 0 AND validity_end_time = 0 ) OR validity_end_time >= {$endtime}",
"company_type"=>1
];
//获取pc公司
$tmpp = M("PromoteCompany","tab_")->field("id,uid,company_name partner,settlement_contact link_man,contact_phone link_phone,bank_name opening_bank,bank_address payee_name,bank_card bank_account,fax_ratio,taxation_rate,company_belong,company_type,ali_user,ali_account,has_server_fee,server_fee,has_ratio,turnover_ratio")
->where(["id"=>['in',$pc_id],"company_type"=>1])
->where($pc_map)
->select();
$pc =[];
$Promote = M("Promote","tab_");
@ -550,7 +555,6 @@ class CompanyStatementSetController extends Controller {
unset($tmpp);
unset($js_id);
$this->getPromoteCompanySpend($pcList,array_unique(array_keys($pcList)),$begintime,$endtime);
// dd($pcList);
//数据整合
$verify_log=json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]);
$StatementDb = M("CompanyStatement","tab_");
@ -558,7 +562,6 @@ class CompanyStatementSetController extends Controller {
$statement_begin_time = date("Y-m-d",$begintime);
$statement_end_time = date("Y-m-d",$endtime);
$RewardRecord = M("RewardDetail","tab_");
foreach($pcList as $k=>$v){
if(!isset($pc[$k])){continue;}//不存在的公司不结算
if($pc[$k]['has_ratio'] == 1){

Loading…
Cancel
Save