优化下游个人结算

master
chenzhi 4 years ago
parent 141951467c
commit 9b78b8b461

@ -793,12 +793,12 @@ class CompanyStatementSetController extends Controller {
}
}
public function promoteUserPool($type,$stime,$recount = false,$is_payment=false){
public function promoteUserPool($type,$stime,$recount = false){
$t = $this->setBeginAndEndTime($type,$stime);
$begintime = $t[0];
$endtime = $t[1];
$basedata = [
$user = [
"pay_amount"=>0,
"statement_money"=>0,
"lack_statement_money"=>0,
@ -813,45 +813,40 @@ class CompanyStatementSetController extends Controller {
"verify_status"=>0,
"company_type"=>2,
"verify_log"=>json_encode(["create_user"=>"system","create_time"=>date("Y-m-d H:i:s")]),
"op_time"=>time()
"op_time"=>time(),
"statement_num"=>"PL_".date('Ymd').date('His').sp_random_num(3)
];
$users = $user = $basedata;
$users['is_payment'] = 1;
$users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
// $users = $user = $basedata;
// $users['is_payment'] = 1;
// $users['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
$user['is_payment'] = 2;
$user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
// $user['is_payment'] = 2;
// $user['statement_num'] = "PL_".date('Ymd').date('His').sp_random_num(3);
if($type == 0){//周结
$this->doPromoteUserPool($user,$users,$type,$stime,$recount);
$this->doPromoteUserPool($user,0,$stime,$recount);
}else if($type == 1){
$users['withdraw_type'] = 1;
$user['withdraw_type'] = 1;
//月结&补点
$this->doPromoteUserPool($user,$users,1,$stime,$recount);
$this->doPromoteUserPool($user,1,$stime,$recount);
}else{
$users['withdraw_type'] = 2;
$user['withdraw_type'] = 2;
$this->doPromoteUserPool($user,$users,2,$stime,$recount);
$this->doPromoteUserPool($user,2,$stime,$recount);
}
if($is_payment !== false && $is_payment==1){
$this->savePromotateUserPool($users);
}else if($is_payment !== false && $is_payment==2){
$this->savePromotateUserPool($user);
}else{
$this->savePromotateUserPool($users);
$this->savePromotateUserPool($user);
}
}
/**
* 下游个人汇总单
*/
public function doPromoteUserPool(&$user,&$users,$type,$stime,$recount = false)
public function doPromoteUserPool(&$user,$type,$stime,$recount = false)
{
$t = $this->setBeginAndEndTime($type,$stime);
$begintime = $t[0];
@ -932,11 +927,7 @@ class CompanyStatementSetController extends Controller {
}
//获取其他信息
$v = $this->getCompanyOtherInfo($v,$k);
if($v['is_payment'] == 1){
$countdata = &$users;
}else{
$countdata = &$user;
}
$v['statement_money'] = 0;
$v['pay_amount'] = 0;
$v['fine'] = 0;

Loading…
Cancel
Save