|
|
|
@ -61,8 +61,8 @@ class GameMarginSetController extends Controller {
|
|
|
|
|
{
|
|
|
|
|
$this->getInsideCompanyid();
|
|
|
|
|
$this->getAllGameSpend();
|
|
|
|
|
$this->getCpStatement();
|
|
|
|
|
$this->getJuheStatement();
|
|
|
|
|
$this->getCpStatement();
|
|
|
|
|
$this->getPuStatement();
|
|
|
|
|
$this->getPcStatement();
|
|
|
|
|
$this->setMarginCount();
|
|
|
|
@ -91,7 +91,7 @@ class GameMarginSetController extends Controller {
|
|
|
|
|
"is_refund"=>0,
|
|
|
|
|
"payed_time"=>["between",[$this->beginThismonth,$this->endThismonth]]
|
|
|
|
|
];
|
|
|
|
|
$this->adddata = M("Spend","tab_")->where($where)->group("relation_game_name")->getField("substring_index(game_name, '(', 1) relation_game_name,SUM(pay_amount) pay_amount",true);
|
|
|
|
|
$this->adddata = M("Spend","tab_")->where($where)->group("relation_game_name")->order("pay_amount desc")->getField("substring_index(game_name, '(', 1) relation_game_name,SUM(pay_amount) pay_amount",true);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取聚合数据
|
|
|
|
@ -347,13 +347,15 @@ class GameMarginSetController extends Controller {
|
|
|
|
|
if( !array_key_exists($game,$this->adddata) ){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$statement_money = round( $this->adddata[$game]['pay_amount'] / $val['pay_amount'] * $val['sum_money'],2);
|
|
|
|
|
$ratio = $val['first_ratio'];
|
|
|
|
|
$statement_money = round( $this->adddata[$game]['pay_amount'] * $ratio / 100,2);
|
|
|
|
|
if( array_key_exists("cp_statement_amount",$this->adddata[$game]) ){
|
|
|
|
|
$this->adddata[$game]['cp_statement_amount'] += $statement_money;
|
|
|
|
|
}else{
|
|
|
|
|
$this->adddata[$game]['cp_statement_amount'] = $statement_money;
|
|
|
|
|
}
|
|
|
|
|
$this->adddata[$game]['cp_promote_ratio'] = $val['promote_ratio'];
|
|
|
|
|
$this->adddata[$game]['cp_ratio'] = $ratio;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -437,7 +439,7 @@ class GameMarginSetController extends Controller {
|
|
|
|
|
$pay_amount = 0;
|
|
|
|
|
foreach ($this->adddata as &$v) {
|
|
|
|
|
foreach ($baseCell as $bkey=>$bval) array_key_exists($bkey,$v) ?: $v[$bkey] = $bval;
|
|
|
|
|
$v["cp_ratio"] = round($v["cp_statement_amount"]/$v['pay_amount'],4)*100;
|
|
|
|
|
// $v["cp_ratio"] = round($v["cp_statement_amount"]/$v['pay_amount'],4)*100;
|
|
|
|
|
|
|
|
|
|
if($v["pc_pay_amount"] > 0){
|
|
|
|
|
$v["pc_ratio"] = round($v["pc_statement_amount"]/$v['pc_pay_amount'],4)*100;
|
|
|
|
|