组长统计搜索bug修正

master
zyx 5 years ago
parent 62311eb40d
commit e8fc252599

@ -5658,17 +5658,20 @@ if ($key == 'model'){
->where($map)
->group('promote_id')
->select();
$xlsData = array_merge($parentData,$xlsData);
if (empty(I("root_name"))) {
$xlsData = array_merge($parentData, $xlsData);
}
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
if (empty(I("root_name"))) {
$sumData['cash_count'] = number_format($sumData['cash_count'] + $parentData[0]['cash_count'], 2, '.', '');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', '');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', '');
$sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', '');
}
$sumData = [['promote_account'=>'总计',
'cash_count'=>$sumData['cash_count'],

@ -400,17 +400,20 @@ class FinanceController extends ThinkController
->group('promote_id')
->page($page,$row)
->select();
$subQueryAll = array_merge($parentData,$subQueryAll);
if (empty(I("root_name"))) {
$subQueryAll = array_merge($parentData,$subQueryAll);
}
$sumData = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')
->where($map)
->find();
$sumData['cash_count'] = number_format($sumData['cash_count']+$parentData[0]['cash_count'],2,'.','');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count']+$parentData[0]['balance_coin_count'],2,'.','');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count']+$parentData[0]['inside_cash_count'],2,'.','');
$sumData['all_count'] = number_format($sumData['all_count']+$parentData[0]['all_count'],2,'.','');
if (empty(I("root_name"))) {
$sumData['cash_count'] = number_format($sumData['cash_count'] + $parentData[0]['cash_count'], 2, '.', '');
$sumData['balance_coin_count'] = number_format($sumData['balance_coin_count'] + $parentData[0]['balance_coin_count'], 2, '.', '');
$sumData['inside_cash_count'] = number_format($sumData['inside_cash_count'] + $parentData[0]['inside_cash_count'], 2, '.', '');
$sumData['all_count'] = number_format($sumData['all_count'] + $parentData[0]['all_count'], 2, '.', '');
}
$count = M('spend_user_count','tab_')
->field('promote_id,promote_account,sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count, sum(all_count) as all_count')

Loading…
Cancel
Save