@ -132,14 +132,12 @@ class MemberController extends ThinkController
//计算用户列表
//计算用户列表
$data = M("user","tab_")
$data = M("user","tab_")
->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`,lock_remark,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
->field("tab_user.id,`device_number`,count(`device_number`) as device_count,`age_status`,`account`,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(sum(ss.pay_amount), 0) AS recharge_total")
@ -261,4 +261,68 @@ class TimingController extends AdminController {
return $mid;
return $mid;
}
}
//格式 starttime 20200229 endtime 20200230
public function setAvailableBalance() {
if (strtotime($_GET['endtime'])<strtotime($_GET['starttime'])&&$_GET['endtime']){
echo '错误,结束时间小于开始时间';
}
// $starttime = 1571587200;
$starttime = strtotime(date('Ymd',time()));
// var_dump($starttime);die();
if ($_GET['starttime']) {
$starttime = strtotime($_GET['starttime']);
}
$endtime = $starttime + 86399;
if ($_GET['endtime']) {
$endtime = strtotime($_GET['endtime']) + 86399;
}
for ($start = $starttime; $start<$endtime; $start=$start + 86400) {
// var_dump($starttime);die();
$data = M('spend','tab_')
->field("sum(`pay_amount`) as pay_amount,promote_id,promote_account,tab_spend.game_id,tab_spend.game_name,tab_spend.server_id,tab_spend.server_name,CASE WHEN old_value_ratio is NULL THEN 0 ELSE sum(`pay_amount`) * old_value_ratio END as available_balance")
->join('left join tab_resource_verify_config as config on tab_spend.game_id = config.game_id')