管理后台新增功能添加
parent
58399f4c69
commit
fa393d9c90
@ -0,0 +1,73 @@
|
||||
<?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();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
namespace Admin\Controller;
|
||||
|
||||
|
||||
/**
|
||||
* 后台首页控制器
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
class TestWhiteListController 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['account'] = array('like',I('account').'%');
|
||||
}
|
||||
|
||||
$data = M('test_white_list','tab_')
|
||||
->page($p, $row)
|
||||
->where($map)
|
||||
->select();
|
||||
|
||||
foreach ($data as $key => $Value) {
|
||||
// $data[$key]['show_status'] = $data[$key]['show_status']?'显示':'锁定';
|
||||
$data[$key]['create_ime'] = date('Y-m-d H:i:s',$Value['create_ime']);
|
||||
}
|
||||
|
||||
$count = M('test_white_list','tab_')
|
||||
->where($map)
|
||||
->count();
|
||||
|
||||
$page = set_pagination($count, $row);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->m_title = '测试白名单';
|
||||
$this->assign('data',$data);
|
||||
$this->display();
|
||||
|
||||
}
|
||||
|
||||
public function add() {
|
||||
$this->m_title = '测试白名单添加';
|
||||
$this->assign('title','新增');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function edit() {
|
||||
$this->m_title = '测试白名单编辑';
|
||||
$this->assign('title','编辑');
|
||||
$this->display("add");
|
||||
}
|
||||
|
||||
public function edit_user() {
|
||||
$data = I('');
|
||||
|
||||
if (!$data['user_id']) {
|
||||
$this->error('请填写测试账号');
|
||||
}
|
||||
|
||||
$userData['account'] = $data['account'];
|
||||
|
||||
$user = M('user','tab_')->where(array('id'=>$data['user_id']))->find();
|
||||
|
||||
if (!$user) {
|
||||
$this->error('账号不存在');
|
||||
}
|
||||
$userData['check_status'] = $data['status']?$data['status']:0;
|
||||
|
||||
$userAdd = M('user','tab_')->where(array('id'=>$data['user_id']))->save($userData);
|
||||
if ($userAdd) {
|
||||
$whitedata['show_status'] = $data['status']?$data['status']:0;
|
||||
$whitedata['account'] = $data['account'];
|
||||
|
||||
$whiteList = M('test_white_list','tab_')->where(array('user_id'=>$data['user_id']))->save($whitedata);
|
||||
// echo M('test_white_list','tab_')->_sql();die();
|
||||
|
||||
if($whiteList) {
|
||||
$this->success('修改白名单成功',U('TestWhiteList/lists'));
|
||||
} else {
|
||||
$this->error('修改白名单失败');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->error('修改用户失败');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit_user1() {
|
||||
$data = $_GET;
|
||||
|
||||
if (!$data['user_id']) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>"请填写测试账号"]);
|
||||
}
|
||||
|
||||
$userData['account'] = $data['account'];
|
||||
|
||||
$user = M('user','tab_')->where(array('id'=>$data['user_id']))->find();
|
||||
|
||||
if (!$user) {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>"账号不存在"]);
|
||||
}
|
||||
$userData['check_status'] = $data['status']?$data['status']:0;
|
||||
|
||||
$userAdd = M('user','tab_')->where(array('id'=>$data['user_id']))->save($userData);
|
||||
if ($userAdd) {
|
||||
$whitedata['show_status'] = $data['status']?$data['status']:0;
|
||||
$whitedata['account'] = $data['account'];
|
||||
|
||||
$whiteList = M('test_white_list','tab_')->where(array('user_id'=>$data['user_id']))->save($whitedata);
|
||||
// echo M('test_white_list','tab_')->_sql();die();
|
||||
|
||||
if($whiteList) {
|
||||
$this->ajaxReturn(['status'=>1,'msg'=>"修改白名单成功"]);
|
||||
} else {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>"修改白名单成功"]);
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->ajaxReturn(['status'=>0,'msg'=>"修改用户失败"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function add_user() {
|
||||
$data = I('');
|
||||
|
||||
if (!$data['account']) {
|
||||
$this->error('请填写测试账号');
|
||||
}
|
||||
|
||||
$userData['account'] = $data['account'];
|
||||
|
||||
$user = M('user','tab_')->where($userData)->find();
|
||||
|
||||
if ($user) {
|
||||
$this->error('账号已经存在');
|
||||
}
|
||||
|
||||
$userData['password'] = md5(sha1('123456') . UC_AUTH_KEY);
|
||||
$userData['promote_id'] = 0;
|
||||
$userData['promote_account'] = '官方渠道';
|
||||
$userData['register_time'] = time();
|
||||
$userData['check_status'] = $data['status']?$data['status']:0;
|
||||
|
||||
$userAdd = M('user','tab_')->add($userData);
|
||||
if ($userAdd) {
|
||||
$data['user_id'] = $userAdd;
|
||||
$data['show_status'] = $data['status']?$data['status']:0;
|
||||
$data['add_user'] = $_SESSION['onethink_admin']['user_auth']['username'];
|
||||
$data['create_ime'] = time();
|
||||
|
||||
$whiteList = M('test_white_list','tab_')->add($data);
|
||||
if($whiteList) {
|
||||
$this->success('添加白名单成功',U('TestWhiteList/lists'));
|
||||
} else {
|
||||
$this->error('添加白名单失败');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->error('添加用户失败');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function freezeSupport() {
|
||||
$supportId = I('status');
|
||||
|
||||
$data = [
|
||||
'check_status' => $supportId
|
||||
];
|
||||
|
||||
$isFreeze = M('user','tab_')->where("id=".$supportId)->save($data);
|
||||
|
||||
if ($supportId == 1) {
|
||||
$msg = '启用';
|
||||
} else if ($supportId == 0) {
|
||||
$msg = '锁定';
|
||||
}
|
||||
|
||||
if ($isFreeze) {
|
||||
$this->ajaxReturn(['status'=>1, 'msg'=> $msg.'成功']);
|
||||
} else {
|
||||
$this->ajaxReturn(['status'=>0, 'msg'=> $msg.'失败']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
<extend name="Public/base" />
|
||||
|
||||
<block name="body">
|
||||
<!-- <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> -->
|
||||
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
|
||||
|
||||
|
||||
<div class="cf main-place top_nav_list navtab_list">
|
||||
<ul class="tabnav1711 fr jstabnav">
|
||||
<li data-tab="tab1" class="current"><a href="javascript:void(0);">基本信息</a></li></li>
|
||||
<li data-tab="tab2" ><a href="javascript:void(0);">结算信息</a></li>
|
||||
</ul>
|
||||
<h3 class="page_title">{$title}测试账号</h3>
|
||||
<!-- <p class="description_text">说明:此功是查看推广员的基础信息</p>-->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 标签页导航 -->
|
||||
<div class="tab-wrap">
|
||||
|
||||
<div class="tab-content tabcon1711">
|
||||
<!-- 表单 -->
|
||||
<if condition="$title eq '编辑'" >
|
||||
<form id="form" action="{:U('edit_user?model='.$model['id'])}" method="post" class="form-horizontal">
|
||||
<else />
|
||||
<form id="form" action="{:U('add_user?model='.$model['id'])}" method="post" class="form-horizontal">
|
||||
</if>
|
||||
|
||||
<!-- 基础文档模型 -->
|
||||
<div id="tab1" class="tab-pane in tab1">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">测试账号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="account" value="{$_REQUEST['account']}" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')">
|
||||
<input type="hidden" name="user_id" value="{$_REQUEST['user_id']}">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<td class="l">显示状态:</td>
|
||||
<td class="r table_radio">
|
||||
<span class="form_radio table_btn">
|
||||
<label >
|
||||
<input type="radio" value="1" name="status" <if condition="$_REQUEST['show_status'] eq 1">checked="checked"</if>>开启
|
||||
</label >
|
||||
<label >
|
||||
<input type="radio" value="0" name="status" <if condition="$_REQUEST['show_status'] eq 0">checked="checked"</if>>{:L('Lock')}
|
||||
</label>
|
||||
</span>
|
||||
<input type="hidden" name="status" id="status" value="{$data['status']}">
|
||||
<script>
|
||||
$(function () {
|
||||
var status = $('input:radio[name="status"]:checked').val();
|
||||
$('#status').val(status);
|
||||
});
|
||||
$(":radio").click(function () {
|
||||
var status = $('input:radio[name="status"]:checked').val();
|
||||
$('#status').val(status);
|
||||
})
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="form-item cf">
|
||||
<button class="submit_btn ajax-post mlspacing" id="submit" type="submit" target-form="form-horizontal">
|
||||
保存
|
||||
</button>
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back(-1);" >
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="common_settings">
|
||||
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
|
||||
<form class="addShortcutIcon">
|
||||
<input type="hidden" name="title" value="{$m_title}">
|
||||
<input type="hidden" name="url" value="Promote/lists/type/1">
|
||||
</form>
|
||||
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
||||
</div>
|
||||
|
||||
</block>
|
||||
|
||||
<block name="script">
|
||||
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
//导航高亮
|
||||
highlight_subnav('{:U('Promote/lists')}');
|
||||
Think.setValue("game_type_id", {$data.game_type_id|default = 0});
|
||||
Think.setValue("category", {$data.category|default = 0});
|
||||
Think.setValue("ba_id", {$data.ba_id|default = 0});
|
||||
|
||||
$(function(){
|
||||
// var pro="{:$data['bank_area']['0']}";
|
||||
// alert (pro);
|
||||
showTab();
|
||||
prov="{:substr($data['bank_area'],0,2)}";
|
||||
city="{:substr($data['bank_area'],2,2)}";
|
||||
ciarea="{:substr($data['bank_area'],4,2)}";
|
||||
//initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, prov, city, ciarea);
|
||||
});
|
||||
</script>
|
||||
</block>
|
||||
|
Loading…
Reference in New Issue