diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 52500fe8a..699eced67 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2769,7 +2769,20 @@ class DownloadController extends BaseController { $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 - + $allData['role_num'] = 0; + $allData['user_num'] = 0; + $allData['new_user_num'] = 0; + $allData['new_device_num'] = 0; + $allData['new_ip_num'] = 0; + $allData['login_user_num'] = 0; + $allData['spend_user_num'] = 0; + $allData['spend_num'] = 0; + $allData['spend_all_amount'] = 0; + $allData['spend_cash'] = 0; + $allData['spend_generic'] = 0; + $allData['spend_binding'] = 0; + $allData['spend_discount'] = 0; + $allData['spend_voucher'] = 0; foreach ($params['dayList'] as $day) { $date = date('Ymd', strtotime($day)); $records[] = [ @@ -2789,12 +2802,29 @@ class DownloadController extends BaseController { 'spend_discount' => 0, 'spend_voucher' => 0, ]; + $allData['role_num'] += $roleNumList[$day]; + $allData['user_num'] += $userNumList[$day]; + $allData['new_user_num'] += $newUserNumList[$day]; + $allData['new_device_num'] += $newDeviceNumList[$day]; + $allData['new_ip_num'] += $newIpNumList[$day]; + $allData['login_user_num'] += $loginUserNumList[$day]; + $allData['spend_user_num'] += $spendUserNumList[$day]; + $allData['spend_num'] += $spendNumList[$day]; + $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); + $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); + $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); + $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); + $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); + $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); } + $allData['day'] = '合计'; + $records[] = $allData; $xlsData = []; foreach ($records as $key1 => $value1) { $xlsData[] = $value1; } + $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); } diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index f505a8857..fff5f82d7 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -259,28 +259,21 @@ class PromoteController extends BaseController $whereUser['promote_id'] = ['IN', $promoteId]; - if ($type == 1) { - $pay_time = total(1); - $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); - $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; - $whereUser['register_time'] = ['between', array($start, $end - 1)]; - $userId = M('user', 'tab_')->field('id')->where($whereUser)->select(); - - } else if ($type == 2) { - $pay_time = total(3); - $start = mktime(0, 0, 0, date('m'), 1, date('Y')); - $end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1; + if (in_array($type, [1, 2])) { + if ($type == 1) { + $pay_time = total(1); + $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); + $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; + } else { + $pay_time = total(3); + $start = mktime(0, 0, 0, date('m'), 1, date('Y')); + $end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1; + } $whereUser['register_time'] = ['between', array($start, $end - 1)]; - $userId = M('user', 'tab_')->field('id')->where($whereUser)->select(); + $userId = M('user', 'tab_')->where($whereUser)->getField('id', true); } -// if ($userId) { -// var_dump($userId); -// } if ($userId) { - - $userId = implode(',', array_column($userId, 'id')); -// var_dump($userId); $map1['user_id'] = $map['user_id'] = ['IN', $userId]; } else if (!$userId && $type != 0) { return array('sum_mounth' => 0, 'sum_today' => 0); @@ -333,9 +326,6 @@ class PromoteController extends BaseController } $data[] = $dbdata; } -// if ($userId) { -// echo $spend->_sql();die(); -// } foreach ($data as $key => $value) { $value['count'] ?: 0; $value['today'] ?: 0; @@ -353,8 +343,6 @@ class PromoteController extends BaseController $total = $this->data_total($data); return $total; -// - } public function data_total($data) diff --git a/Data/update.sql b/Data/update.sql index d9e6deaf4..30522280a 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -617,4 +617,8 @@ MODIFY COLUMN `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型 0 -- user表注册类型添加7虚拟 ALTER TABLE `tab_user` MODIFY COLUMN `register_type` tinyint(2) DEFAULT '1' COMMENT '注册方式 0游客1账号 2 手机 3微信 4QQ 5百度 6微博 7虚拟'; -ALTER TABLE `tab_game_source` add COLUMN `is_new_sdk` tinyint(2) DEFAULT '0' COMMENT '是否新SDK(IOS)'; \ No newline at end of file +ALTER TABLE `tab_game_source` add COLUMN `is_new_sdk` tinyint(2) DEFAULT '0' COMMENT '是否新SDK(IOS)'; + + +--游戏评分字段改为保留小数1位 2019-12-03 郑昌隆--- +ALTER TABLE tab_game MODIFY COLUMN `game_score` double(3,1) DEFAULT '0' COMMENT '游戏评分'; \ No newline at end of file