Merge remote-tracking branch 'origin/dev' into dev

master
liuweiwen 5 years ago
commit 660d9d9550

@ -2769,7 +2769,20 @@ class DownloadController extends BaseController {
$spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值
$params['pay_way'] = -1; $params['pay_way'] = -1;
$spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 $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) { foreach ($params['dayList'] as $day) {
$date = date('Ymd', strtotime($day)); $date = date('Ymd', strtotime($day));
$records[] = [ $records[] = [
@ -2789,12 +2802,29 @@ class DownloadController extends BaseController {
'spend_discount' => 0, 'spend_discount' => 0,
'spend_voucher' => 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 = []; $xlsData = [];
foreach ($records as $key1 => $value1) { foreach ($records as $key1 => $value1) {
$xlsData[] = $value1; $xlsData[] = $value1;
} }
$this->exportExcel($xlsName, $xlsCell, $xlsData,$id); $this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
} }

@ -259,28 +259,21 @@ class PromoteController extends BaseController
$whereUser['promote_id'] = ['IN', $promoteId]; $whereUser['promote_id'] = ['IN', $promoteId];
if ($type == 1) { if (in_array($type, [1, 2])) {
$pay_time = total(1); if ($type == 1) {
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $pay_time = total(1);
$end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$whereUser['register_time'] = ['between', array($start, $end - 1)]; $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$userId = M('user', 'tab_')->field('id')->where($whereUser)->select(); } else {
$pay_time = total(3);
} else if ($type == 2) { $start = mktime(0, 0, 0, date('m'), 1, date('Y'));
$pay_time = total(3); $end = mktime(0, 0, 0, date('m') + 1, 1, date('Y')) - 1;
$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)]; $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) { if ($userId) {
$userId = implode(',', array_column($userId, 'id'));
// var_dump($userId);
$map1['user_id'] = $map['user_id'] = ['IN', $userId]; $map1['user_id'] = $map['user_id'] = ['IN', $userId];
} else if (!$userId && $type != 0) { } else if (!$userId && $type != 0) {
return array('sum_mounth' => 0, 'sum_today' => 0); return array('sum_mounth' => 0, 'sum_today' => 0);
@ -333,9 +326,6 @@ class PromoteController extends BaseController
} }
$data[] = $dbdata; $data[] = $dbdata;
} }
// if ($userId) {
// echo $spend->_sql();die();
// }
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$value['count'] ?: 0; $value['count'] ?: 0;
$value['today'] ?: 0; $value['today'] ?: 0;
@ -353,8 +343,6 @@ class PromoteController extends BaseController
$total = $this->data_total($data); $total = $this->data_total($data);
return $total; return $total;
//
} }
public function data_total($data) public function data_total($data)

@ -618,3 +618,7 @@ MODIFY COLUMN `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型 0
ALTER TABLE `tab_user` MODIFY COLUMN `register_type` tinyint(2) DEFAULT '1' COMMENT '注册方式 0游客1账号 2 手机 3微信 4QQ 5百度 6微博 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)'; 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 '游戏评分';
Loading…
Cancel
Save