->field("tab_user.id,`device_number`,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->field("tab_user.id,`device_number`,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left")
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left")
@ -78,26 +82,34 @@ class MemberController extends ThinkController
}
}
$data = $data->select();
$data = $data->select();
// echo($data);die();
//计算总数
//计算累计充值总额
$countsql = M("user","tab_")
$history_count = M("user","tab_")
->field("IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->field("IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left")
->join("tab_spend AS ss ON ss.user_id = tab_user.id AND ss.pay_status = 1","left")