Merge pull request '优化排序' (#110) from feature/testing_daily_count into release

优化排序
master
陈志 4 years ago
commit 98f9c61104

@ -275,6 +275,11 @@ class TestingResourceController extends ThinkController
$page = I('p', 1); $page = I('p', 1);
$row = I('row', 10); $row = I('row', 10);
$params = I('get.'); $params = I('get.');
if(!array_key_exists("create_time_start",$params) && !array_key_exists("create_time_end",$params)){
$this->redirect(ACTION_NAME, array('create_time_start' => date('Y-m-d'),"create_time_end"=>date('Y-m-d')));
}
$where = $this->setDailyCountWhere($params); $where = $this->setDailyCountWhere($params);
$having = '1=1'; $having = '1=1';
isset($params['apply_amount_start']) && !empty($params['apply_amount_start']) && ( $having .= ' and apply_amount >=' . $params['apply_amount_start']); isset($params['apply_amount_start']) && !empty($params['apply_amount_start']) && ( $having .= ' and apply_amount >=' . $params['apply_amount_start']);
@ -284,7 +289,7 @@ class TestingResourceController extends ThinkController
$query = M('testing_resource_batch','tab_') $query = M('testing_resource_batch','tab_')
->where($where)->field("FROM_UNIXTIME(create_time,'%Y-%m-%d') as create_day_time,user_id,role_id,game_id,apply_promote_id,apply_admin_id,verify_admin_id,sum(apply_amount) apply_amount,sum(provide_amount) provide_amount") ->where($where)->field("FROM_UNIXTIME(create_time,'%Y-%m-%d') as create_day_time,user_id,role_id,game_id,apply_promote_id,apply_admin_id,verify_admin_id,sum(apply_amount) apply_amount,sum(provide_amount) provide_amount")
->group("role_id,game_id,create_day_time") ->group("role_id,game_id,create_day_time")
->order("create_day_time desc") ->order("apply_amount desc,create_day_time desc")
->having($having); ->having($having);
$countsql = clone $query; $countsql = clone $query;
if(empty($isExport)){ if(empty($isExport)){

Loading…
Cancel
Save