|
|
|
@ -840,7 +840,7 @@ class SpendModel extends Model
|
|
|
|
|
*/
|
|
|
|
|
public function gameStatistics($map, $row = 0, $page = 1)
|
|
|
|
|
{
|
|
|
|
|
$query = $this->alias("s")
|
|
|
|
|
$query = M("Spend s use index(game_time)","tab_")
|
|
|
|
|
->field("s.game_id,s.game_name,p.partner as partner_name, g.game_type_name,
|
|
|
|
|
SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
|
|
|
|
|
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
|
|
|
|
@ -856,13 +856,25 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,g.sd
|
|
|
|
|
$data = $query->select();
|
|
|
|
|
return $data;
|
|
|
|
|
}
|
|
|
|
|
public function gameStatisticsCount($map)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$query = M("Spend s use index(game_time)","tab_")
|
|
|
|
|
->field("game_id")
|
|
|
|
|
->where(['s.pay_status' => 1, 'pay_game_status' => 1])
|
|
|
|
|
->where($map)
|
|
|
|
|
->group('s.game_id');
|
|
|
|
|
$data = $query->select();
|
|
|
|
|
|
|
|
|
|
return count($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*获取游戏统计列表数据
|
|
|
|
|
*/
|
|
|
|
|
public function totalGameStatistics($map, $join = true)
|
|
|
|
|
{
|
|
|
|
|
$query = $this->alias("s")
|
|
|
|
|
$query = M("Spend s use index(game_time)","tab_")
|
|
|
|
|
->field("SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
|
|
|
|
|
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
|
|
|
|
|
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count");
|
|
|
|
|