Merge pull request 'feature/more_payment' (#482) from feature/more_payment into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/482
master
廖金灵 3 years ago
commit 80a020e352

@ -285,7 +285,7 @@ class StatementWarningSetController extends Controller {
->join("tab_partner as p on g.partner_id = p.id")
->where(['g.id'=>['in',$game_ids]])
->group("g.partner_id")
->getField('p.id company_id,GROUP_CONCAT(g.id) game_ids,p.partner company_name',true);
->getField('p.id company_id,GROUP_CONCAT(g.id) game_ids,p.partner company_name,channel_rate,taxation_rate',true);
}
/**
@ -300,6 +300,10 @@ class StatementWarningSetController extends Controller {
foreach ($gameids as $gameid) {
$statementMoney += ($gamedata[$gameid]-0);
}
//上游需要计算祱费及渠道费用
if($value['channel_rate'] > 0 || $value['taxation_rate'] > 0){
$statementMoney=round($statementMoney*(100-$value['channel_rate'])*(100-$value['taxation_rate'])/(100*100), 2);//结算金额=平台总额*1-渠道费)*分成比例*(1-税费费率)
}
$company[$key]['statement_money'] = $statementMoney;
unset($company[$key]['game_ids']);
}
@ -317,7 +321,7 @@ class StatementWarningSetController extends Controller {
'company_belong'=>0
])->getField("id company_id,company_name,develop_type",true);
$company = $this->getPromoteCompanyGameSpend($company);
$company = $this->getPromoteCompanyGameSpend($company,0);
$pcStatementAmount = $this->addStatementWarningInfo($company,0);
$savedata = [
'type'=>2,
@ -334,7 +338,7 @@ class StatementWarningSetController extends Controller {
$this->statementWarningModel->add($savedata);
}
}
private function getPromoteCompanyGameSpend($company)
private function getPromoteCompanyGameSpend($company,$companyBelong)
{
$where = [
'tab_spend.is_check'=>1,
@ -356,7 +360,7 @@ class StatementWarningSetController extends Controller {
foreach ($items as $key => $val) {
$relationGameId = $games[$val['relation_game_name']];
$radio = end($CompanyGameRatio->getGameRadio($val['company_id'],$relationGameId,0,$this->beginThismonth,$this->endThismonth));
$radio = end($CompanyGameRatio->getGameRadio($val['company_id'],$relationGameId,$companyBelong,$this->beginThismonth,$this->endThismonth));
$radio = $CompanyGameRatio->getTurnoverRatio($val['amount'],$radio['ratio'],$radio['turnover_ratio']);
$statementMoney =round($val['amount']*$radio/100,2);
if(isset($company[$val['company_id']]['statement_money'])){
@ -379,7 +383,7 @@ class StatementWarningSetController extends Controller {
$puStatementAmount = 0;
if($company) {
$company = $this->getPuSpecialStatement( $this->getPromoteCompanyGameSpend($company) );
$company = $this->getPuSpecialStatement( $this->getPromoteCompanyGameSpend($company,1) );
foreach ($company as $key => $value) {
if(!array_key_exists('statement_money',$value) ) {
unset($company[$key]);

@ -85,7 +85,7 @@
<div class="data_list">
<div style="display: flex;line-height: 3;justify-content:space-between;">
<div style="color: red;">
结算时间:{$last_update}
更新时间:{$last_update}
</div>
<div style="color: red;">
单位:万元

@ -53,7 +53,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">财务预警表</h3>
<p class="description_text"></p>
<p class="description_text">每日凌晨五点自动更新,如需获取时时数据,请手动进行【月份重算】</p>
</div>
<style>
@ -94,7 +94,7 @@
<div class="data_list">
<div style="display: flex;line-height: 3;justify-content:space-between;">
<div style="color: red;">
结算时间:{$last_update}
更新时间:{$last_update}
</div>
<div style="color: red;">
单位:万元

Loading…
Cancel
Save