优化子站启动脚本

master
chenzhi 4 years ago
parent 4024e45c64
commit a439946207

@ -70,78 +70,41 @@ class SubCompanyStatementSetController extends Controller {
$stime = strtotime($stime);
}
$nowdate = date("Y-m-d",$stime);
$w = (int)date("w",$stime);
$d = (int)date("d",$stime);
if($w == 1 || $d == 1){
if($w == 1){
if($company == "all"){
echo $nowdate.":".PHP_EOL;
echo "--周结begin".PHP_EOL;
$this->cpStatement(0,$stime);
echo "∟----CP周结统计ok".PHP_EOL;
$this->promoteCompanyStatement(0,$stime);
echo "∟----推广公司周结统计ok".PHP_EOL;
if(!IS_SUBSITE){
$this->promoteUserPool(0,$stime);
echo "∟----推广个人周结ok".PHP_EOL;
}
}
if($company == "cp"){
$this->cpStatement(0,$stime);
echo "∟----CP周结统计ok".PHP_EOL;
}
if($company == "pc"){
$this->promoteCompanyStatement(0,$stime);
echo "∟----推广公司周结统计ok".PHP_EOL;
}
if($company == "pu"){
$this->promoteUserPool(0,$stime);
echo "∟----推广个人周结ok".PHP_EOL;
}
if($d == 1){
if($company == "all"){
echo $nowdate.":".PHP_EOL;
echo "--月结&补点begin".PHP_EOL;
$this->cpStatement(1,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----官方/推广公司月结统计ok".PHP_EOL;
$this->promoteUserPool(1,$stime);
echo "∟----推广个人月结统计ok".PHP_EOL;
}
if($d == 1){
if($company == "all"){
echo $nowdate.":".PHP_EOL;
echo "--月结&补点begin".PHP_EOL;
$this->cpStatement(1,$stime);
$this->cpStatement(2,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----官方/推广公司月结&补点统计ok".PHP_EOL;
if(!IS_SUBSITE){
$this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
}
if($company == "cp"){
$this->cpStatement(1,$stime);
$this->cpStatement(2,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
}
if($company == "pc"){
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----官方/推广公司月结&补点统计ok".PHP_EOL;
}
if($company == "pu"){
$this->promoteUserPool(1,$stime);
$this->promoteUserPool(2,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
if($company == "cp"){
$this->cpStatement(1,$stime);
echo "∟----CP月结&补点统计ok".PHP_EOL;
}
if($company == "pc"){
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----官方/推广公司月结&补点统计ok".PHP_EOL;
}
if($company == "pu"){
$this->promoteUserPool(1,$stime);
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
}else{
echo $nowdate."非周一和月初,无需任何处理".PHP_EOL;
echo $nowdate."非月初,无需任何处理".PHP_EOL;
}
}
/**
@ -425,6 +388,8 @@ class SubCompanyStatementSetController extends Controller {
$v['ratio']=0;
$v['sum_money'] = 0;
$v['statement_type']=0;
$v['platform_money'] = $v['pay_amount'];
$v['aggregate_money'] = 0;
$add_data['platform_amount'] += $v['pay_amount'];
$add_data['pay_amount'] += $v['pay_amount'];
@ -1426,7 +1391,6 @@ class SubCompanyStatementSetController extends Controller {
$user['withdraw_type'] = 1;
//月结&补点
$this->doPromoteUserPool($user,1,$stime,$recount);
}else{
$users['withdraw_type'] = 2;
$user['withdraw_type'] = 2;

Loading…
Cancel
Save