优化海南结算

master
chenzhi 4 years ago
parent a3a3505894
commit 927c5b8595

@ -113,6 +113,7 @@ class CompanyStatementSetController extends Controller {
$this->promoteCompanyStatement(1,$stime);
$this->promoteCompanyStatement(2,$stime);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----推广公司月结&补点统计ok".PHP_EOL;
$this->promoteUserPool(1,$stime);
@ -127,12 +128,12 @@ class CompanyStatementSetController extends Controller {
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);
$this->officeCompanyStatement($stime); //官方结算
echo "∟----推广个人月结&补点统计ok".PHP_EOL;
}
}
@ -481,10 +482,10 @@ class CompanyStatementSetController extends Controller {
//官方结算
public function officeCompanyStatement($stime,$recount=false)
{
$t = $this->setBeginAndEndTime($type,$stime);
$t = $this->setBeginAndEndTime(1,$stime);
$begintime = $t[0];
$endtime = $t[1];
//获取官方信息
$pc_map = [
"id"=>["IN",$pc_id],
@ -526,7 +527,7 @@ class CompanyStatementSetController extends Controller {
"s.payed_time"=>['between', [$begintime,$endtime]],
"s.promote_id"=>0
];
$list = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('game_id')
$list = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('relation_game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
if(empty($list)){return;}
@ -553,7 +554,6 @@ class CompanyStatementSetController extends Controller {
M("CompanyStatement","tab_")->add($add_data);
}
/**
* 下游结算
*/

Loading…
Cancel
Save