优化游戏统计

master
chenzhi 4 years ago
parent c0926299dc
commit 40005b7177

@ -740,6 +740,7 @@ class FinanceController extends ThinkController
$searchGameIds = M('game', 'tab_')->where($gameWhere)->getField('id', true);
$startTime = time();
D("spend")->addSubsiteWhere($map);
//游戏统计列表
if(isset($_REQUEST['export'])){
$data = D("spend")->gameStatistics($map,$searchGameIds, 0, 0);
@ -1066,15 +1067,17 @@ class FinanceController extends ThinkController
if (!empty(I('user_nickname'))) {
$map['game_player_name'] = array('like',I("user_nickname").'%');
}
D("Spend")->addSubsiteWhere($map);
// var_dump($map);die();
$field = "pay_order_number,FROM_UNIXTIME(payed_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way,sdk_version,merchant_id";
$group = "";
$order = "payed_time DESC";
if(isset($_REQUEST['export'])){
$data = D('spend')->getSubSpendData($map,$field,$group,$order,0,0);
$data = D('spend')->getSpendData($map,$field,$group,$order,0,0);
}else{
$data = D('spend')->getSubSpendData($map,$field,$group,$order,$page,$row);
$data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row);
}
$merchant_data = M("payment_merchant","tab_")
@ -1143,7 +1146,7 @@ class FinanceController extends ThinkController
$this->assign('sumInside', $sumInside);
$this->assign('sumAll', null_to_0($sumAll));
$count = D("spend")->getSubSpendData($map,'count(*) as count',$group,$order);
$count = D("spend")->getSpendData($map,'count(*) as count',$group,$order);
$this->checkListOrCountAuthRestMap($map,[]);
$count = $count[0]['count'];

@ -825,21 +825,6 @@ class SpendModel extends Model
return $data;
}
/**
* 获取多站点查询
*/
public function getSubSpendData($map = [], $field = '', $group = '', $order = '', $page = 0, $row = 0)
{
$query = $this->field($field)->where($map)->group($group)->order($order);
if ($row == 0) {
$data = $query->select();
} else {
$data = $query->page($page, $row)->select();
}
return $data;
}
/**
* 获取统计 $map,$page,$row
*/

Loading…
Cancel
Save