master
yulingwei 4 years ago
parent aa77fb7821
commit 7fc6609d78

@ -673,10 +673,9 @@ class PlatformController extends ThinkController
// 如果是市场专员那么只能看自己的 // 如果是市场专员那么只能看自己的
$isMarketAdmin = isMarketAdmin(); $isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) { if ($isMarketAdmin) {
$statisticsMap['tab_promote.admin_id'] = $_REQUEST['admin_user_id'] = $map['tp2.admin_id'] = is_login(); $map['s.market_admin_id'] = $statisticsMap['tab_promote.admin_id'] = $_REQUEST['admin_user_id'] = $map['tp2.admin_id'] = is_login();
} }
if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])||isset($_REQUEST['admin_id'])||isset($_REQUEST['admin_user_id'])) {
$data = M('promote', 'tab_')->alias('tp1') $data = M('promote', 'tab_')->alias('tp1')
->field('tp1.account as promote_account,tp1.id, ->field('tp1.account as promote_account,tp1.id,
floor(sum(pay_amount)*100) as count') floor(sum(pay_amount)*100) as count')
@ -687,16 +686,28 @@ class PlatformController extends ThinkController
->group('tp1.id') ->group('tp1.id')
->order('count desc') ->order('count desc')
->select(); ->select();
} else {
$statisticsMap['time'] =$map['pay_time']; // if (isset($_REQUEST['server_id'])||isset($_REQUEST['game_name'])||isset($_REQUEST['promote_id'])||isset($_REQUEST['admin_id'])||isset($_REQUEST['admin_user_id'])) {
setPowerPromoteIds($statisticsMap, 'tab_promote.id'); // $data = M('promote', 'tab_')->alias('tp1')
$data = M('promote_statistics', 'tab_') // ->field('tp1.account as promote_account,tp1.id,
->field("promote_account,promote_id as id,sum(count) count") // floor(sum(pay_amount)*100) as count')
->join('tab_promote on tab_promote.id = tab_promote_statistics.promote_id', 'left') // ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') OR tp2.id = tp1.id", 'left')
->where($statisticsMap) // ->join("tab_spend as s use INDEX(search) on tp2.id = s.promote_id", 'left')
->group("promote_id") // ->join("tab_game as g on g.id = s.game_id", 'left')
->select(); // ->where($map)
} // ->group('tp1.id')
// ->order('count desc')
// ->select();
// } else {
// $statisticsMap['time'] =$map['pay_time'];
// setPowerPromoteIds($statisticsMap, 'tab_promote.id');
// $data = M('promote_statistics', 'tab_')
// ->field("promote_account,promote_id as id,sum(count) count")
// ->join('tab_promote on tab_promote.id = tab_promote_statistics.promote_id', 'left')
// ->where($statisticsMap)
// ->group("promote_id")
// ->select();
// }
// var_dump($data);die(); // var_dump($data);die();

Loading…
Cancel
Save