Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
zhengyongxing 5 years ago
commit 248b0c0ac5

@ -223,9 +223,11 @@ class MemberController extends ThinkController
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
$allcountsql = str_replace("tab_user.promote_id","ss.promote_id",$sql);
//获取总额
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']);
$allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $allcountsql . ') as a')->select();
$this->assign('history_count', $allcount[0]['recharge_total']?:0);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
@ -240,10 +242,10 @@ class MemberController extends ThinkController
}
$jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
$count = $jcount[0]['count'];
//var_dump(M('User', 'tab_')->getLastSql());die();
$count = $jcount[0]['count'] ?:0 ;
$this->assign('user_count', $count);
$this->assign('now_count', $jcount[0]['recharge_total']);
// var_dump($jcount);die();
$this->assign('now_count', $jcount[0]['recharge_total']?:0);
$model = M('Model')->getByName('user');

@ -1163,9 +1163,6 @@ class DownloadController extends BaseController {
* @author sunke
*/
public function recharge_data_export() {
if (empty(I('begtime')) || empty(I('endtime'))) {
$this->error('请选择起止时间');
}
$beginTime = strtotime(I('begtime') . ' 00:00:00');
$endtime = strtotime(I('endtime') . ' 23:59:59');
if (($endtime - $beginTime) > 31 * 24 * 3600) {
@ -2439,7 +2436,7 @@ class DownloadController extends BaseController {
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages - 1; $i++) {
for($i = 1; $i <= $pages; $i++) {
foreach($data as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
@ -2952,7 +2949,7 @@ class DownloadController extends BaseController {
->where($map)
->order('tab_spend.id desc')
->select();
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
@ -2967,6 +2964,7 @@ class DownloadController extends BaseController {
$accessNum = count($data1)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) {
$model = M('spend','tab_');
$data = $model
@ -3017,12 +3015,10 @@ class DownloadController extends BaseController {
$csvData["p_proinfo"] = $value1["p_proinfo"];
$csvData["proinfo"] = $value1["proinfo"];
$csvData["pay_time"] = $value1["pay_time"];
mb_convert_variables('GBK', 'UTF-8', $csvData);
fputcsv($fp, $csvData);
$xlsData[] = $csvData;
}
foreach($xlsData as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
}
unset($xlsData);
ob_flush();
flush();

Loading…
Cancel
Save