|
|
|
<?php
|
|
|
|
namespace Admin\Controller;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 后台首页控制器
|
|
|
|
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
|
|
|
*/
|
|
|
|
class SuperSignController extends ThinkController
|
|
|
|
{
|
|
|
|
public function lists($p = 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$page = intval($p);
|
|
|
|
$page = $page ? $page : 1; //默认显示第一页数据
|
|
|
|
$row=10;
|
|
|
|
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
|
|
|
|
|
|
|
|
$map =[];
|
|
|
|
if (I('account')) {
|
|
|
|
$map['tab_user.account'] = I('account');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (I('order_id')) {
|
|
|
|
$map['order_id'] = I('order_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (I('start')&&I('end')) {
|
|
|
|
$map['pay_time'] = ['between',[strtotime(I('start')),strtotime(I('end'))]];
|
|
|
|
} else if(I('start')&&!I('end')) {
|
|
|
|
$map['pay_time'] = ['egt',strtotime(I('start'))];
|
|
|
|
} else if (!I('start')&&I('end')) {
|
|
|
|
$map['pay_time'] = ['elt',strtotime(I('end'))];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (I('game_name')) {
|
|
|
|
$map['game_name'] = ['like',I('game_name').'%'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (I('promote_id')||I('promote_id')=='0') {
|
|
|
|
$map['tab_user.promote_id'] = I('promote_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
$map['tab_game_supersign.pay_status'] = 1;
|
|
|
|
|
|
|
|
$data = M('game_supersign','tab_')
|
|
|
|
->field("order_id,ticket,pay_time,tab_user.account,tab_game.game_name,tab_user.promote_account,pay_price")
|
|
|
|
->join("left join tab_user on tab_game_supersign.user_id = tab_user.id")
|
|
|
|
->join("left join tab_game on tab_game_supersign.game_id = tab_game.id")
|
|
|
|
->page($p, $row)
|
|
|
|
->where($map)
|
|
|
|
->select();
|
|
|
|
|
|
|
|
foreach ($data as $key => $Value) {
|
|
|
|
$data[$key]['pay_time'] = date('Y-m-d H:i:s',$Value['pay_time']);
|
|
|
|
}
|
|
|
|
|
|
|
|
$count = M('game_supersign','tab_')
|
|
|
|
->field("order_id,ticket,pay_time,tab_user.account,tab_game.game_name,tab_user.promote_account,pay_price")
|
|
|
|
->join("left join tab_user on tab_game_supersign.user_id = tab_user.id")
|
|
|
|
->join("left join tab_game on tab_game_supersign.game_id = tab_game.id")->where($map)->count();
|
|
|
|
|
|
|
|
$page = set_pagination($count, $row);
|
|
|
|
if ($page) {
|
|
|
|
$this->assign('_page', $page);
|
|
|
|
}
|
|
|
|
$this->m_title = '推广员列表';
|
|
|
|
$this->assign('data',$data);
|
|
|
|
$this->display();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|