优化公司单子为一单

master
chenzhi 5 years ago
parent ec7b333fa4
commit b3813dad4a

@ -488,25 +488,16 @@ class CompanyStatementController extends ThinkController
"op_time"=>time(), "op_time"=>time(),
"company_list"=>[] "company_list"=>[]
]; ];
$datas = ["ups","up","downs","down"]; $datas = ["up","down"];
//初始化数据 //初始化数据
foreach($datas as $k=>$v){ foreach($datas as $k=>$v){
if($v =="ups"){
$basedata['company_type']=3;
$basedata['is_payment']=1;
}
if($v =="up"){ if($v =="up"){
$basedata['company_type']=3; $basedata['company_type']=3;
$basedata['is_payment']=2;
}
if($v =="downs"){
$basedata['company_type']=1;
$basedata['is_payment']=1; $basedata['is_payment']=1;
} }
if($v =="down"){ if($v =="down"){
$basedata['company_type']=1; $basedata['company_type']=1;
$basedata['is_payment']=2; $basedata['is_payment']=1;
} }
$datas[$v]=$basedata; $datas[$v]=$basedata;
unset($datas[$k]); unset($datas[$k]);
@ -516,20 +507,11 @@ class CompanyStatementController extends ThinkController
if($v['verify_status'] != 2) continue; if($v['verify_status'] != 2) continue;
if($v['company_belong'] == 9){ if($v['company_belong'] == 9){
//上游 //上游
if($v['is_payment'] == 1){
$this->setDf($datas['ups'],$v);
}else{
$this->setDf($datas['up'],$v); $this->setDf($datas['up'],$v);
}
}else{
if($v['is_payment'] == 1){
$this->setDf($datas['downs'],$v);
}else{ }else{
$this->setDf($datas['down'],$v); $this->setDf($datas['down'],$v);
} }
} }
}
$Pool = M("company_statement_pool","tab_"); $Pool = M("company_statement_pool","tab_");
$Statemen = M("company_statement","tab_"); $Statemen = M("company_statement","tab_");
foreach ($datas as $k => $v) { foreach ($datas as $k => $v) {
@ -613,7 +595,7 @@ class CompanyStatementController extends ThinkController
unset($value["second_ratio"]); unset($value["second_ratio"]);
} }
} }
if($k=="ups" || $k=='downs'){ if($va['is_payment'] == 1){
$is_payment = 1; $is_payment = 1;
$verify_status = 0; $verify_status = 0;
}else{ }else{
@ -747,7 +729,8 @@ class CompanyStatementController extends ThinkController
"fine"=>$fine, "fine"=>$fine,
"reward"=>$reward, "reward"=>$reward,
"statement_info"=>$v['statement_info'], "statement_info"=>$v['statement_info'],
"statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5) "statement_num"=>"JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5),
"is_payment"=>$v['is_payment']
]; ];
$savedata['company_list'][$v['company_id']] = $tdata; $savedata['company_list'][$v['company_id']] = $tdata;
} }

Loading…
Cancel
Save