[优化 ]新增历史累计充值记录

master
chenzhi 5 years ago
parent 6b7f65be25
commit c76e0620b7

@ -219,6 +219,10 @@ class MemberController extends ThinkController
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
//获取总额
$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']);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
@ -234,7 +238,7 @@ 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($jcount);die();
$this->assign('pay_allcount', $jcount[0]['recharge_total']);
$this->assign('now_count', $jcount[0]['recharge_total']);
$model = M('Model')->getByName('user');

@ -306,10 +306,23 @@
</empty>
<tr class="data_summary">
<td colspan="3" style="text-align: center;">汇总:</td>
<td colspan="99">
累计充值:{$pay_allcount}
</td>
<td></td>
<if condition="I('promote_id') && I('promote_id') gt 0 ">
<td colspan="8">
当前用户累计充值:{$now_count} &#12288;&#12288;
历史累计充值:{$history_count}
</td>
<td colspan="8" style="font-style: 12px;color: #a9a9a9;text-align: center;">
当前用户累计充值:&#12288;当前属于该推广员的用户的充值累计(不含用户换绑前记录)&#12288;&#12288;/&#12288;&#12288;
历史累计充值:&#12288;历史中属于该推广员的用户的充值累计(含用户换绑前记录)
</td>
<else />
<td colspan="99">
当前用户累计充值:{$now_count}
</td>
</if>
</tr>
</tbody>
</table>

Loading…
Cancel
Save