Merge pull request 'feature/finance_payment_20210115' (#223) from feature/finance_payment_20210115 into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/223
master
廖金灵 4 years ago
commit 2690db95ab

@ -256,12 +256,7 @@ class PlatformController extends ThinkController
"pay_status"=>1
];
D("Spend")->addSubsiteWhere($map);
if(IS_SUBSITE){
$SpendModel = M("Spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("Spend","tab_");
}
$Payamount = $SpendModel->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
$Payamount = SM("Spend","tab_")->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(empty($Payamount)) return ;
foreach ($Payamount as $v) {
$list[$v['paytime']]['payamount'] = $v['pay_amount'];
@ -276,12 +271,7 @@ class PlatformController extends ThinkController
"pay_time"=>["between",$yearMap],
"pay_status"=>1
];
if(IS_SUBSITE){
$SpendModel = M("Spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("Spend","tab_");
}
$Payamount = $SpendModel->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
$Payamount = SM("Spend","tab_")->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(empty($Payamount)) return ;
foreach ($Payamount as $v) {
$list[$v['paytime']]['unpayamount'] = $v['pay_amount'];

@ -75,20 +75,6 @@ class SubSpendController extends ThinkController
unset($_REQUEST['merchant_id']);
}
// $marketAdminId = 0;
// $isMarketAdmin = isMarketAdmin();
// if ($isMarketAdmin) {
// $userAuth = session('user_auth');
// $marketAdminId = $userAuth['uid'];
// } else {
// $marketAdminId = I('market_admin_id', 0);
// }
// if ($marketAdminId > 0) {
// $map['market_admin_id'] = $marketAdminId;
// } else {
// setPowerPromoteIds($map,'promote_id');
// }
if (isset($_REQUEST['promote_id']) || isset($_REQUEST['company_id'])) {
$promoteId = I('promote_id',-1);
$companyId = I('company_id',-1);
@ -122,20 +108,7 @@ class SubSpendController extends ThinkController
$map['game_id'] = ['in',$game_id];
}
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
// $map1 = $map;
// $map1['pay_status'] = 1;
// } else {
// $map = '1 = 2';
// $map1 = $map;
// }
// $this->checkListOrCountAuthRestMap($map,["extend", "pay_order_number", "user_account"]);
D("Spend")->addSubsiteWhere($map);
$map1 = $map;
$map1['pay_status'] = 1;
$total = null_to_0(M(self::model_name,"tab_")->where($map1)->sum('pay_amount'));
$this->assign('total', $total);
$this->meta_title = $this->m_title = '游戏充值';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
@ -183,8 +156,11 @@ class SubSpendController extends ThinkController
$endTime = strtotime($endDate) + 86399;
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
$is_sub_data = I("issubdata",0);
if($is_sub_data == 1){
$SpendModel = M("spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("spend","tab_");
}
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
@ -661,6 +637,10 @@ class SubSpendController extends ThinkController
if ($page) {
$data['page'] = $page;
}
$total = null_to_0($SpendModel->where($map)->where("pay_status = 1")->sum('pay_amount'));
$this->assign('total', $total);
return $data;
}

@ -370,7 +370,7 @@
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('exportList',array_merge(array('xlsname'=>'游戏订单_游戏充值','timestart'=>$startDate,'timeend'=>$endDate,'issubdata'=>$isSubData),I('get.')))}">导出</a>
<a class="sch-btn" href="{:U('exportList',array_merge(array('xlsname'=>'游戏订单_游戏充值','issubdata'=>$isSubData),I('get.')))}">导出</a>
{$_page|default=''}
</div>

Loading…
Cancel
Save