推广员-数据管理-实时充值 优化打开速度

master
chenzhi 5 years ago
parent 3029a92d07
commit 26300062b1

@ -694,6 +694,9 @@ class PromoteController extends ThinkController
*/
public function spend_list()
{
if(!array_key_exists("timeStart",$_REQUEST)){
$this->redirect(ACTION_NAME, array('timeStart' => date('Y-m-d',strtotime('-30 day')),"timeEnd"=>date('Y-m-d')));
}
if (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name']=='全部') {
unset($_REQUEST['game_name']);
@ -799,7 +802,7 @@ class PromoteController extends ThinkController
setPowerPromoteIds($map);
// dd($map);
$model = array(
'm_name' => 'Spend',
'm_name' => 'spend use index(promote_time)',
'map' => $map,
'order' => 'id desc',
'title' => '渠道充值',
@ -814,9 +817,9 @@ class PromoteController extends ThinkController
];
//为数据权限添加
setPowerPromoteIds($map2);
$total = null_to_0(D('Spend')->where($map1)->sum('pay_amount'));//累计充值
$ttotal = null_to_0(D('Spend')->where(['pay_time' => total(1, false)])->where($map2)->sum('pay_amount'));//昨日充值
$ytotal = null_to_0(D('Spend')->where(['pay_time' => total(5, false)])->where($map2)->sum('pay_amount'));//今日充值
$total = null_to_0(M('Spend use index(promote_time)',"tab_")->where($map1)->sum('pay_amount'));//累计充值
$ttotal = null_to_0(M('Spend use index(promote_time)',"tab_")->where(['pay_time' => total(1, false)])->where($map2)->sum('pay_amount'));//昨日充值
$ytotal = null_to_0(M('Spend use index(promote_time)',"tab_")->where(['pay_time' => total(5, false)])->where($map2)->sum('pay_amount'));//今日充值
// dd($total,$ttotal,$ytotal);
$this->assign('total', $total);
$this->assign('ttotal', $ttotal);

@ -31,8 +31,8 @@ class SpendEvent extends ThinkEvent {
$model['order'] = $data_order_type.' '.$sort;
}
$new_model = D($name);
$data = D($name)
$new_model = M($name,"tab_");
$data = $new_model
// 查询条件
->where($map)
/* 默认通过id逆序排列 */
@ -44,7 +44,7 @@ class SpendEvent extends ThinkEvent {
/* 执行查询 */
->select();
/* 查询记录总数 */
$count = D($name)
$count = $new_model
// 查询条件
->where($map)
/* 默认通过id逆序排列 */

Loading…
Cancel
Save