init: 从宝塔同步到 Gitea
This commit is contained in:
commit
e633c8e27d
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
# 运行时(日志+缓存 204M)
|
||||
/runtime/
|
||||
|
||||
# 依赖(从 composer.json 安装)
|
||||
/vendor/
|
||||
|
||||
# 备份压缩包
|
||||
*.tar.gz
|
||||
|
||||
# 环境配置
|
||||
.env
|
||||
|
||||
# 系统文件
|
||||
.DS_Store
|
||||
.user.ini
|
||||
*.swp
|
||||
Thumbs.db
|
||||
7
404.html
Normal file
7
404.html
Normal file
@ -0,0 +1,7 @@
|
||||
<html>
|
||||
<head><title>404 Not Found</title></head>
|
||||
<body>
|
||||
<center><h1>404 Not Found</h1></center>
|
||||
<hr><center>nginx</center>
|
||||
</body>
|
||||
</html>
|
||||
1
application/.htaccess
Normal file
1
application/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
deny from all
|
||||
297
application/admin/controller/Admin.php
Normal file
297
application/admin/controller/Admin.php
Normal file
@ -0,0 +1,297 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class Admin extends Common{
|
||||
public function index(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$username = Request::instance()->get('username');
|
||||
$status = Request::instance()->get('status');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['admin'] = array('like',"%".$username."%");
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$where['is_delete'] = 0;
|
||||
|
||||
if($export == 1){
|
||||
$admin_list = Db::name('admin')->where($where)->order('create_time desc')->select();
|
||||
}else{
|
||||
// 所有总台管理员列表
|
||||
$admin_list = Db::name('admin')->where($where)->order('create_time desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($admin_list as $k => $v){
|
||||
$v['last_login_time'] = date('Y-m-d H:i:s',$v['last_login_time']);
|
||||
$admin_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($admin_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($admin_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['admin'];
|
||||
$excelData[$k][1] = $v['mobile'];
|
||||
$excelData[$k][2] = $v['email'];
|
||||
$excelData[$k][3] = $v['last_login_ip'];
|
||||
$excelData[$k][4] = $v['last_login_time'];
|
||||
if($v['status'] == 1){
|
||||
$excelData[$k][5] = '正常';
|
||||
}else{
|
||||
$excelData[$k][5] = '锁定中';
|
||||
}
|
||||
}
|
||||
$title = array('用户名','电话','邮箱','最后登录IP','最后登录时间','状态');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '用户列表-'.$startDate."至".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '用户列表', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin_list',$admin_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 添加总台管理员页面
|
||||
public function admin_add(){
|
||||
return $this->fetch('admin-add');
|
||||
}
|
||||
|
||||
// 处理添加总台管理员
|
||||
public function do_admin_add(){
|
||||
// 接收提交过来的数据
|
||||
$username = Request::instance()->post('username');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$mobile = Request::instance()->post('mobile');
|
||||
$email = Request::instance()->post('email');
|
||||
$status = Request::instance()->post('status');
|
||||
$remarks = Request::instance()->post('remarks');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($username) && empty($username) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户名不能为空!']));
|
||||
}
|
||||
if( !isset($pass) && empty($pass) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码不能为空!']));
|
||||
}
|
||||
if( !isset($repass) && empty($repass) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'确认密码不能为空!']));
|
||||
}
|
||||
if( $repass != $pass ){
|
||||
die(json_encode(['code'=>0,'msg'=>'两次密码不一致!']));
|
||||
}
|
||||
|
||||
// 检测用户名是否已经被注册
|
||||
$user = Db::name('admin')->where('admin',$username)->find();
|
||||
if($user){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户已存在!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['admin'] = $username;
|
||||
$data['password'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['mobile'] = $mobile;
|
||||
$data['email'] = $email;
|
||||
$data['status'] = $status;
|
||||
$data['remark'] = $remarks;
|
||||
$data['is_delete'] = 0;
|
||||
$data['create_time'] = time();
|
||||
$insert_id = Db::name('admin')->insertGetId($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('添加管理员','添加管理员:| ID: '.$insert_id.' | 账号: '.$username);
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑管理员页面
|
||||
*/
|
||||
public function admin_edit()
|
||||
{
|
||||
// 接收代理ID,查询代理信息
|
||||
$id = Request::instance()->get('id');
|
||||
$admin = Db::name('admin')->find($id);
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin',$admin);
|
||||
return $this->fetch('/admin/admin-edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理修改管理员信息
|
||||
*/
|
||||
public function do_admin_edit()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$admin_id = Request::instance()->post('admin_id');
|
||||
$username = Request::instance()->post('username');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$mobile = Request::instance()->post('mobile');
|
||||
$email = Request::instance()->post('email');
|
||||
$remarks = Request::instance()->post('remarks');
|
||||
|
||||
//数据验证
|
||||
if(empty($username)){
|
||||
die(json_encode(['code'=>0,'msg'=>'账号不能为空!']));
|
||||
}
|
||||
if(!empty($pass) && strlen($pass) < 6){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码长度不能少于6位!']));
|
||||
}
|
||||
if(!empty($pass) && $pass != $repass){
|
||||
die(json_encode(['code'=>0,'msg'=>'两次密码输入不一致!']));
|
||||
}
|
||||
if( !isset($mobile) && empty($mobile) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'手机号码不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['admin'] = $username;
|
||||
if(!empty($pass)) $data['password'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['mobile'] = $mobile;
|
||||
$data['email'] = $email;
|
||||
$data['remark'] = $remarks;
|
||||
$data['update_time'] = time();
|
||||
|
||||
// 修改管理员资料
|
||||
$result = Db::name('admin')->where('id',$admin_id)->update($data);
|
||||
if($result){
|
||||
insertAdminLog('修改代理','修改代理:| ID: '.$admin_id.' | 账号:'.$username);
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户状态(锁定和解锁用户)
|
||||
*/
|
||||
public function change_status()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$user_id = Request::instance()->post('user_id');
|
||||
$status = Request::instance()->post('status');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($user_id) && empty($user_id) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户不能为空!']));
|
||||
}
|
||||
if( !isset($status) && empty($status) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'状态不能为空!']));
|
||||
}
|
||||
|
||||
// 修改用户状态
|
||||
$result = Db::name('admin')->where('id',$user_id)->update(['status'=>$status]);
|
||||
if($status == 1) $msg = "解锁";
|
||||
if($status == 0) $msg = "锁定";
|
||||
if($result){
|
||||
insertAdminLog($msg."代理",$msg."代理: | ID: ".$user_id);
|
||||
die(json_encode(['code'=>1,'msg'=>$msg.'成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>$msg.'失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除管理员
|
||||
*/
|
||||
public function admin_del()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$user_id = Request::instance()->post('user_id');
|
||||
|
||||
// 数据验证
|
||||
if(!$user_id){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户不存在']));
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
$result = Db::name('admin')->where('id',$user_id)->update(['is_delete'=>1]);
|
||||
if($result){
|
||||
insertAdminLog('删除代理',"删除代理: | ID: ".$user_id);
|
||||
die(json_encode(['code'=>1,'msg'=>'删除成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'删除失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function admin_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$username = Request::instance()->get('username');
|
||||
$status = Request::instance()->get('status');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
$where = array();
|
||||
if(!empty($username)) $where['admin'] = array('like',"%".$username."%");
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$where['is_delete'] = 0;
|
||||
$admin_list = Db::name('admin')->where($where)->order('create_time desc')->select();
|
||||
foreach($admin_list as $k => $v){
|
||||
$v['last_login_time'] = date('Y-m-d H:i:s',$v['last_login_time']);
|
||||
$admin_list[$k] = $v;
|
||||
}
|
||||
$this->assign('admin_list',$admin_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
1395
application/admin/controller/Agent.php
Executable file
1395
application/admin/controller/Agent.php
Executable file
File diff suppressed because it is too large
Load Diff
721
application/admin/controller/Apicloud.php
Normal file
721
application/admin/controller/Apicloud.php
Normal file
@ -0,0 +1,721 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use \think\Controller;
|
||||
use \think\Request;
|
||||
use \think\Db;
|
||||
use \think\Lang;
|
||||
use \think\Session;
|
||||
use \think\Log;
|
||||
|
||||
class Apicloud extends Controller{
|
||||
private function do_opening_dt($numberTab,$z){
|
||||
$game_id = $numberTab['game_id'];
|
||||
$table_id = $numberTab['table_id'];
|
||||
$table_info = Db::name('table')->where(array('id' => $table_id))->find();
|
||||
$boot_id = $numberTab['boot_id'];
|
||||
$opening = $z['result'];
|
||||
$pair = $z['pair'];
|
||||
$bets = Db::name('bet')->where(array('number_tab_id' => $numberTab['id']))->select();
|
||||
$oBets = $bets;
|
||||
if(!empty($oBets)){
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id'].' limit 1');
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
$vid = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('agent_commission')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('number_tab')->where(array('id' => $numberTab['id']))->limit(1)->update(array('result' => $opening));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $numberTab['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $numberTab['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $numberTab['id'];
|
||||
$retreated_log_data['number'] = $numberTab['number'];
|
||||
$str = '';
|
||||
if($numberTab['result'] == 1) $str = '龙';
|
||||
if($numberTab['result'] == 2) $str = '虎';
|
||||
if($numberTab['result'] == 3) $str = '和';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '龙';
|
||||
if($opening == 2) $nstr = '虎';
|
||||
if($opening == 3) $nstr = '和';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->where(array('id' => intval($v['user_id'])))->find();
|
||||
$agent_commission = $user_info['agent_commission_dt'] / 100;
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'];
|
||||
$win_money = 0;
|
||||
// 双边洗码
|
||||
$ximaliang = 0;
|
||||
if($user_info['type_xima'] == 1){
|
||||
$ximaliang = $v['banker_amount'] - $v['player_amount'];
|
||||
$ximaliang = abs($ximaliang);
|
||||
}
|
||||
// 龙赢
|
||||
if ($opening == 1) {
|
||||
if($v['banker_amount'] > 0){
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_dragon'] - $agent_commission),2) + $win_money;
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['player_amount'];
|
||||
}
|
||||
}
|
||||
// 虎赢
|
||||
if ($opening == 2 && $v['player_amount'] > 0) {
|
||||
$win_money = round($v['player_amount'] * (1 + $user_info['price_tiger'] - $agent_commission),2) + $win_money;
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['banker_amount'];
|
||||
}
|
||||
}
|
||||
// 和
|
||||
if ($opening == 3) {
|
||||
$win_money = $v['banker_amount'] + $v['player_amount'] + $win_money;
|
||||
$ximaliang = 0;
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + $user_info['price_tie_dt']) + $win_money;
|
||||
}
|
||||
}
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
if($v['result'] == 0){
|
||||
$money = $user_info['money'] + $win_total + $amount;
|
||||
}else{
|
||||
$money = $user_info['money'] + $win_total;
|
||||
}
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertV = $v;
|
||||
unset($insertV['id']);
|
||||
$insertBetData = $insertV;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
if($v['result'] > 0){
|
||||
$insertBetData['is_edit'] = 1;
|
||||
}else{
|
||||
$insertBetData['is_edit'] = 0;
|
||||
}
|
||||
$insertBetData['is_end'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']); //切割多个代理ID为数组
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
$nextMaliang = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
$maliang = 0;
|
||||
$ximalv = $user_path_info['agent_ximalv_dt'];
|
||||
$maliang_true = 0;
|
||||
if($ximalv > 0 && $ximaliang > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$maliang = round(($ximaliang * $ximalv) / 100,2);
|
||||
$maliang_true = $maliang;
|
||||
if($user_path_info['agent_cs'] > 0 && $user_path_info['share_xima'] == 2){
|
||||
$maliang_true = $maliang - round($maliang * ($user_path_info['agent_cs'] / 100),2);
|
||||
}
|
||||
$net_maliang = $maliang - $nextMaliang;
|
||||
$nextMaliang = $net_maliang + $nextMaliang;
|
||||
$insert_xima_sql = "INSERT INTO `cg_xima` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`sumday_id`,`day`,`number_tab_id`,`boot_id`,`ximaliang`,`ximalv`,`maliang`,`maliang_true`,`total`,`win_total`,`create_time`,`type`,`net_maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['sumday_id'].",'".$v['day']."',".$v['number_tab_id'].",".$v['boot_id'].",".$ximaliang.",".$ximalv.",".$maliang.",".$maliang_true.",".$amount.",".$win_total.",".$v['create_time'].",".$type.",".$net_maliang.")";
|
||||
Db::execute($insert_xima_sql);
|
||||
}
|
||||
//if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(round(($user_path_info['agent_cs'] * $win_total) / 100,2));
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$share_amount_true = round(to_number($maliang + $win_total) * ($user_path_info['agent_cs'] / 100),2);
|
||||
}else{
|
||||
$share_amount_true = $maliang;
|
||||
}
|
||||
$net_cs = $share_amount - $nextCs;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`,`maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".$v['create_time'].",".$type.",".$net_cs.",".$maliang.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
// 代理抽水
|
||||
if($opening == 1 && $v['banker_amount'] > 0 && $user_info['agent_commission'] > 0){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',2,'龙虎',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['banker_amount'].",".$agent_commission.",".$v['banker_amount'] * $agent_commission.",".$opening.",".$v['create_time'].")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
if($opening == 2 && $v['player_amount'] > 0 && $user_info['agent_commission'] > 0){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',2,'龙虎',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['player_amount'].",".$user_info['agent_commission'].",".$v['player_amount'] * $agent_commission.",".$opening.",".$v['create_time'].")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private function do_opening_baccarat_win6($numberTab,$z){
|
||||
$game_id = $numberTab['game_id'];
|
||||
$table_id = $numberTab['table_id'];
|
||||
$boot_id = $numberTab['boot_id'];
|
||||
$opening = $z['result'];
|
||||
$pair = $z['pair'];
|
||||
$win6 = $z['win6'];
|
||||
$bets = Db::name('bet')->where(array('number_tab_id' => $numberTab['id'], 'status' => 1))->select();
|
||||
$oBets = $bets;
|
||||
if(!empty($oBets)){
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id'].' limit 1');
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('number_tab')->where(array('id' => $numberTab['id']))->limit(1)->update(array('result' => $opening, 'pair' => $pair, 'win6' => $win6));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $numberTab['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $numberTab['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $number_tab_id;
|
||||
$retreated_log_data['number'] = $numberTab['number'];
|
||||
$str = '';
|
||||
if($numberTab['result'] == 1) $str = '庄';
|
||||
if($numberTab['result'] == 2) $str = '闲';
|
||||
if($numberTab['result'] == 3) $str = '和';
|
||||
if($numberTab['pair'] == 1) $str = $str.'-庄对';
|
||||
if($numberTab['pair'] == 2) $str = $str.'-闲对';
|
||||
if($numberTab['pair'] == 3) $str = $str.'-庄闲对';
|
||||
if($numberTab['win6'] == 1) $str = $str.'-赢6';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '庄';
|
||||
if($opening == 2) $nstr = '闲';
|
||||
if($opening == 3) $nstr = '和';
|
||||
if($pair == 1) $nstr = $nstr.'-庄对';
|
||||
if($pair == 2) $nstr = $nstr.'-闲对';
|
||||
if($pair == 3) $nstr = $nstr.'-庄闲对';
|
||||
if($isWin6 == 1) $nstr = $nstr.'-赢6';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->field(array('id','money','agent_parent_id_path'))->where(array('id' => intval($v['user_id'])))->find();
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'] + $v['banker_pair_amount'] + $v['player_pair_amount'];
|
||||
$win_money = 0;
|
||||
$BPT_ximaliang = 0;
|
||||
if($opening == 1){
|
||||
// 庄赢
|
||||
if($v['banker_amount'] > 0){
|
||||
if($isWin6 === 1){
|
||||
$win_money = $v['banker_amount'] * (1 + 0.5) + $win_money;
|
||||
}else{
|
||||
$win_money = $v['banker_amount'] * (1 + 1) + $win_money;
|
||||
}
|
||||
}
|
||||
$BPT_ximaliang = $v['player_amount'] + $v['tie_amount'];
|
||||
}elseif($opening == 2){
|
||||
// 闲赢
|
||||
if($v['player_amount'] > 0){
|
||||
if($isWin6 === 1){
|
||||
$win_money = $v['player_amount'] * (1 + 0.5) + $win_money;
|
||||
}else{
|
||||
$win_money = $v['player_amount'] * (1 + 1) + $win_money;
|
||||
}
|
||||
}
|
||||
$BPT_ximaliang = $v['banker_amount'] + $v['tie_amount'];
|
||||
}elseif($opening == 3) {
|
||||
// 和赢
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + 8) + $win_money;
|
||||
}
|
||||
// 开 和,下注庄和闲不扣钱
|
||||
if($v['banker_amount'] > 0 && $v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $v['banker_amount'] + $win_money;
|
||||
}elseif($v['banker_amount'] > 0){
|
||||
$win_money = $v['banker_amount'] + $win_money;
|
||||
} elseif ($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $win_money;
|
||||
}
|
||||
}
|
||||
if($pair == 3){
|
||||
// 计算庄对下注的赢钱金额
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
//计算闲对下注的赢钱金额
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
}elseif($pair == 1){
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
}elseif($pair == 2){
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
}
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
if($v['result'] == 0){
|
||||
$money = $user_info['money'] + $win_total + $amount;
|
||||
}else{
|
||||
$money = $user_info['money'] + $win_total;
|
||||
}
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertV = $v;
|
||||
unset($insertV['id']);
|
||||
$insertBetData = $insertV;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['pair'] = $pair;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
if($v['result'] > 0){
|
||||
$insertBetData['is_edit'] = 1;
|
||||
}else{
|
||||
$insertBetData['is_edit'] = 0;
|
||||
}
|
||||
$insertBetData['is_end'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']); //切割多个代理ID为数组
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(($user_path_info['agent_cs'] * $win_total) / 100);
|
||||
$share_amount_true = 0;
|
||||
$net_cs = $share_amount - $share_amount;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".time().",".$type.",".$net_cs.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private function do_opening_baccarat($numberTab,$z){
|
||||
$game_id = $numberTab['game_id'];
|
||||
$table_id = $numberTab['table_id'];
|
||||
$table_info = Db::name('table')->where(array('id' => $table_id))->find();
|
||||
$boot_id = $numberTab['boot_id'];
|
||||
$opening = $z['result'];
|
||||
$pair = $z['pair'];
|
||||
$bets = Db::name('bet')->where(array('number_tab_id' => $numberTab['id'], 'status' => 1))->select();
|
||||
$oBets = $bets;
|
||||
if(!empty($oBets)){
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id'].' limit 1');
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('agent_commission')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $numberTab['id']))->delete();
|
||||
Db::name('number_tab')->where(array('id' => $numberTab['id']))->limit(1)->update(array('result' => $opening, 'pair' => $pair));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $numberTab['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $numberTab['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $numberTab['id'];
|
||||
$retreated_log_data['number'] = $numberTab['number'];
|
||||
$str = '';
|
||||
if($numberTab['result'] == 1) $str = '庄';
|
||||
if($numberTab['result'] == 2) $str = '闲';
|
||||
if($numberTab['result'] == 3) $str = '和';
|
||||
if($numberTab['pair'] == 1) $str = $str.'-庄对';
|
||||
if($numberTab['pair'] == 2) $str = $str.'-闲对';
|
||||
if($numberTab['pair'] == 3) $str = $str.'-庄闲对';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '庄';
|
||||
if($opening == 2) $nstr = '闲';
|
||||
if($opening == 3) $nstr = '和';
|
||||
if($pair == 1) $nstr = $nstr.'-庄对';
|
||||
if($pair == 2) $nstr = $nstr.'-闲对';
|
||||
if($pair == 3) $nstr = $nstr.'-庄闲对';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->where(array('id' => intval($v['user_id'])))->find();
|
||||
$agent_commission = $user_info['agent_commission'] / 100;
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'] + $v['banker_pair_amount'] + $v['player_pair_amount'];
|
||||
$win_money = 0;
|
||||
// 双边洗码
|
||||
$ximaliang = 0;
|
||||
if($user_info['type_xima'] == 1){
|
||||
$ximaliang = $v['banker_amount'] - $v['player_amount'];
|
||||
$ximaliang = abs($ximaliang);
|
||||
}
|
||||
if($opening == 1){
|
||||
// 庄赢
|
||||
if($v['banker_amount'] > 0){
|
||||
if($table_info['mode'] == 1){
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_banker'] - $agent_commission),2) + $win_money;
|
||||
}else{
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_banker']),2) + $win_money;
|
||||
}
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['player_amount'];
|
||||
}
|
||||
}elseif($opening == 2){
|
||||
// 闲赢
|
||||
if($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] * (1 + $user_info['price_player']) + $win_money;
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['banker_amount'];
|
||||
}
|
||||
}elseif($opening == 3) {
|
||||
$ximaliang = 0;
|
||||
// 和赢
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + $user_info['price_tie_baccarat']) + $win_money;
|
||||
}
|
||||
// 开 和,下注庄和闲不扣钱
|
||||
if($v['banker_amount'] > 0 && $v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $v['banker_amount'] + $win_money;
|
||||
}elseif($v['banker_amount'] > 0){
|
||||
$win_money = $v['banker_amount'] + $win_money;
|
||||
} elseif ($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $win_money;
|
||||
}
|
||||
}
|
||||
if($pair == 3){
|
||||
// 计算庄对下注的赢钱金额
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
//计算闲对下注的赢钱金额
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}elseif($pair == 1){
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}elseif($pair == 2){
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
if($v['result'] == 0){
|
||||
$money = $user_info['money'] + $win_total + $amount;
|
||||
}else{
|
||||
$money = $user_info['money'] + $win_total;
|
||||
}
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertV = $v;
|
||||
unset($insertV['id']);
|
||||
$insertBetData = $insertV;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['pair'] = $pair;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
if($v['result'] > 0){
|
||||
$insertBetData['is_edit'] = 1;
|
||||
}else{
|
||||
$insertBetData['is_edit'] = 0;
|
||||
}
|
||||
$insertBetData['is_end'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入码率表及cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']);
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
$nextMaliang = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
$maliang = 0;
|
||||
$ximalv = $user_path_info['agent_ximalv'];
|
||||
$maliang_true = 0;
|
||||
if($ximalv > 0 && $ximaliang > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$maliang = round(($ximaliang * $ximalv) / 100,2);
|
||||
$maliang_true = $maliang;
|
||||
if($user_path_info['agent_cs'] > 0 && $user_path_info['share_xima'] == 2){
|
||||
$maliang_true = $maliang - round($maliang * ($user_path_info['agent_cs'] / 100),2);
|
||||
}
|
||||
$net_maliang = $maliang - $nextMaliang;
|
||||
$nextMaliang = $net_maliang + $nextMaliang;
|
||||
$insert_xima_sql = "INSERT INTO `cg_xima` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`sumday_id`,`day`,`number_tab_id`,`boot_id`,`ximaliang`,`ximalv`,`maliang`,`maliang_true`,`total`,`win_total`,`create_time`,`type`,`net_maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['sumday_id'].",'".$v['day']."',".$v['number_tab_id'].",".$v['boot_id'].",".$ximaliang.",".$ximalv.",".$maliang.",".$maliang_true.",".$amount.",".$win_total.",".$v['create_time'].",".$type.",".$net_maliang.")";
|
||||
Db::execute($insert_xima_sql);
|
||||
}
|
||||
//if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(($user_path_info['agent_cs'] * $win_total) / 100);
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$share_amount_true = round(to_number($maliang + $win_total) * ($user_path_info['agent_cs'] / 100),2);
|
||||
}else{
|
||||
$share_amount_true = $maliang;
|
||||
}
|
||||
$net_cs = $share_amount - $nextCs;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`,`maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".$v['create_time'].",".$type.",".$net_cs.",".$maliang.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
// 代理抽水
|
||||
if($opening == 1 && $v['banker_amount'] > 0 && $user_info['agent_commission'] > 0 ){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`pair`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',1,'百家乐',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['banker_amount'].",".$user_info['agent_commission'].",".$v['banker_amount'] * $agent_commission.",".$opening.",".$pair.",".$v['create_time'].")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public function get_number_tab_id(){
|
||||
if(Request::instance()->isPost()){
|
||||
$table_id = intval(Request::instance()->post('online_table_id'));
|
||||
$table_token = Request::instance()->post('table_token');
|
||||
$local_day = Request::instance()->post('day');
|
||||
$local_boot_num = intval(Request::instance()->post('boot_num'));
|
||||
$local_number = intval(Request::instance()->post('number'));
|
||||
if($table_id > 0 && $local_day && $local_boot_num > 0 && $local_number > 0){
|
||||
$table = Db::name('table')->where(array('id' => $table_id))->find();
|
||||
$game_id = $table['game_id'];
|
||||
if($game_id == 1){
|
||||
$bootTableName = 'boot';
|
||||
$numberTabTableName = 'number_tab';
|
||||
$betTableName = 'bet';
|
||||
}elseif($game_id == 2){
|
||||
$bootTableName = 'boot';
|
||||
$numberTabTableName = 'number_tab';
|
||||
$betTableName = 'bet';
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'game_error'));
|
||||
}
|
||||
if($table['table_token'] == $table_token){
|
||||
$lastNumberTab = Db::name($numberTabTableName)->where(array('table_id' => $table_id))->order('id DESC')->find();
|
||||
//var_dump($local_day);
|
||||
//echo "<br>";
|
||||
//var_dump($local_boot_num);
|
||||
//echo "<br>";
|
||||
//var_dump($local_number);
|
||||
//echo "<br>";
|
||||
//echo "<pre>";
|
||||
//var_dump($lastNumberTab);
|
||||
//echo "</pre>";
|
||||
if($lastNumberTab){
|
||||
if($local_day == $lastNumberTab['day'] && $lastNumberTab['boot_num'] == $local_boot_num && $lastNumberTab['number'] == $local_number){
|
||||
return json(array('Success' => 1, 'lastNumberTabId' => $lastNumberTab['id']));
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'bet_status_error'));
|
||||
}
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'not_number_tab'));
|
||||
}
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'table_error'));
|
||||
}
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'post_error'));
|
||||
}
|
||||
}
|
||||
}
|
||||
public function sync_data(){
|
||||
if(Request::instance()->isPost()){
|
||||
$post = Request::instance()->post();
|
||||
$data = unserialize($post['data']);
|
||||
$localTable = $data['table'];
|
||||
$localSumday = $data['sumday'];
|
||||
$localBoot = $data['boot'];
|
||||
$localNumberTab = $data['number_tab'];
|
||||
$online_table_id = intval($localTable['online_table_id']);
|
||||
$onlineTable = Db::name('table')->where(array('id' => $online_table_id))->find();
|
||||
$game_id = intval($onlineTable['game_id']);
|
||||
if($game_id == 1){
|
||||
$bootTableName = 'boot';
|
||||
$numberTabTableName = 'number_tab';
|
||||
$betTableName = 'bet';
|
||||
}elseif($game_id == 2){
|
||||
$bootTableName = 'boot';
|
||||
$numberTabTableName = 'number_tab';
|
||||
$betTableName = 'bet';
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'no_table_info'));
|
||||
}
|
||||
/*
|
||||
echo "<pre>";
|
||||
print_r($localTable);
|
||||
print_r($localSumday);
|
||||
print_r($localBoot);
|
||||
print_r($localNumberTab);
|
||||
echo "</pre>";
|
||||
exit();
|
||||
*/
|
||||
if($onlineTable && $onlineTable['table_token'] == $localTable['table_token']){
|
||||
foreach($localSumday AS $k => $v){
|
||||
$onlineSumday = Db::name('sumday')->where(array('table_id' => $online_table_id, 'day' => $v['day']))->find();
|
||||
if($onlineSumday){
|
||||
$lastOnlineSumdayID = $onlineSumday['id'];
|
||||
$localSumdayID = $v['id'];
|
||||
unset($v['id']);
|
||||
$v['table_id'] = $online_table_id;
|
||||
$v['table_name'] = $onlineTable['table_name'];
|
||||
Db::name('sumday')->where(array('id' => $onlineSumday['id']))->update($v);
|
||||
foreach($localBoot AS $key => $value){
|
||||
if($value['sumday_id'] == $localSumdayID){
|
||||
$boot = Db::name($bootTableName)->where(array('table_id' => $online_table_id, 'sumday_id' => $lastOnlineSumdayID, 'boot_num' => $value['boot_num']))->find();
|
||||
$localBootID = $value['id'];
|
||||
unset($value['id']);
|
||||
$value['table_id'] = $online_table_id;
|
||||
$value['table_name'] = $onlineTable['table_name'];
|
||||
$value['sumday_id'] = $lastOnlineSumdayID;
|
||||
if($boot){
|
||||
Db::name($bootTableName)->where(array('id' => $boot['id']))->limit(1)->update($value);
|
||||
foreach($localNumberTab AS $j => $z){
|
||||
if($z['boot_id'] == $localBootID){
|
||||
$numberTab = Db::name($numberTabTableName)->where(array('table_id' => $online_table_id, 'sumday_id' => $lastOnlineSumdayID, 'boot_id' => $boot['id'], 'number' => $z['number']))->find();
|
||||
unset($z['id']);
|
||||
unset($z['is_delete']);
|
||||
unset($z['is_edit']);
|
||||
if(isset($z['lucky_six'])){
|
||||
unset($z['lucky_six']);
|
||||
}
|
||||
if(isset($z['lucky_six_number'])){
|
||||
unset($z['lucky_six_number']);
|
||||
}
|
||||
unset($z['is_edit']);
|
||||
$z['table_id'] = $online_table_id;
|
||||
$z['table_name'] = $onlineTable['table_name'];
|
||||
$z['sumday_id'] = $lastOnlineSumdayID;
|
||||
$z['boot_id'] = $boot['id'];
|
||||
if($numberTab){
|
||||
Db::name($numberTabTableName)->where(array('id' => $numberTab['id']))->limit(1)->update($z);
|
||||
//var_dump($numberTab);
|
||||
//判断是否需要处理开结果
|
||||
if($game_id == 1){
|
||||
if($z['bet_status'] == 3 && ($numberTab['result'] != $z['result'] || $numberTab['pair'] != $z['pair'])){
|
||||
if($onlineTable['mode'] == 2){
|
||||
$this->do_opening_baccarat_win6($numberTab,$z);
|
||||
}else{
|
||||
$this->do_opening_baccarat($numberTab,$z);
|
||||
}
|
||||
}
|
||||
}elseif($game_id == 2){
|
||||
if($z['bet_status'] == 3 && $numberTab['result'] != $z['result']){
|
||||
$this->do_opening_dt($numberTab,$z);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$insertNumberTabID = Db::name($numberTabTableName)->insertGetId($z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$insertBootID = Db::name($bootTableName)->insertGetId($value);
|
||||
foreach($localNumberTab AS $j => $z){
|
||||
if($z['boot_id'] == $localBootID){
|
||||
unset($z['id']);
|
||||
unset($z['is_delete']);
|
||||
unset($z['is_edit']);
|
||||
if(isset($z['lucky_six'])){
|
||||
unset($z['lucky_six']);
|
||||
}
|
||||
if(isset($z['lucky_six_number'])){
|
||||
unset($z['lucky_six_number']);
|
||||
}
|
||||
$z['table_id'] = $online_table_id;
|
||||
$z['table_name'] = $onlineTable['table_name'];
|
||||
$z['sumday_id'] = $lastOnlineSumdayID;
|
||||
$z['boot_id'] = $insertBootID;
|
||||
$insertNumberTabID = Db::name($numberTabTableName)->insertGetId($z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$localSumdayID = $v['id'];
|
||||
unset($v['id']);
|
||||
$v['table_id'] = $online_table_id;
|
||||
$v['table_name'] = $onlineTable['table_name'];
|
||||
$insertSumdayID = Db::name('sumday')->insertGetId($v);
|
||||
foreach($localBoot AS $key => $value){
|
||||
if($value['sumday_id'] == $localSumdayID){
|
||||
$localBootID = $value['id'];
|
||||
unset($value['id']);
|
||||
$value['table_id'] = $online_table_id;
|
||||
$value['table_name'] = $onlineTable['table_name'];
|
||||
$value['sumday_id'] = $insertSumdayID;
|
||||
$insertBootID = Db::name($bootTableName)->insertGetId($value);
|
||||
foreach($localNumberTab AS $j => $z){
|
||||
if($z['boot_id'] == $localBootID){
|
||||
unset($z['id']);
|
||||
unset($z['is_delete']);
|
||||
unset($z['is_edit']);
|
||||
if(isset($z['lucky_six'])){
|
||||
unset($z['lucky_six']);
|
||||
}
|
||||
if(isset($z['lucky_six_number'])){
|
||||
unset($z['lucky_six_number']);
|
||||
}
|
||||
$z['table_id'] = $online_table_id;
|
||||
$z['table_name'] = $onlineTable['table_name'];
|
||||
$z['sumday_id'] = $insertSumdayID;
|
||||
$z['boot_id'] = $insertBootID;
|
||||
$insertNumberTabID = Db::name($numberTabTableName)->insertGetId($z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return json(array('Success' => 1, 'Msg' => 'sync_success'));
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => 'no_table_info'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
554
application/admin/controller/Betinfo.php
Executable file
554
application/admin/controller/Betinfo.php
Executable file
@ -0,0 +1,554 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use \think\Controller;
|
||||
use \think\Request;
|
||||
use \think\Db;
|
||||
use \think\Lang;
|
||||
use \think\Session;
|
||||
use \think\Log;
|
||||
|
||||
class Betinfo extends Controller{
|
||||
// 下注细分 百家乐
|
||||
public function betDetailBaccarat($flag,$v,$number_info,$user_info){
|
||||
if($flag == 1){
|
||||
$price = $user_info['price_banker'];
|
||||
$betType = '庄';
|
||||
$amountColumn = 'banker_amount';
|
||||
}elseif($flag == 2){
|
||||
$price = $user_info['price_player'];
|
||||
$betType = '闲';
|
||||
$amountColumn = 'player_amount';
|
||||
}elseif($flag == 3){
|
||||
$price = $user_info['price_tie_baccarat'];
|
||||
$betType = '和';
|
||||
$amountColumn = 'tie_amount';
|
||||
} elseif($flag == 4){
|
||||
$price = $user_info['price_pair'];
|
||||
$betType = '庄对';
|
||||
$amountColumn = 'banker_pair_amount';
|
||||
} elseif($flag == 5){
|
||||
$price = $user_info['price_pair'];
|
||||
$betType = '闲对';
|
||||
$amountColumn = 'player_pair_amount';
|
||||
}else{
|
||||
return $v;
|
||||
}
|
||||
|
||||
// 下注细分重组
|
||||
if($v[$amountColumn] > 0){
|
||||
$v[$amountColumn] = intval($v[$amountColumn]);
|
||||
$v['bet_type'] = $betType;
|
||||
$v['bet_amount'] = $v[$amountColumn];
|
||||
$v['bet_amount_all'] = $v[$amountColumn];
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($flag >= 1 && $flag <= 3 && $v['result'] == $flag){
|
||||
$v['win'] = round($v[$amountColumn] * $price,2);
|
||||
}elseif($flag >= 4 && $flag <= 5 && $v['pair'] == $flag){
|
||||
$v['win'] = round($v[$amountColumn] * $price,2);
|
||||
}else{
|
||||
$v['win'] = to_number(round($v[$amountColumn],2));
|
||||
}
|
||||
}else{
|
||||
$v['win'] = 0;
|
||||
}
|
||||
return $v;
|
||||
}
|
||||
}
|
||||
// 下注细分 龙虎
|
||||
public function betDetailDt($flag,$v,$number_info,$user_info){
|
||||
if($flag == 1){
|
||||
$price = $user_info['price_banker'];
|
||||
$betType = '庄';
|
||||
$amountColumn = 'banker_amount';
|
||||
}elseif($flag == 2){
|
||||
$price = $user_info['price_player'];
|
||||
$betType = '闲';
|
||||
$amountColumn = 'player_amount';
|
||||
}elseif($flag == 3){
|
||||
$price = $user_info['price_tie_dt'];
|
||||
$betType = '和';
|
||||
$amountColumn = 'tie_amount';
|
||||
}else{
|
||||
return $v;
|
||||
}
|
||||
|
||||
// 下注细分重组
|
||||
if($v[$amountColumn] > 0){
|
||||
$v[$amountColumn] = intval($v[$amountColumn]);
|
||||
$v['bet_type'] = $betType;
|
||||
$v['bet_amount'] = $v[$amountColumn];
|
||||
$v['bet_amount_all'] = $v[$amountColumn];
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($flag >= 1 && $flag <= 3 && $v['result'] == $flag){
|
||||
$v['win'] = round($v[$amountColumn] * $price,2);
|
||||
}else{
|
||||
$v['win'] = to_number(round($v[$amountColumn],2));
|
||||
}
|
||||
}else{
|
||||
$v['win'] = 0;
|
||||
}
|
||||
return $v;
|
||||
}
|
||||
}
|
||||
// 牛牛翻倍赔率判断
|
||||
public function getPrice($isWin,$num,$number_info,$user_info){
|
||||
if($isWin == 1){
|
||||
$winPoint = $number_info['result_player_'.$num];
|
||||
}else{
|
||||
$winPoint = $number_info['result_banker'];
|
||||
}
|
||||
if($winPoint >= 7 && $winPoint <= 9){
|
||||
$price = $user_info['price_n7_n9'];
|
||||
}elseif($winPoint == 10){
|
||||
$price = $user_info['price_nn'];
|
||||
}elseif($winPoint == 11){
|
||||
$price = $user_info['price_5n'];
|
||||
}elseif($winPoint == 12){
|
||||
$price = $user_info['price_bomb'];
|
||||
}else{
|
||||
$price = 1;
|
||||
}
|
||||
return $price;
|
||||
}
|
||||
// 下注细分 牛牛
|
||||
public function betDetailNn($flag,$v,$number_info,$user_info,$card_info){
|
||||
if($flag == 1){
|
||||
$result = '闲1';
|
||||
$price = 1;
|
||||
$betType = '闲1';
|
||||
$amountColumn = 'amount_player_1';
|
||||
$resultColumn = 'result_player_1';
|
||||
$winColumn = 'win_player_1';
|
||||
}elseif($flag == 2){
|
||||
$result = '闲1';
|
||||
$price = $this->getPrice($number_info['win_player_1'],1,$number_info,$user_info);
|
||||
$betType = '闲1翻倍';
|
||||
$amountColumn = 'amount_player_1_times';
|
||||
$resultColumn = 'result_player_1';
|
||||
$withholdColumn = 'withhold_player_1_times';
|
||||
$winColumn = 'win_player_1';
|
||||
}elseif($flag == 3){
|
||||
$result = '闲1';
|
||||
$price = 1;
|
||||
$betType = '庄(闲1)';
|
||||
$amountColumn = 'amount_player_1_banker';
|
||||
$resultColumn = 'result_player_1';
|
||||
$winColumn = 'win_player_1';
|
||||
}elseif($flag == 4){
|
||||
$result = '闲1';
|
||||
$price = $this->getPrice($number_info['win_player_1'],1,$number_info,$user_info);
|
||||
$betType = '庄(闲1)翻倍';
|
||||
$amountColumn = 'amount_player_1_banker_times';
|
||||
$resultColumn = 'result_player_1';
|
||||
$withholdColumn = 'withhold_player_1_banker_times';
|
||||
$winColumn = 'win_player_1';
|
||||
}elseif($flag == 5){
|
||||
$result = '闲2';
|
||||
$price = 1;
|
||||
$betType = '闲2';
|
||||
$amountColumn = 'amount_player_2';
|
||||
$resultColumn = 'result_player_2';
|
||||
$winColumn = 'win_player_2';
|
||||
}elseif($flag == 6){
|
||||
$result = '闲2';
|
||||
$price = $this->getPrice($number_info['win_player_2'],2,$number_info,$user_info);
|
||||
$betType = '闲2翻倍';
|
||||
$amountColumn = 'amount_player_2_times';
|
||||
$resultColumn = 'result_player_2';
|
||||
$withholdColumn = 'withhold_player_2_times';
|
||||
$winColumn = 'win_player_2';
|
||||
}elseif($flag == 7){
|
||||
$result = '闲2';
|
||||
$price = 1;
|
||||
$betType = '庄(闲2)';
|
||||
$amountColumn = 'amount_player_2_banker';
|
||||
$resultColumn = 'result_player_2';
|
||||
$winColumn = 'win_player_2';
|
||||
}elseif($flag == 8){
|
||||
$result = '闲2';
|
||||
$price = $this->getPrice($number_info['win_player_2'],2,$number_info,$user_info);
|
||||
$betType = '庄(闲2)翻倍';
|
||||
$amountColumn = 'amount_player_2_banker_times';
|
||||
$resultColumn = 'result_player_2';
|
||||
$withholdColumn = 'withhold_player_2_banker_times';
|
||||
$winColumn = 'win_player_2';
|
||||
}elseif($flag == 9){
|
||||
$result = '闲3';
|
||||
$price = 1;
|
||||
$betType = '闲3';
|
||||
$amountColumn = 'amount_player_3';
|
||||
$resultColumn = 'result_player_3';
|
||||
$winColumn = 'win_player_3';
|
||||
}elseif($flag == 10){
|
||||
$result = '闲3';
|
||||
$price = $this->getPrice($number_info['win_player_3'],3,$number_info,$user_info);
|
||||
$betType = '闲3翻倍';
|
||||
$amountColumn = 'amount_player_3_times';
|
||||
$resultColumn = 'result_player_3';
|
||||
$withholdColumn = 'withhold_player_3_times';
|
||||
$winColumn = 'win_player_3';
|
||||
}elseif($flag == 11){
|
||||
$result = '闲3';
|
||||
$price = 1;
|
||||
$betType = '庄(闲3)';
|
||||
$amountColumn = 'amount_player_3_banker';
|
||||
$resultColumn = 'result_player_3';
|
||||
$winColumn = 'win_player_3';
|
||||
}elseif($flag == 12){
|
||||
$result = '闲3';
|
||||
$price = $this->getPrice($number_info['win_player_3'],3,$number_info,$user_info);
|
||||
$betType = '庄(闲3)翻倍';
|
||||
$amountColumn = 'amount_player_3_banker_times';
|
||||
$resultColumn = 'result_player_3';
|
||||
$withholdColumn = 'withhold_player_3_banker_times';
|
||||
$winColumn = 'win_player_3';
|
||||
}else{
|
||||
return $v;
|
||||
}
|
||||
|
||||
// 下注细分重组
|
||||
if($v[$amountColumn] > 0){
|
||||
$v[$amountColumn] = intval($v[$amountColumn]);
|
||||
if($card_info && $card_info['status'] == 2){
|
||||
$v['card_result'] = '';
|
||||
$v['card_result'] .= '庄:'.interchange_nn($number_info['result_banker']).' '.$result.':'.interchange_nn($number_info[$resultColumn]).' ';
|
||||
if($number_info[$winColumn] == 1 ){
|
||||
$v['card_result'] .= $result.'赢';
|
||||
}else{
|
||||
$v['card_result'] .= '庄赢';
|
||||
}
|
||||
}else{
|
||||
$v['card_result'] = '';
|
||||
}
|
||||
$v['bet_type'] = $betType;
|
||||
$v['bet_amount'] = $v[$amountColumn];
|
||||
if($flag % 2 == 0){
|
||||
$v['bet_amount_all'] = $v[$amountColumn] + intval($v[$withholdColumn]);
|
||||
}else{
|
||||
$v['bet_amount_all'] = $v[$amountColumn];
|
||||
}
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($number_info[$winColumn] == 1){
|
||||
$v['win'] = round($v[$amountColumn] * $price * 0.95, 2);
|
||||
}else{
|
||||
$v['win'] = to_number(round($v[$amountColumn] * $price,2));
|
||||
}
|
||||
}else{
|
||||
$v['win'] = 0;
|
||||
}
|
||||
|
||||
return $v;
|
||||
}
|
||||
}
|
||||
public function record(){
|
||||
// 用于分页和搜索查询的数据
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
// 获取验证信息
|
||||
$token = Request::instance()->get('token');
|
||||
if($token != 'SGv9OOO4um53o9ZTW90AK0lk3rGaEq8FyANMiqlLSZymnOCfI76yHRGeJibvHwmgwieegkggyvh1Vs1jpQg9dAVsE7bipEiJ0By'){
|
||||
echo '非法操作';
|
||||
die;
|
||||
}
|
||||
$user_id = Request::instance()->get('user_id');
|
||||
if($user_id <= 0) {
|
||||
echo '用户ID错误';
|
||||
die;
|
||||
}
|
||||
$user_info = Db::name('user')->where('id',$user_id)->find();
|
||||
if(!$user_info){
|
||||
echo '用户不存在';
|
||||
die;
|
||||
}
|
||||
// 接收参数
|
||||
$game_id = Request::instance()->get('game_id');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
|
||||
// 查询日期处理
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'),time());
|
||||
$get['startDate'] = date('Y-m-d',time());
|
||||
$this->assign('get',$get);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate) + 24*60*60 - 1;
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d',time());
|
||||
$this->assign('get',$get);
|
||||
}
|
||||
|
||||
// 查询数据条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['user_id'] = $user_info['id'];
|
||||
if($game_id == 1 || $game_id == 2 || $game_id == 4){
|
||||
$betWhere['game_id'] = $game_id;
|
||||
}else{
|
||||
$betWhere['game_id'] = 1;
|
||||
$game_id = 1;
|
||||
$get['game_id'] = 1;
|
||||
$this->assign('get',$get);
|
||||
}
|
||||
// 查询注单信息
|
||||
if($game_id == 1){
|
||||
$bet = Db::name('bet')->where($betWhere)->order('id desc')->select();
|
||||
$betAmount = Db::name('bet')->where($betWhere)->sum('amount');
|
||||
$allAmount = Db::name('bet')->where($betWhere)->sum('amount');
|
||||
$allWinTotal = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
}elseif($game_id == 2){
|
||||
$bet = Db::name('bet_dt')->where($betWhere)->order('id desc')->select();
|
||||
$betAmount = Db::name('bet_dt')->where($betWhere)->sum('amount');
|
||||
$allAmount = Db::name('bet_dt')->where($betWhere)->sum('amount');
|
||||
$allWinTotal = Db::name('bet_dt')->where($betWhere)->sum('win_total');
|
||||
}elseif($game_id == 4){
|
||||
$bet = Db::name('bet_nn')->where($betWhere)->order('id desc')->select();
|
||||
// 下注金额
|
||||
$betAmount = Db::name('bet_nn')->where($betWhere)->sum('amount');
|
||||
// 扣除的金额( 包含预扣 )
|
||||
$allAmount = Db::name('bet_nn')->where($betWhere)->sum('amount');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_1_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_1_banker_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_2_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_2_banker_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_3_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_3_banker_times');
|
||||
// 总赢
|
||||
$allWinTotal = Db::name('bet_nn')->where($betWhere)->sum('win_total');
|
||||
}else{
|
||||
echo '游戏类型错误!';die;
|
||||
}
|
||||
// 组装注单信息
|
||||
$newBet = array();
|
||||
foreach($bet AS $k => $v){
|
||||
$v['create_time'] = date('Y-m-d',$v['create_time']);
|
||||
$v['game_nume'] = $v['game_id'].'-'.$v['boot_num'].'-'.$v['number'];
|
||||
|
||||
if($game_id == 1){
|
||||
$number_info = Db::name('number_tab')->where('id',$v['number_tab_id'])->find();
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($v['result'] == 1){
|
||||
$result = '庄赢';
|
||||
}elseif($v['result'] == 2){
|
||||
$result = '闲赢';
|
||||
}elseif($v['result'] == 3){
|
||||
$result = '和';
|
||||
}else{
|
||||
$result = '-';
|
||||
}
|
||||
if($v['pair'] == 1){
|
||||
$pair = ',庄对';
|
||||
}elseif($v['pair'] == 2){
|
||||
$pair = ',闲对';
|
||||
}elseif($v['pair'] == 3){
|
||||
$pair = ',庄闲对';
|
||||
}else{
|
||||
$pair = '';
|
||||
}
|
||||
$v['card_result'] = $result.$pair;
|
||||
}else{
|
||||
$v['card_result'] = '-';
|
||||
}
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=5; $i++){
|
||||
$result = $this->betDetailBaccarat($i,$v,$number_info,$user_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
}elseif($game_id == 2){
|
||||
$number_info = Db::name('number_tab')->where('id',$v['number_tab_id'])->find();
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($v['result'] == 1){
|
||||
$result = '龙赢';
|
||||
}elseif($v['result'] == 2){
|
||||
$result = '虎赢';
|
||||
}elseif($v['result'] == 3){
|
||||
$result = '和';
|
||||
}
|
||||
$v['card_result'] = $result;
|
||||
}else{
|
||||
$v['card_result'] = '';
|
||||
}
|
||||
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=3; $i++){
|
||||
$result = $this->betDetailDt($i,$v,$number_info,$user_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
|
||||
}elseif($game_id == 4){
|
||||
$card_info = Db::name('card_nn')->where('number_tab_id',$v['number_tab_id'])->find();
|
||||
$number_info = Db::name('number_tab')->where('id',$v['number_tab_id'])->find();
|
||||
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=12; $i++){
|
||||
$result = $this->betDetailNn($i,$v,$number_info,$user_info,$card_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重新赋值
|
||||
$bet = $newBet;
|
||||
// 渲染参数和模板
|
||||
$this->assign('bet',$bet);
|
||||
$this->assign('betAmount',$betAmount);
|
||||
$this->assign('allAmount',$allAmount);
|
||||
$this->assign('allWinTotal',$allWinTotal);
|
||||
$this->assign('user_info',$user_info);
|
||||
return $this->fetch();
|
||||
}
|
||||
// 下注记录(ajax刷新)
|
||||
public function recordAjax(){
|
||||
// 登录信息
|
||||
$user_id = Request::instance()->post('user_id');
|
||||
$user_info = Db::name('user')->where('id',$user_id)->find();
|
||||
|
||||
// 接收参数
|
||||
$game_id = Request::instance()->post('game_id');
|
||||
$startDate = Request::instance()->post('startDate');
|
||||
$endDate = Request::instance()->post('endDate');
|
||||
|
||||
// 查询日期处理
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'),time());
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate) + 24*60*60 - 1;
|
||||
}else{
|
||||
$endTime = time();
|
||||
}
|
||||
|
||||
// 查询数据条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['user_id'] = $user_info['id'];
|
||||
if($game_id == 1 || $game_id == 2 || $game_id == 4){
|
||||
$betWhere['game_id'] = $game_id;
|
||||
}else{
|
||||
$betWhere['game_id'] = 1;
|
||||
$game_id = 1;
|
||||
$get['game_id'] = 1;
|
||||
$this->assign('get',$get);
|
||||
}
|
||||
// 查询注单信息
|
||||
if($game_id == 1){
|
||||
$bet = Db::name('bet')->where($betWhere)->order('id desc')->select();
|
||||
$betAmount = Db::name('bet')->where($betWhere)->sum('amount');
|
||||
$allAmount = Db::name('bet')->where($betWhere)->sum('amount');
|
||||
$allWinTotal = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
}elseif($game_id == 2){
|
||||
$bet = Db::name('bet_dt')->where($betWhere)->order('id desc')->select();
|
||||
$betAmount = Db::name('bet_dt')->where($betWhere)->sum('amount');
|
||||
$allAmount = Db::name('bet_dt')->where($betWhere)->sum('amount');
|
||||
$allWinTotal = Db::name('bet_dt')->where($betWhere)->sum('win_total');
|
||||
}elseif($game_id == 4){
|
||||
$bet = Db::name('bet_nn')->where($betWhere)->order('id desc')->select();
|
||||
// 下注金额
|
||||
$betAmount = Db::name('bet_nn')->where($betWhere)->sum('amount');
|
||||
// 扣除的金额( 包含预扣 )
|
||||
$allAmount = Db::name('bet_nn')->where($betWhere)->sum('amount');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_1_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_1_banker_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_2_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_2_banker_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_3_times');
|
||||
$allAmount += Db::name('bet_nn')->where($betWhere)->sum('withhold_player_3_banker_times');
|
||||
// 总赢
|
||||
$allWinTotal = Db::name('bet_nn')->where($betWhere)->sum('win_total');
|
||||
}else{
|
||||
echo '游戏类型错误!';die;
|
||||
}
|
||||
// 组装注单信息
|
||||
$newBet = array();
|
||||
foreach($bet AS $k => $v){
|
||||
$v['create_time'] = date('Y-m-d',$v['create_time']);
|
||||
$v['game_nume'] = $v['game_id'].'-'.$v['boot_num'].'-'.$v['number'];
|
||||
|
||||
if($game_id == 1){
|
||||
$number_info = Db::name('number_tab')->where('id',$v['number_tab_id'])->find();
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($v['result'] == 1){
|
||||
$result = '庄赢';
|
||||
}elseif($v['result'] == 2){
|
||||
$result = '闲赢';
|
||||
}elseif($v['result'] == 3){
|
||||
$result = '和';
|
||||
}else{
|
||||
$result = '-';
|
||||
}
|
||||
if($v['pair'] == 1){
|
||||
$pair = ',庄对';
|
||||
}elseif($v['pair'] == 2){
|
||||
$pair = ',闲对';
|
||||
}elseif($v['pair'] == 3){
|
||||
$pair = ',庄闲对';
|
||||
}else{
|
||||
$pair = '';
|
||||
}
|
||||
$v['card_result'] = $result.$pair;
|
||||
}else{
|
||||
$v['card_result'] = '-';
|
||||
}
|
||||
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=5; $i++){
|
||||
$result = $this->betDetailBaccarat($i,$v,$number_info,$user_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
}elseif($game_id == 2){
|
||||
$number_info = Db::name('number_tab')->where('id',$v['number_tab_id'])->find();
|
||||
if($number_info['bet_status'] == 3){
|
||||
if($v['result'] == 1){
|
||||
$result = '龙赢';
|
||||
}elseif($v['result'] == 2){
|
||||
$result = '虎赢';
|
||||
}elseif($v['result'] == 3){
|
||||
$result = '和';
|
||||
}
|
||||
$v['card_result'] = $result;
|
||||
}else{
|
||||
$v['card_result'] = '';
|
||||
}
|
||||
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=3; $i++){
|
||||
$result = $this->betDetailDt($i,$v,$number_info,$user_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
|
||||
}elseif($game_id == 4){
|
||||
$card_info = Db::name('card_nn')->where('number_tab_id',$v['number_tab_id'])->find();
|
||||
$number_info = Db::name('number_tab_nn')->where('id',$v['number_tab_id'])->find();
|
||||
|
||||
// 下注金额细分
|
||||
for($i=1; $i<=12; $i++){
|
||||
$result = $this->betDetailNn($i,$v,$number_info,$user_info,$card_info);
|
||||
if($result){
|
||||
$newBet[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重新赋值
|
||||
$bet = $newBet;
|
||||
// 返回数据
|
||||
return ['code'=>1,'bet'=>$bet,'betAmount'=>$betAmount,'allAmount'=>$allAmount,'allWinTotal'=>$allWinTotal];
|
||||
}
|
||||
}
|
||||
463
application/admin/controller/Chat.php
Executable file
463
application/admin/controller/Chat.php
Executable file
@ -0,0 +1,463 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
/**
|
||||
* 客服管理控制器
|
||||
* Class Chat
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class Chat extends Common
|
||||
{
|
||||
/**
|
||||
* 客服工作台
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$user_info = Session::get('user_info');
|
||||
$admin_id = $user_info['id'];
|
||||
|
||||
// 从数据库获取最新的login_token(避免session中没有的情况)
|
||||
$admin = Db::name('admin')->where('id', $admin_id)->field('login_token')->find();
|
||||
$login_token = $admin['login_token'] ?? '';
|
||||
|
||||
// 如果没有login_token,生成一个新的
|
||||
if (empty($login_token)) {
|
||||
$login_token = md5($admin_id . time() . uniqid());
|
||||
Db::name('admin')->where('id', $admin_id)->update(['login_token' => $login_token]);
|
||||
}
|
||||
|
||||
// 获取客服配置
|
||||
$admin_status = Db::name('chat_admin_status')->where('admin_id', $admin_id)->find();
|
||||
if (!$admin_status) {
|
||||
// 创建默认配置
|
||||
Db::name('chat_admin_status')->insert([
|
||||
'admin_id' => $admin_id,
|
||||
'max_sessions' => 10,
|
||||
'is_enabled' => 1,
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
$admin_status = ['max_sessions' => 10, 'is_enabled' => 1];
|
||||
}
|
||||
|
||||
$this->assign('admin_status', $admin_status);
|
||||
$this->assign('admin_id', $admin_id);
|
||||
$this->assign('login_token', $login_token);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会话列表 (AJAX)
|
||||
*/
|
||||
public function sessions()
|
||||
{
|
||||
$user_info = Session::get('user_info');
|
||||
$admin_id = $user_info['id'];
|
||||
$status = Request::instance()->get('status', 1); // 默认进行中
|
||||
|
||||
$where = ['admin_id' => $admin_id];
|
||||
if ($status !== 'all') {
|
||||
$where['status'] = (int)$status;
|
||||
}
|
||||
|
||||
$sessions = Db::name('chat_session')
|
||||
->where($where)
|
||||
->order('last_msg_time desc, create_time desc')
|
||||
->select();
|
||||
|
||||
foreach ($sessions as &$session) {
|
||||
// 获取用户信息
|
||||
$user = Db::name('user')->where('id', $session['user_id'])->find();
|
||||
$session['user_info'] = [
|
||||
'username' => $user['username'] ?? '',
|
||||
'nickname' => $user['nickname'] ?? $user['username'] ?? '',
|
||||
'money' => $user['money'] ?? 0,
|
||||
];
|
||||
|
||||
// 未读消息数
|
||||
$session['unread_count'] = Db::name('chat_message')
|
||||
->where('session_id', $session['id'])
|
||||
->where('sender_type', 1) // 用户发送
|
||||
->where('status', '<', 3) // 未读
|
||||
->count();
|
||||
|
||||
// 格式化时间
|
||||
$session['create_time_fmt'] = date('Y-m-d H:i:s', $session['create_time']);
|
||||
$session['last_msg_time_fmt'] = $session['last_msg_time'] ? date('H:i', $session['last_msg_time']) : '';
|
||||
|
||||
// 来源
|
||||
$sourceMap = [1 => 'PC', 2 => 'Game', 3 => 'Portal'];
|
||||
$session['source_name'] = $sourceMap[$session['source']] ?? 'Unknown';
|
||||
}
|
||||
|
||||
return json(['code' => 0, 'data' => $sessions]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待分配会话列表 (AJAX)
|
||||
*/
|
||||
public function pending()
|
||||
{
|
||||
$sessions = Db::name('chat_session')
|
||||
->where('status', 0) // 待分配
|
||||
->order('create_time asc')
|
||||
->select();
|
||||
|
||||
foreach ($sessions as &$session) {
|
||||
$user = Db::name('user')->where('id', $session['user_id'])->find();
|
||||
$session['user_info'] = [
|
||||
'username' => $user['username'] ?? '',
|
||||
'nickname' => $user['nickname'] ?? $user['username'] ?? '',
|
||||
'money' => $user['money'] ?? 0,
|
||||
];
|
||||
$session['create_time_fmt'] = date('Y-m-d H:i:s', $session['create_time']);
|
||||
$sourceMap = [1 => 'PC', 2 => 'Game', 3 => 'Portal'];
|
||||
$session['source_name'] = $sourceMap[$session['source']] ?? 'Unknown';
|
||||
}
|
||||
|
||||
return json(['code' => 0, 'data' => $sessions]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息历史 (AJAX)
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
$session_id = Request::instance()->get('session_id');
|
||||
$last_id = Request::instance()->get('last_id', 0);
|
||||
$limit = Request::instance()->get('limit', 50);
|
||||
|
||||
if (!$session_id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
$query = Db::name('chat_message')->where('session_id', $session_id);
|
||||
if ($last_id > 0) {
|
||||
$query->where('id', '<', $last_id);
|
||||
}
|
||||
|
||||
$messages = $query->order('id desc')->limit($limit)->select();
|
||||
$messages = array_reverse($messages); // 按时间正序
|
||||
|
||||
foreach ($messages as &$msg) {
|
||||
$msg['create_time_fmt'] = date('H:i:s', $msg['create_time']);
|
||||
}
|
||||
|
||||
return json(['code' => 0, 'data' => $messages]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束会话 (AJAX)
|
||||
*/
|
||||
public function endSession()
|
||||
{
|
||||
$session_id = Request::instance()->post('session_id');
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
if (!$session_id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
$session = Db::name('chat_session')->where('id', $session_id)->find();
|
||||
if (!$session || $session['admin_id'] != $user_info['id']) {
|
||||
return json(['code' => 1, 'msg' => '无权操作']);
|
||||
}
|
||||
|
||||
Db::name('chat_session')->where('id', $session_id)->update([
|
||||
'status' => 2,
|
||||
'end_time' => time(),
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
insertAdminLog('结束客服会话', '会话ID: ' . $session_id);
|
||||
|
||||
return json(['code' => 0, 'msg' => '操作成功']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动接入会话 (AJAX)
|
||||
*/
|
||||
public function acceptSession()
|
||||
{
|
||||
$session_id = Request::instance()->post('session_id');
|
||||
$user_info = Session::get('user_info');
|
||||
$admin_id = $user_info['id'];
|
||||
|
||||
if (!$session_id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
// 检查会话是否存在且状态为待分配
|
||||
$session = Db::name('chat_session')->where('id', $session_id)->find();
|
||||
if (!$session) {
|
||||
return json(['code' => 1, 'msg' => '会话不存在']);
|
||||
}
|
||||
if ($session['status'] != 0) {
|
||||
return json(['code' => 1, 'msg' => '该会话已被接入']);
|
||||
}
|
||||
|
||||
// 检查客服当前会话数是否已满
|
||||
$admin_status = Db::name('chat_admin_status')->where('admin_id', $admin_id)->find();
|
||||
$max_sessions = $admin_status['max_sessions'] ?? 10;
|
||||
$current_sessions = Db::name('chat_session')
|
||||
->where('admin_id', $admin_id)
|
||||
->where('status', 1)
|
||||
->count();
|
||||
|
||||
if ($current_sessions >= $max_sessions) {
|
||||
return json(['code' => 1, 'msg' => '已达最大会话数限制(' . $max_sessions . ')']);
|
||||
}
|
||||
|
||||
// 接入会话
|
||||
$result = Db::name('chat_session')->where('id', $session_id)->where('status', 0)->update([
|
||||
'admin_id' => $admin_id,
|
||||
'status' => 1,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
if ($result) {
|
||||
insertAdminLog('接入客服会话', '会话ID: ' . $session_id);
|
||||
return json(['code' => 0, 'msg' => '接入成功']);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => '接入失败,可能已被其他客服接入']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转接会话 (AJAX)
|
||||
*/
|
||||
public function transfer()
|
||||
{
|
||||
$session_id = Request::instance()->post('session_id');
|
||||
$target_admin_id = Request::instance()->post('target_admin_id');
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
if (!$session_id || !$target_admin_id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
$session = Db::name('chat_session')->where('id', $session_id)->find();
|
||||
if (!$session || $session['admin_id'] != $user_info['id']) {
|
||||
return json(['code' => 1, 'msg' => '无权操作']);
|
||||
}
|
||||
|
||||
Db::name('chat_session')->where('id', $session_id)->update([
|
||||
'admin_id' => $target_admin_id,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
insertAdminLog('转接客服会话', '会话ID: ' . $session_id . ', 转接给: ' . $target_admin_id);
|
||||
|
||||
return json(['code' => 0, 'msg' => '转接成功']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取在线客服列表 (AJAX)
|
||||
*/
|
||||
public function onlineAgents()
|
||||
{
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
// 获取启用客服功能的管理员
|
||||
$agents = Db::name('chat_admin_status')
|
||||
->alias('s')
|
||||
->join('admin a', 'a.id = s.admin_id')
|
||||
->where('s.is_enabled', 1)
|
||||
->where('a.id', '<>', $user_info['id'])
|
||||
->field('a.id, a.admin as username, a.admin as nickname, s.max_sessions')
|
||||
->select();
|
||||
|
||||
return json(['code' => 0, 'data' => $agents]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天记录查询
|
||||
*/
|
||||
public function record()
|
||||
{
|
||||
$get = Request::instance()->get();
|
||||
$this->assign('get', $get);
|
||||
|
||||
$username = Request::instance()->get('username');
|
||||
$admin_id = Request::instance()->get('admin_id');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
$where = [];
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
if ($startDate) $startTime = strtotime($startDate);
|
||||
if ($endDate) $endTime = strtotime($endDate) + 86400;
|
||||
$where['s.create_time'] = ['between', [$startTime, $endTime]];
|
||||
|
||||
if ($admin_id) {
|
||||
$where['s.admin_id'] = $admin_id;
|
||||
}
|
||||
|
||||
$query = Db::name('chat_session')
|
||||
->alias('s')
|
||||
->join('user u', 'u.id = s.user_id', 'left')
|
||||
->join('admin a', 'a.id = s.admin_id', 'left')
|
||||
->where($where);
|
||||
|
||||
if ($username) {
|
||||
$query->where('u.username', 'like', "%{$username}%");
|
||||
}
|
||||
|
||||
if ($export == 1) {
|
||||
$list = $query->field('s.*, u.username, u.nickname as user_nickname, a.admin as admin_username')
|
||||
->order('s.create_time desc')
|
||||
->select();
|
||||
|
||||
$excelData = [];
|
||||
foreach ($list as $k => $v) {
|
||||
$excelData[$k][0] = $v['id'];
|
||||
$excelData[$k][1] = $v['username'];
|
||||
$excelData[$k][2] = $v['admin_username'] ?? '未分配';
|
||||
$excelData[$k][3] = ['PC', 'Game', 'Portal'][$v['source'] - 1] ?? '';
|
||||
$excelData[$k][4] = ['待分配', '进行中', '已结束'][$v['status']] ?? '';
|
||||
$excelData[$k][5] = $v['rating'] ?? '-';
|
||||
$excelData[$k][6] = date('Y-m-d H:i:s', $v['create_time']);
|
||||
$excelData[$k][7] = $v['end_time'] ? date('Y-m-d H:i:s', $v['end_time']) : '-';
|
||||
}
|
||||
$title = ['会话ID', '用户名', '客服', '来源', '状态', '评分', '开始时间', '结束时间'];
|
||||
$this->exportExcelCore($excelData, '聊天记录-' . date('Ymd'), $title);
|
||||
exit;
|
||||
}
|
||||
|
||||
$list = $query->field('s.*, u.username, u.nickname as user_nickname, a.admin as admin_username')
|
||||
->order('s.create_time desc')
|
||||
->paginate(15, false, ['query' => $get]);
|
||||
|
||||
// 获取客服列表
|
||||
$admins = Db::name('admin')->where('status', 1)->field('id, admin as username, admin as nickname')->select();
|
||||
|
||||
$this->assign('list', $list);
|
||||
$this->assign('admins', $admins);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看会话详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$session_id = Request::instance()->get('session_id');
|
||||
|
||||
$session = Db::name('chat_session')
|
||||
->alias('s')
|
||||
->join('user u', 'u.id = s.user_id', 'left')
|
||||
->join('admin a', 'a.id = s.admin_id', 'left')
|
||||
->where('s.id', $session_id)
|
||||
->field('s.*, u.username, u.nickname as user_nickname, u.money, a.admin as admin_username')
|
||||
->find();
|
||||
|
||||
if (!$session) {
|
||||
$this->error('会话不存在');
|
||||
}
|
||||
|
||||
$messages = Db::name('chat_message')
|
||||
->where('session_id', $session_id)
|
||||
->order('id asc')
|
||||
->select();
|
||||
|
||||
$this->assign('session', $session);
|
||||
$this->assign('messages', $messages);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 客服统计
|
||||
*/
|
||||
public function stats()
|
||||
{
|
||||
$user_info = Session::get('user_info');
|
||||
$admin_id = Request::instance()->get('admin_id', $user_info['id']);
|
||||
$startDate = Request::instance()->get('startDate', date('Y-m-d', strtotime('-7 days')));
|
||||
$endDate = Request::instance()->get('endDate', date('Y-m-d'));
|
||||
|
||||
$startTime = strtotime($startDate);
|
||||
$endTime = strtotime($endDate) + 86400;
|
||||
|
||||
$where = [
|
||||
'admin_id' => $admin_id,
|
||||
'create_time' => ['between', [$startTime, $endTime]],
|
||||
];
|
||||
|
||||
// 统计数据
|
||||
$stats = [
|
||||
'total_sessions' => Db::name('chat_session')->where($where)->count(),
|
||||
'ended_sessions' => Db::name('chat_session')->where($where)->where('status', 2)->count(),
|
||||
'avg_rating' => Db::name('chat_session')->where($where)->whereNotNull('rating')->avg('rating') ?: 0,
|
||||
'total_messages' => Db::name('chat_message')
|
||||
->alias('m')
|
||||
->join('chat_session s', 's.id = m.session_id')
|
||||
->where('s.admin_id', $admin_id)
|
||||
->where('m.create_time', 'between', [$startTime, $endTime])
|
||||
->count(),
|
||||
];
|
||||
|
||||
$this->assign('stats', $stats);
|
||||
$this->assign('startDate', $startDate);
|
||||
$this->assign('endDate', $endDate);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快捷回复列表 (AJAX)
|
||||
*/
|
||||
public function quickReplies()
|
||||
{
|
||||
$category = Request::instance()->get('category');
|
||||
|
||||
$query = Db::name('chat_quick_reply')->where('status', 1);
|
||||
if ($category) {
|
||||
$query->where('category', $category);
|
||||
}
|
||||
|
||||
$list = $query->order('sort asc, id asc')->select();
|
||||
$categories = Db::name('chat_quick_reply')
|
||||
->where('status', 1)
|
||||
->whereNotNull('category')
|
||||
->where('category', '<>', '')
|
||||
->group('category')
|
||||
->column('category');
|
||||
|
||||
return json(['code' => 0, 'data' => $list, 'categories' => $categories]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
public function upload()
|
||||
{
|
||||
$file = Request::instance()->file('image');
|
||||
if (!$file) {
|
||||
return json(['code' => 1, 'msg' => '请选择文件']);
|
||||
}
|
||||
|
||||
// 验证文件
|
||||
$info = $file->validate([
|
||||
'size' => 2097152, // 2MB
|
||||
'ext' => 'jpg,png,gif,jpeg'
|
||||
])->move(ROOT_PATH . 'public/uploads/chat/' . date('Ymd'));
|
||||
|
||||
if ($info) {
|
||||
$url = '/uploads/chat/' . date('Ymd') . '/' . $info->getSaveName();
|
||||
return json(['code' => 0, 'url' => $url]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
228
application/admin/controller/ChatQuickReply.php
Executable file
228
application/admin/controller/ChatQuickReply.php
Executable file
@ -0,0 +1,228 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
/**
|
||||
* 快捷回复管理控制器
|
||||
* Class ChatQuickReply
|
||||
* @package app\admin\controller
|
||||
*/
|
||||
class ChatQuickReply extends Common
|
||||
{
|
||||
/**
|
||||
* 快捷回复列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$get = Request::instance()->get();
|
||||
$this->assign('get', $get);
|
||||
|
||||
$category = Request::instance()->get('category');
|
||||
$status = Request::instance()->get('status');
|
||||
|
||||
$where = [];
|
||||
if ($category) {
|
||||
$where['category'] = $category;
|
||||
}
|
||||
if ($status !== null && $status !== '') {
|
||||
$where['status'] = (int)$status;
|
||||
}
|
||||
|
||||
$list = Db::name('chat_quick_reply')
|
||||
->where($where)
|
||||
->order('sort asc, id desc')
|
||||
->paginate(15, false, ['query' => $get]);
|
||||
|
||||
// 获取分类列表
|
||||
$categories = Db::name('chat_quick_reply')
|
||||
->whereNotNull('category')
|
||||
->where('category', '<>', '')
|
||||
->group('category')
|
||||
->column('category');
|
||||
|
||||
$this->assign('list', $list);
|
||||
$this->assign('categories', $categories);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加快捷回复
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (Request::instance()->isPost()) {
|
||||
$data = Request::instance()->post();
|
||||
|
||||
// 验证
|
||||
if (empty($data['title'])) {
|
||||
$this->error('标题不能为空');
|
||||
}
|
||||
if (empty($data['content'])) {
|
||||
$this->error('内容不能为空');
|
||||
}
|
||||
|
||||
$insertData = [
|
||||
'category' => $data['category'] ?? null,
|
||||
'title' => $data['title'],
|
||||
'content' => $data['content'],
|
||||
'sort' => (int)($data['sort'] ?? 0),
|
||||
'status' => (int)($data['status'] ?? 1),
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
];
|
||||
|
||||
$result = Db::name('chat_quick_reply')->insert($insertData);
|
||||
|
||||
if ($result) {
|
||||
insertAdminLog('添加快捷回复', '标题: ' . $data['title']);
|
||||
$this->success('添加成功', '/chat_quick_reply/index');
|
||||
} else {
|
||||
$this->error('添加失败');
|
||||
}
|
||||
}
|
||||
|
||||
// 获取分类列表
|
||||
$categories = Db::name('chat_quick_reply')
|
||||
->whereNotNull('category')
|
||||
->where('category', '<>', '')
|
||||
->group('category')
|
||||
->column('category');
|
||||
|
||||
$this->assign('categories', $categories);
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑快捷回复
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$id = Request::instance()->param('id');
|
||||
|
||||
if (Request::instance()->isPost()) {
|
||||
$data = Request::instance()->post();
|
||||
|
||||
// 验证
|
||||
if (empty($data['title'])) {
|
||||
$this->error('标题不能为空');
|
||||
}
|
||||
if (empty($data['content'])) {
|
||||
$this->error('内容不能为空');
|
||||
}
|
||||
|
||||
$updateData = [
|
||||
'category' => $data['category'] ?? null,
|
||||
'title' => $data['title'],
|
||||
'content' => $data['content'],
|
||||
'sort' => (int)($data['sort'] ?? 0),
|
||||
'status' => (int)($data['status'] ?? 1),
|
||||
'update_time' => time(),
|
||||
];
|
||||
|
||||
$result = Db::name('chat_quick_reply')->where('id', $id)->update($updateData);
|
||||
|
||||
if ($result !== false) {
|
||||
insertAdminLog('编辑快捷回复', 'ID: ' . $id);
|
||||
$this->success('修改成功', '/chat_quick_reply/index');
|
||||
} else {
|
||||
$this->error('修改失败');
|
||||
}
|
||||
}
|
||||
|
||||
$info = Db::name('chat_quick_reply')->where('id', $id)->find();
|
||||
if (!$info) {
|
||||
$this->error('记录不存在');
|
||||
}
|
||||
|
||||
// 获取分类列表
|
||||
$categories = Db::name('chat_quick_reply')
|
||||
->whereNotNull('category')
|
||||
->where('category', '<>', '')
|
||||
->group('category')
|
||||
->column('category');
|
||||
|
||||
$this->assign('info', $info);
|
||||
$this->assign('categories', $categories);
|
||||
|
||||
return $this->fetch('add');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除快捷回复
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$id = Request::instance()->param('id');
|
||||
|
||||
if (!$id) {
|
||||
$this->error('参数错误');
|
||||
}
|
||||
|
||||
$info = Db::name('chat_quick_reply')->where('id', $id)->find();
|
||||
if (!$info) {
|
||||
$this->error('记录不存在');
|
||||
}
|
||||
|
||||
$result = Db::name('chat_quick_reply')->where('id', $id)->delete();
|
||||
|
||||
if ($result) {
|
||||
insertAdminLog('删除快捷回复', 'ID: ' . $id . ', 标题: ' . $info['title']);
|
||||
$this->success('删除成功');
|
||||
} else {
|
||||
$this->error('删除失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$id = Request::instance()->post('id');
|
||||
$status = Request::instance()->post('status');
|
||||
|
||||
if (!$id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
$result = Db::name('chat_quick_reply')->where('id', $id)->update([
|
||||
'status' => (int)$status,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
if ($result !== false) {
|
||||
return json(['code' => 0, 'msg' => '操作成功']);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => '操作失败']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排序
|
||||
*/
|
||||
public function sort()
|
||||
{
|
||||
$id = Request::instance()->post('id');
|
||||
$sort = Request::instance()->post('sort');
|
||||
|
||||
if (!$id) {
|
||||
return json(['code' => 1, 'msg' => '参数错误']);
|
||||
}
|
||||
|
||||
$result = Db::name('chat_quick_reply')->where('id', $id)->update([
|
||||
'sort' => (int)$sort,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
if ($result !== false) {
|
||||
return json(['code' => 0, 'msg' => '操作成功']);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => '操作失败']);
|
||||
}
|
||||
}
|
||||
}
|
||||
86
application/admin/controller/Common.php
Executable file
86
application/admin/controller/Common.php
Executable file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Session;
|
||||
use think\Loader;
|
||||
use think\Request;
|
||||
|
||||
class Common extends Controller{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$user_info = Session::get('user_info');
|
||||
$this->assign('user_info',$user_info);
|
||||
if(empty($user_info)){
|
||||
$this->redirect('/login/index',302);
|
||||
exit();
|
||||
}
|
||||
//角色判断
|
||||
$request= Request::instance();
|
||||
$curContrller = $request->controller();
|
||||
$curAction = $request->action();
|
||||
//监控角色可以访问的页面
|
||||
$jiankongController = array(
|
||||
'Index',
|
||||
'Waybill',
|
||||
'Game',
|
||||
'Memo',
|
||||
'Info',
|
||||
'Log',
|
||||
'Login',
|
||||
'Chat',
|
||||
'ChatQuickReply',
|
||||
);
|
||||
if($user_info['role'] == 1){
|
||||
if(!in_array($curContrller, $jiankongController)){
|
||||
die('您没有权限访问该页面');
|
||||
}
|
||||
}
|
||||
$dlController = array(
|
||||
'Info',
|
||||
'Index',
|
||||
'Agent',
|
||||
'Login',
|
||||
'Chat',
|
||||
'ChatQuickReply',
|
||||
);
|
||||
if($user_info['role'] == 2){
|
||||
if(!in_array($curContrller, $dlController)){
|
||||
die('您没有权限访问该页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*+----------------------------------------------------------
|
||||
* 输出Excel函数
|
||||
*+----------------------------------------------------------
|
||||
* @param string $data 数据
|
||||
*+----------------------------------------------------------
|
||||
*/
|
||||
public function exportExcelCore($data,$savefile=null,$title=null,$sheetname='sheet1'){
|
||||
$z = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
|
||||
Loader::import('PHPExcel.PHPExcel');
|
||||
Loader::import('PHPExcel.PHPExcel.IOFactory.PHPExcel_IOFactory');
|
||||
$PHPExcel = new \PHPExcel();
|
||||
$PHPSheet = $PHPExcel->getActiveSheet();
|
||||
$PHPSheet->setTitle('报表'); //给当前活动sheet设置名称
|
||||
//设置行头
|
||||
$num = 1;
|
||||
foreach($title AS $key => $value){
|
||||
$PHPSheet->setCellValue($z[$key].$num,$value);
|
||||
}
|
||||
$n = 2;
|
||||
foreach($data AS $k => $v){
|
||||
foreach($v AS $k2 => $v2){
|
||||
$PHPSheet->setCellValue($z[$k2].$n,$v2);
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
$PHPWriter = \PHPExcel_IOFactory::createWriter($PHPExcel,"Excel5");
|
||||
header('Content-Disposition: attachment;filename="'.$savefile.'.xls"');
|
||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
$PHPWriter->save("php://output"); //表示在$path路径下面生成demo.xlsx文件
|
||||
}
|
||||
}
|
||||
244
application/admin/controller/Controller.php
Normal file
244
application/admin/controller/Controller.php
Normal file
@ -0,0 +1,244 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Controller extends Common{
|
||||
/**
|
||||
* 操作员列表
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$nickname = Request::instance()->get('nickname');
|
||||
$start = Request::instance()->get('start');
|
||||
$end = Request::instance()->get('end');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if($nickname) $where['nickname'] = array('like',"%".$nickname."%");
|
||||
if($start) $startTime = strtotime($start);
|
||||
if($end) $endTime = strtotime($end);
|
||||
|
||||
// 获取所有操作员信息
|
||||
$user_list = Db::name('user_controller')->where($where)->paginate(10,false,array('query'=>$get));
|
||||
$user_sum = Db::name('user_controller')->where($where)->count();
|
||||
foreach($user_list as $k => $v){
|
||||
$table = Db::name('table')->find($v['table_id']);
|
||||
$v['table_name'] = $table['table_name'];
|
||||
if($v['last_login_time'] > 0) $v['last_login_time'] = date('Y-m-d H:i:s',$v['last_login_time']);
|
||||
if($v['last_login_time'] <= 0) $v['last_login_time'] = '尚未登录';
|
||||
if(empty($v['last_login_ip'])) $v['last_login_ip'] = '尚未登录';
|
||||
$user_list[$k] = $v;
|
||||
}
|
||||
|
||||
// 渲染变量和模板
|
||||
$this->assign('user_list',$user_list);
|
||||
$this->assign('user_sum',$user_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加操作员页面
|
||||
*/
|
||||
public function controller_add()
|
||||
{
|
||||
// 查询所有桌子信息
|
||||
$table_list = Db::name('table')->select();
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('table_list',$table_list);
|
||||
return $this->fetch('/controller/controller-add');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理添加操作员
|
||||
*/
|
||||
public function do_controller_add()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
|
||||
// 接收提交过来的数据
|
||||
$username = Request::instance()->post('username');
|
||||
$nickname = Request::instance()->post('nickname');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$table = Request::instance()->post('table');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($table) && empty($table) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'请选择所属桌子!']));
|
||||
}
|
||||
if( !isset($username) && empty($username) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户名不能为空!']));
|
||||
}
|
||||
if( !isset($nickname) && empty($nickname) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'昵称不能为空!']));
|
||||
}
|
||||
if( !isset($pass) && empty($pass) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码不能为空!']));
|
||||
}
|
||||
if( !isset($repass) && empty($repass) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'确认密码不能为空!']));
|
||||
}
|
||||
if( $repass != $pass ){
|
||||
die(json_encode(['code'=>0,'msg'=>'两次密码不一致!']));
|
||||
}
|
||||
|
||||
// 检测用户名是否已经被注册
|
||||
$user = Db::name('user_controller')->where('username',$username)->find();
|
||||
if($user){
|
||||
die(json_encode(['code'=>0,'msg'=>'账号已存在!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['username'] = $username;
|
||||
$data['nickname'] = $nickname;
|
||||
$data['password'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['table_id'] = $table;
|
||||
$data['is_delete'] = 0;
|
||||
$insert_id = Db::name('user_controller')->insertGetId($data);
|
||||
if($insert_id){
|
||||
insertAdminLog('添加操作员','添加操作员: | ID: '.$insert_id.' | 账号: '.$username);
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑操作员页面
|
||||
*/
|
||||
public function controller_edit()
|
||||
{
|
||||
// 接收会员ID,查询会员信息
|
||||
$controller_id = Request::instance()->get('controller_id');
|
||||
$controller = Db::name('user_controller')->find($controller_id);
|
||||
|
||||
// 查询所有桌子信息
|
||||
$table_list = Db::name('table')->select();
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('table_list',$table_list);
|
||||
$this->assign('controller',$controller);
|
||||
return $this->fetch('/controller/controller-edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理修改操作员信息
|
||||
*/
|
||||
public function do_controller_edit()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$controller_id = Request::instance()->post('controller_id');
|
||||
$username = Request::instance()->post('username');
|
||||
$nickname = Request::instance()->post('nickname');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$table = Request::instance()->post('table');
|
||||
|
||||
//数据验证
|
||||
if(empty($username)){
|
||||
die(json_encode(['code'=>0,'msg'=>'会员账号不能为空!']));
|
||||
}
|
||||
if(empty($nickname)){
|
||||
die(json_encode(['code'=>0,'msg'=>'会员昵称不能为空!']));
|
||||
}
|
||||
if(!empty($pass) && strlen($pass) < 6){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码长度不能少于6位!']));
|
||||
}
|
||||
if(!empty($pass) && $pass != $repass){
|
||||
die(json_encode(['code'=>0,'msg'=>'两次密码输入不一致!']));
|
||||
}
|
||||
if(empty($table)){
|
||||
die(json_encode(['code'=>0,'msg'=>'请选择所属桌子!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['username'] = $username;
|
||||
$data['nickname'] = $nickname;
|
||||
if(!empty($pass)) $data['password'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['table_id'] = $table;
|
||||
|
||||
// 修改操作员资料
|
||||
$result = Db::name('user_controller')->where('id',$controller_id)->update($data);
|
||||
if($result){
|
||||
insertAdminLog('修改操作员','修改操作员: | ID: '.$controller_id.' | 账号: '.$username);
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除操作员
|
||||
*/
|
||||
public function controller_del()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$controller_id = Request::instance()->post('controller_id');
|
||||
|
||||
// 数据验证
|
||||
if(!$controller_id){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户不存在']));
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
$result = Db::name('user_controller')->where('id',$controller_id)->delete();
|
||||
if($result){
|
||||
insertAdminLog('删除操作员','删除操作员: | ID: '.$controller_id);
|
||||
die(json_encode(['code'=>1,'msg'=>'已删除!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'删除失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除多个操作员
|
||||
*/
|
||||
public function controller_del_more()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$user_ids = json_decode(Request::instance()->post('user_ids'),true);
|
||||
|
||||
// 验证数据
|
||||
if(empty($user_ids)){
|
||||
die(json_encode(['code'=>0,'msg'=>'删除用户不能为空!']));
|
||||
}else{
|
||||
// 遍历删除多个会员
|
||||
foreach($user_ids as $v){
|
||||
insertAdminLog('删除操作员','删除操作员: | ID: '.$v);
|
||||
Db::name('user_controller')->where('id',$v)->delete();
|
||||
}
|
||||
die(json_encode(['code'=>1,'msg'=>'已删除!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
}
|
||||
241
application/admin/controller/Cs.php
Normal file
241
application/admin/controller/Cs.php
Normal file
@ -0,0 +1,241 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Cs extends Common{
|
||||
/**
|
||||
* 可以洗码的会员及列表
|
||||
*/
|
||||
public function index(){
|
||||
Session::set('allowSubmit','YES');
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
$where['is_delete'] = 0;
|
||||
$where['agent'] = 1;
|
||||
$where['agent_parent_id'] = 0;
|
||||
// $where['agent_parent_id'] = 0;
|
||||
// 获取所有代理信息
|
||||
$agent_list = Db::name('user')->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
// 数据查询条件
|
||||
$sumWhere = array();
|
||||
$sumWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
foreach($agent_list AS $k => $v){
|
||||
$sumWhere['user_id'] = $v['id'];
|
||||
$sumWhere['status'] = 1;
|
||||
//占股总量
|
||||
$v['total_share_amount'] = Db::name('cs')->where($sumWhere)->sum('share_amount');
|
||||
//已结占股总量
|
||||
$v['checkout_share_amount'] = Db::name('cs')->where($sumWhere)->where(array('is_checkout' => 1))->sum('share_amount');
|
||||
//未结占股总量
|
||||
$v['no_checkout_share_amount'] = Db::name('cs')->where(array('user_id'=>$v['id'],'is_checkout' => 0))->sum('share_amount');
|
||||
//最后结算时间
|
||||
if($v['last_cs_time'] > 0){
|
||||
$v['last_cs_time'] = date('Y-m-d H:i:s',$v['last_cs_time']);
|
||||
}else{
|
||||
$v['last_cs_time'] = '-';
|
||||
}
|
||||
$agent_list[$k] = $v;
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('agent_list',$agent_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
//处理洗码
|
||||
public function do_cs(){
|
||||
$result = array();
|
||||
$user_info = Session::get('user_info');
|
||||
if(Request::instance()->post() && intval(Request::instance()->post('user_id')) > 0){
|
||||
$user_id = intval(Request::instance()->post('user_id'));
|
||||
$find = Db::name('user')->where(array('id' => $user_id, 'status' => 1, 'is_delete' => 0))->find();
|
||||
if(!$find){
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '账号处于非正常状态,请确保账号正常再进行操作';
|
||||
die(json_encode($result));
|
||||
}
|
||||
if($find['agent_parent_id'] > 0) {
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '不允许结算。请联系其经纪人为其洗码。';
|
||||
die(json_encode($result));
|
||||
}
|
||||
$total = Db::name('cs')->where(array('status' => 1, 'user_id' => $user_id, 'is_checkout' => 0))->sum('share_amount');
|
||||
if($total != 0){
|
||||
//防止重复提交
|
||||
$allowSubmit = Session::get('allowSubmit');
|
||||
if($allowSubmit == 'YES'){
|
||||
Session::delete('allowSubmit');
|
||||
}else{
|
||||
Session::delete('allowSubmit');
|
||||
die(json_encode(['errorCode' => 1, 'errorMessage' => "请勿重复提交"]));
|
||||
}
|
||||
//查找下边的会员
|
||||
$uodateRusult = Db::name('cs')->where(array('status' => 1, 'user_id' => $user_id, 'is_checkout' => 0))->update(array('is_checkout' => 1,'checkout_time' => time()));
|
||||
if($uodateRusult){
|
||||
//记录到结算日志
|
||||
$insertData = array();
|
||||
$insertData['user_id'] = $user_id;
|
||||
$insertData['username'] = $find['username'];
|
||||
$insertData['share_amount'] = $total;
|
||||
$insertData['agent_cs'] = $find['agent_cs'];
|
||||
$insertData['create_time'] = time();
|
||||
$insertData['old_money'] = 0;
|
||||
$insertData['new_money'] = 0;
|
||||
$insertData['admin_id'] = $user_info['id'];
|
||||
$insertData['admin_username'] = $user_info['admin'];
|
||||
$insertData['admin_or_agent'] = 1;
|
||||
Db::name('cs_log')->insert($insertData);
|
||||
//上分表增加记录
|
||||
$rechargeData = array();
|
||||
$rechargeData['type'] = 3;
|
||||
$rechargeData['amount'] = $total;
|
||||
if($total > 0){
|
||||
$rechargeData['mode'] = 1;
|
||||
}else{
|
||||
$rechargeData['mode'] = 2;
|
||||
}
|
||||
$rechargeData['agent_or_admin'] = 1;
|
||||
$rechargeData['user_id'] = $user_id;
|
||||
$rechargeData['user_type'] = $find['agent'];
|
||||
$rechargeData['user_agent_level'] = $find['agent_level'];
|
||||
$rechargeData['username_for'] = $find['username'];
|
||||
$rechargeData['nickname_for'] = $find['nickname'];
|
||||
$rechargeData['user_parent_id'] = $find['agent_parent_id'];
|
||||
$rechargeData['admin_id'] = $user_info['id'];
|
||||
$rechargeData['admin_user_name'] = $user_info['admin'];
|
||||
$rechargeData['create_time'] = time();
|
||||
$rechargeData['old_money'] = $find['money'];
|
||||
$rechargeData['new_money'] = $find['money'];
|
||||
$rechargeData['remake'] = '总后台操作占股结算,不会增加其余分,只做现金结算';
|
||||
Db::name('recharge')->insert($rechargeData);
|
||||
Db::name('user')->where(array('id' => $user_id))->update(array('last_cs_time' => time()));
|
||||
}
|
||||
$result['errorCode'] = 0;
|
||||
$result['errorMessage'] = '结算成功';
|
||||
die(json_encode($result));
|
||||
}else{
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '占股结算数目不能等于0';
|
||||
die(json_encode($result));
|
||||
}
|
||||
}else{
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = 'ERROR';
|
||||
die(json_encode($result));
|
||||
}
|
||||
}
|
||||
public function cs_check(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索条件
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$admin_or_agent = intval(Request::instance()->get('admin_or_agent'));
|
||||
|
||||
// 时间条件
|
||||
$endTime = time();
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
if($admin_or_agent > 0) $where['admin_or_agent'] = $admin_or_agent;
|
||||
|
||||
if($export == 1){
|
||||
$cs_list = Db::name('cs_log')->where($where)->order('create_time desc')->select();
|
||||
}else{
|
||||
// 所有的洗码记录
|
||||
$cs_list = Db::name('cs_log')->where($where)->order('create_time desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($cs_list as $k => $v){
|
||||
// 操作人
|
||||
if($v['admin_or_agent'] == 1 ){
|
||||
$v['connection_username'] = $v['admin_username'];
|
||||
$v['admin_or_agent_msg'] = '总台操作';
|
||||
}else{
|
||||
$v['admin_or_agent_msg'] = '代理操作';
|
||||
}
|
||||
// 数据格式转换
|
||||
$v['share_amount'] = round($v['share_amount'],2);
|
||||
$v['agent_cs'] = round($v['agent_cs'],2);
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$cs_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($cs_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($cs_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['agent_cs'];
|
||||
$excelData[$k][2] = $v['share_amount'];
|
||||
$excelData[$k][3] = $v['connection_username'];
|
||||
$excelData[$k][4] = $v['create_time'];
|
||||
$excelData[$k][5] = $v['admin_or_agent_msg'];
|
||||
}
|
||||
$title = array('账号','占成(%)','占股结算金额','操作人','结算时间','备注');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '占股结算记录-'.$startDate."-".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '占股结算记录', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('cs_list',$cs_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
464
application/admin/controller/Game.php
Normal file
464
application/admin/controller/Game.php
Normal file
@ -0,0 +1,464 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Game extends Common{
|
||||
public function delete_table(){
|
||||
if(Request::instance()->isPost()){
|
||||
$table_id = intval(Request::instance()->post('table_id'));
|
||||
if($table_id > 0){
|
||||
$status = Db::name('table')->where(array('id' => $table_id))->value('status');
|
||||
if($status == 1){
|
||||
Db::name('table')->where(array('id' => $table_id))->limit(1)->update(array('status' => 0));
|
||||
}else{
|
||||
Db::name('table')->where(array('id' => $table_id))->limit(1)->update(array('status' => 1));
|
||||
}
|
||||
return json(array('Success' => 1, 'Msg' => '操作成功'));
|
||||
}else{
|
||||
return json(array('Success' => 0, 'Msg' => '操作失败'));
|
||||
}
|
||||
}
|
||||
}
|
||||
public function index(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
$table_name = trim(Request::instance()->get('table_name'));
|
||||
$where = array();
|
||||
if($table_name != ''){
|
||||
$where['table_name'] = $table_name;
|
||||
}
|
||||
$table_info = Db::name('user_controller')->alias('a')->join('table b','a.table_id = b.id')->where($where)->order('table_id desc')->select();
|
||||
foreach($table_info as $k => $v){
|
||||
$v['number_total'] = Db::name('number_tab')->where('table_id',$v['id'])->count();
|
||||
$v['boot_total'] = Db::name('boot')->where('table_id',$v['id'])->count();
|
||||
if($v['bet_type'] == 1){
|
||||
$v['bet_type'] = '网络投注';
|
||||
}elseif($v['bet_type'] == 2){
|
||||
$v['bet_type'] = '电话投注';
|
||||
}elseif($v['bet_type'] == 3){
|
||||
$v['bet_type'] = '所有投注';
|
||||
}else{
|
||||
$v['bet_type'] = '无';
|
||||
}
|
||||
|
||||
$table_info[$k] = $v;
|
||||
}
|
||||
$this->assign('table_info',$table_info);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function edit_table_info(){
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
$table_info = Db::name('user_controller')->alias('a')->join('table b','a.table_id = b.id')->where('is_delete',0)->where("table_id",$table_id)->find();
|
||||
$table_info['min_bankerplayer'] = substr($table_info['limit_money'],0,strpos($table_info['limit_money'], '-'));
|
||||
$table_info['max_bankerplayer'] = substr(strstr($table_info['limit_money'], '-'),1);
|
||||
$table_info['min_tie'] = substr($table_info['limit_money_tie'],0,strpos($table_info['limit_money_tie'], '-'));
|
||||
$table_info['max_tie'] = substr(strstr($table_info['limit_money_tie'], '-'),1);
|
||||
$table_info['min_pair'] = substr($table_info['limit_money_pair'],0,strpos($table_info['limit_money_pair'], '-'));
|
||||
$table_info['max_pair'] = substr(strstr($table_info['limit_money_pair'], '-'),1);
|
||||
// 渲染参数和模板
|
||||
$this->assign('table_info',$table_info);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function do_edit_table_info(){
|
||||
$table_id = $this->request->param('table_id');
|
||||
$table_info = Db::name('table')->where('id',$table_id)->find();
|
||||
$table_num = $this->request->param('table_num');
|
||||
$table_name = $this->request->param('table_name');
|
||||
$bet_type = $this->request->param('bet_type');
|
||||
$seat_num = $this->request->param('seat_num');
|
||||
|
||||
|
||||
$min_bankerplayer = $this->request->param('min_bankerplayer');
|
||||
$max_bankerplayer = $this->request->param('max_bankerplayer');
|
||||
$min_tie = $this->request->param('min_tie');
|
||||
$max_tie = $this->request->param('max_tie');
|
||||
$min_pair = $this->request->param('min_pair');
|
||||
$max_pair = $this->request->param('max_pair');
|
||||
$wait_time = $this->request->param('wait_time');
|
||||
$is_scavenging = $this->request->param('is_scavenging');
|
||||
|
||||
$newPassword = $this->request->param('newPassword');
|
||||
$confirmNewPassword = $this->request->param('confirmNewPassword');
|
||||
if($table_num <= 0){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写桌台号为数字!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$table_name){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写桌台名称!';
|
||||
return $msg;
|
||||
}
|
||||
if($bet_type <= 0){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请选择投注方式!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$min_bankerplayer || !$max_bankerplayer){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-庄闲限红!';
|
||||
return $msg;
|
||||
}
|
||||
if($table_info['game_id'] == 1 || $table_info['game_id'] == 2){
|
||||
if(!$min_tie || !$max_tie){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-和限红!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
if($table_info['game_id'] == 1){
|
||||
if(!$min_pair || !$max_pair){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-对限红!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
if(!$wait_time){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写等待开牌时间!';
|
||||
return $msg;
|
||||
}
|
||||
if($newPassword){
|
||||
if(strlen($newPassword) < 6 || strlen($newPassword) > 20){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '密码长度必须是6到20个字符!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请再次输入密码!';
|
||||
return $msg;
|
||||
}
|
||||
if($newPassword != $confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '两次输入的密码不一致!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
if($confirmNewPassword){
|
||||
if(!$newPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写新密码!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
$update = array();
|
||||
$update['b.table_num'] = $table_num;
|
||||
$update['b.table_name'] = $table_name;
|
||||
$update['b.bet_type'] = $bet_type;
|
||||
$update['b.seat_num'] = $seat_num;
|
||||
$update['b.limit_money'] = $min_bankerplayer.'-'.$max_bankerplayer;
|
||||
if($table_info['game_id'] == 1 || $table_info['game_id'] == 2){
|
||||
$update['b.limit_money_tie'] = $min_tie.'-'.$max_tie;
|
||||
}
|
||||
if($table_info['game_id'] == 1){
|
||||
$update['b.limit_money_pair'] = $min_pair.'-'.$max_pair;
|
||||
}
|
||||
$update['b.wait_time'] = $wait_time;
|
||||
$update['b.is_scavenging'] = $is_scavenging;
|
||||
|
||||
$update['b.media_far_rtmp'] = trim($this->request->param('media_far_rtmp'));
|
||||
$update['b.media_far_flv'] = trim($this->request->param('media_far_flv'));
|
||||
$update['b.media_far_ws'] = trim($this->request->param('media_far_ws'));
|
||||
$update['b.media_near_rtmp'] = trim($this->request->param('media_near_rtmp'));
|
||||
$update['b.media_near_flv'] = trim($this->request->param('media_near_flv'));
|
||||
$update['b.media_near_ws'] = trim($this->request->param('media_near_ws'));
|
||||
|
||||
$update['b.limit_money_total'] = intval($this->request->param('limit_money_total'));
|
||||
$update['b.limit_money_tie_total'] = intval($this->request->param('limit_money_tie_total'));
|
||||
$update['b.limit_money_pair_total'] = intval($this->request->param('limit_money_pair_total'));
|
||||
|
||||
$update['b.sort'] = intval($this->request->param('sort'));
|
||||
|
||||
$update['b.interval_time'] = intval($this->request->param('interval_time'));
|
||||
$update['b.card_first_type'] = intval($this->request->param('card_first_type'));
|
||||
|
||||
if($newPassword){
|
||||
$update['a.password'] = think_ucenter_md5($newPassword,UC_AUTH_KEY);
|
||||
}
|
||||
$update['b.phone'] = trim($this->request->param('phone'));
|
||||
if($update['b.phone']){
|
||||
$findPhone = Db::name('table')->where(['phone'=>$update['b.phone']])->where('id','<>',$table_id)->find();
|
||||
if($findPhone){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '手机号已被使用!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
Db::name('user_controller')->alias('a')->join('table b','a.table_id = b.id')->where('a.is_delete',0)->where("a.table_id",$table_id)->update($update);
|
||||
$msg['status'] = 2;
|
||||
$msg['code'] = '修改成功';
|
||||
return $msg;
|
||||
}
|
||||
|
||||
public function add_table(){
|
||||
return $this->fetch();
|
||||
}
|
||||
public function do_add_table(){
|
||||
$table['table_num'] = $this->request->param('table_num');
|
||||
$table['table_name'] = $this->request->param('table_name');
|
||||
$table['game_id'] = $this->request->param('game_id');
|
||||
/*
|
||||
if($table['game_id'] == 1){
|
||||
$table['mode'] = $this->request->param('mode');
|
||||
}
|
||||
*/
|
||||
$min_bankerplayer = $this->request->param('min_bankerplayer');
|
||||
$max_bankerplayer = $this->request->param('max_bankerplayer');
|
||||
if($table['game_id'] == 1 || $table['game_id'] == 2){
|
||||
$min_tie = $this->request->param('min_tie');
|
||||
$max_tie = $this->request->param('max_tie');
|
||||
}
|
||||
if($table['game_id'] == 1){
|
||||
$min_pair = $this->request->param('min_pair');
|
||||
$max_pair = $this->request->param('max_pair');
|
||||
}
|
||||
$wait_time = $this->request->param('wait_time');
|
||||
$rob_time = $this->request->param('rob_time');
|
||||
$is_scavenging = $this->request->param('is_scavenging');
|
||||
$is_rob = $this->request->param('is_rob');
|
||||
|
||||
if (is_null($is_rob)) $is_rob = 0;
|
||||
|
||||
$remarks = $this->request->param('remarks');
|
||||
$bet_type = $this->request->param('bet_type');
|
||||
$controller['username'] = $this->request->param('username');
|
||||
$newPassword = $this->request->param('newPassword');
|
||||
$confirmNewPassword = $this->request->param('confirmNewPassword');
|
||||
$controller['nickname'] = $this->request->param('nickname');
|
||||
$table['phone'] = trim($this->request->param('phone'));
|
||||
|
||||
$is_localhost_control = intval($this->request->param('is_localhost_control'));
|
||||
$limit_banker_amount = intval($this->request->param('limit_banker_amount'));
|
||||
if($is_localhost_control == 1 && $is_scavenging == 1){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '桌子选择扫牌,则只能选择网络控制';
|
||||
return $msg;
|
||||
}
|
||||
|
||||
if($table['table_num'] <= 0){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写桌台号为数字!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$table['table_name']){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写桌台名称!';
|
||||
return $msg;
|
||||
}
|
||||
$is_table_name = Db::name('table')->where(array('table_name' => $table['table_name'], 'status' => 1))->find();
|
||||
if($is_table_name){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '该桌台已经存在,请输入新的桌台名称!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$table['game_id']){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请选择游戏名称!';
|
||||
return $msg;
|
||||
}
|
||||
/*
|
||||
if($table['game_id'] == 1){
|
||||
if(!$table['mode']){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请选择游戏模式!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
*/
|
||||
if($bet_type <= 0){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请选择游戏模式!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$min_bankerplayer || !$max_bankerplayer){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-庄闲限红!';
|
||||
return $msg;
|
||||
}
|
||||
if($table['game_id'] == 1 || $table['game_id'] == 2){
|
||||
if(!$min_tie || !$max_tie){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-和限红!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
if($table['game_id'] == 1){
|
||||
if(!$min_pair || !$max_pair){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写完整网络-对限红!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
if(!$controller['username']){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写账户名!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$newPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写密码!';
|
||||
return $msg;
|
||||
}
|
||||
if(strlen($newPassword) < 6 || strlen($newPassword) > 20){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '密码长度必须是6到20个字符!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请再次填写密码!';
|
||||
return $msg;
|
||||
}
|
||||
if($newPassword != $confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '两次输入的密码不一致!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$controller['nickname']){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写昵称!';
|
||||
return $msg;
|
||||
}
|
||||
if($table['game_id'] == 1){
|
||||
$table['game_name'] = '百家乐';
|
||||
$table['is_rob'] = 0;
|
||||
}else if($table['game_id'] == 2){
|
||||
$table['game_name'] = '龙虎斗';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = 0;
|
||||
}else if($table['game_id'] == 4){
|
||||
$table['game_name'] = '牛牛';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = $is_rob;
|
||||
}else if($table['game_id'] == 5){
|
||||
$table['game_name'] = '三卡牛牛';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = $is_rob;
|
||||
}else if($table['game_id'] == 6){
|
||||
$table['game_name'] = '色碟';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = $is_rob;
|
||||
}else if($table['game_id'] == 7){
|
||||
$table['game_name'] = '骰宝';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = $is_rob;
|
||||
}else if($table['game_id'] == 8){
|
||||
$table['game_name'] = '轮盘';
|
||||
/*
|
||||
$table['mode'] = 0;
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
*/
|
||||
$table['is_rob'] = $is_rob;
|
||||
}
|
||||
/*
|
||||
if($table['mode'] == 1){
|
||||
$table['special_num'] = 0;
|
||||
$table['percent_num'] = 0.00;
|
||||
}else if($table['mode'] == 2){
|
||||
$table['special_num'] = 6;
|
||||
$table['percent_num'] = 0.50;
|
||||
}
|
||||
*/
|
||||
$table['table_limit'] = 0.00;
|
||||
$table['limit_money'] = $min_bankerplayer.'-'.$max_bankerplayer;
|
||||
if($table['game_id'] == 1 || $table['game_id'] == 2){
|
||||
$table['limit_money_tie'] = $min_tie.'-'.$max_tie;
|
||||
}
|
||||
if($table['game_id'] == 1){
|
||||
$table['limit_money_pair'] = $min_pair.'-'.$max_pair;
|
||||
}
|
||||
$table['is_scavenging'] = $is_scavenging;
|
||||
// $table['is_rob'] = $is_rob;
|
||||
if($table['game_id'] == 5){
|
||||
if($table['is_rob'] == 1){
|
||||
if(!$limit_banker_amount){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写上庄金额!';
|
||||
return $msg;
|
||||
}
|
||||
$table['limit_banker_amount'] = $limit_banker_amount;
|
||||
}
|
||||
}
|
||||
$table['media_far_rtmp'] = trim($this->request->param('media_far_rtmp'));
|
||||
$table['media_far_flv'] = trim($this->request->param('media_far_flv'));
|
||||
$table['media_far_ws'] = trim($this->request->param('media_far_ws'));
|
||||
$table['media_near_rtmp'] = trim($this->request->param('media_near_rtmp'));
|
||||
$table['media_near_flv'] = trim($this->request->param('media_near_flv'));
|
||||
$table['media_near_ws'] = trim($this->request->param('media_near_ws'));
|
||||
$table['limit_money_total'] = intval($this->request->param('limit_money_total'));
|
||||
$table['limit_money_tie_total'] = intval($this->request->param('limit_money_tie_total'));
|
||||
$table['limit_money_pair_total'] = intval($this->request->param('limit_money_pair_total'));
|
||||
|
||||
$table['bet_type'] = $bet_type;
|
||||
$table['is_localhost_control'] = $is_localhost_control;
|
||||
|
||||
$table['interval_time'] = intval($this->request->param('interval_time'));
|
||||
$table['card_first_type'] = intval($this->request->param('card_first_type'));
|
||||
|
||||
$table['seat_num'] = intval($this->request->param('seat_num'));
|
||||
|
||||
if($remarks){
|
||||
$table['remake'] = $remarks;
|
||||
}
|
||||
if($wait_time){
|
||||
$table['wait_time'] = $wait_time;
|
||||
}
|
||||
if($table['phone']){
|
||||
$findPhone = Db::name('table')->where(['phone'=>$table['phone']])->find();
|
||||
if($findPhone){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '手机号已被使用!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
|
||||
$is_table = Db::name('table')->insert($table);
|
||||
if($is_table == 1){
|
||||
$controller['table_id'] = Db::name('table')->getLastInsID();
|
||||
$controller['password'] = think_ucenter_md5($newPassword,UC_AUTH_KEY);
|
||||
$controller['encrypt'] = getRandChar();
|
||||
$is_controller = Db::name('user_controller')->insert($controller);
|
||||
if($is_controller){
|
||||
$msg['status'] = 2;
|
||||
$msg['code'] = '添加成功!';
|
||||
return $msg;
|
||||
}else{
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '添加失败,请稍后再试!';
|
||||
return $msg;
|
||||
}
|
||||
}else{
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '添加失败,请稍后再试!';
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
139
application/admin/controller/Index.php
Normal file
139
application/admin/controller/Index.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Session;
|
||||
use think\Request;
|
||||
|
||||
class Index extends Common{
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
}
|
||||
public function check_cashout(){
|
||||
if(Request::instance()->isPost()){
|
||||
$receivables_record = Db::name('receivables_record')->where(array('record_type' => 2, 'status' => 0))->order('id DESC')->find();
|
||||
if($receivables_record){
|
||||
return json(array('code' => 1));
|
||||
}else{
|
||||
return json(array('code' => 0));
|
||||
}
|
||||
}else{
|
||||
die('请求错误,请退出页面');
|
||||
}
|
||||
}
|
||||
public function index(){
|
||||
$user_info = Session::get('user_info');
|
||||
$this->assign('user_info',$user_info);
|
||||
$this->assign('admin',$user_info['admin']);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 关系链
|
||||
public function relation(){
|
||||
// 接收要修改的下属ID
|
||||
$user_id = Request::instance()->get('id');
|
||||
$user_info = Db::name('user')->where('id',$user_id)->find();
|
||||
|
||||
// 查询代理路径
|
||||
$agentParentPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
$relation = array();
|
||||
foreach($agentParentPath as $k => $v){
|
||||
$user = Db::name('user')->where('id',$v)->find();
|
||||
$data = array();
|
||||
$data['username'] = $user['username'];
|
||||
$data['nickname'] = $user['nickname'];
|
||||
$data['reg_time'] = date('Y-m-d H:i:s',$user['reg_time']);
|
||||
if($user['agent'] == 1){
|
||||
$data['agent'] = '代理';
|
||||
$data['color'] = '#FF5722';
|
||||
}else{
|
||||
$data['agent'] = '会员';
|
||||
$data['color'] = '#008dfd';
|
||||
}
|
||||
$relation[] = $data;
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('relation',$relation);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function print_user_bet(){
|
||||
$user_id = intval(Request::instance()->get('user_id'));
|
||||
$all_bet = DB::name('bet')->alias('b')->join('cg_number_tab n','b.number_tab_id=n.id')->where(array('b.user_id' => $user_id, 'b.status' => 1))->where('game_id','>',0)->where('game_id','<',3)->order('b.create_time DESC')->field('b.*,n.bet_end_time')->select();
|
||||
if($all_bet){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($all_bet AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['table_name'];
|
||||
$excelData[$k][2] = $v['boot_num'];
|
||||
$excelData[$k][3] = $v['number'];
|
||||
if($v['game_id'] == 1){
|
||||
if($v['result'] == 1){
|
||||
if($v['pair'] == 1){
|
||||
$excelData[$k][4] = '庄-庄对';
|
||||
}elseif($v['pair'] == 2){
|
||||
$excelData[$k][4] = '庄-闲对';
|
||||
}elseif($v['pair'] == 3){
|
||||
$excelData[$k][4] = '庄-庄闲对';
|
||||
}else{
|
||||
$excelData[$k][4] = '庄';
|
||||
}
|
||||
}elseif($v['result'] == 2){
|
||||
if($v['pair'] == 1){
|
||||
$excelData[$k][4] = '闲-庄对';
|
||||
}elseif($v['pair'] == 2){
|
||||
$excelData[$k][4] = '闲-闲对';
|
||||
}elseif($v['pair'] == 3){
|
||||
$excelData[$k][4] = '闲-庄闲对';
|
||||
}else{
|
||||
$excelData[$k][4] = '闲';
|
||||
}
|
||||
}elseif($v['result'] == 3){
|
||||
if($v['pair'] == 1){
|
||||
$excelData[$k][4] = '和-庄对';
|
||||
}elseif($v['pair'] == 2){
|
||||
$excelData[$k][4] = '和-闲对';
|
||||
}elseif($v['pair'] == 3){
|
||||
$excelData[$k][4] = '和-庄闲对';
|
||||
}else{
|
||||
$excelData[$k][4] = '和';
|
||||
}
|
||||
}else{
|
||||
$excelData[$k][4] = '';
|
||||
}
|
||||
}else{
|
||||
if($v['result'] == 1){
|
||||
$excelData[$k][4] = '龙';
|
||||
}elseif($v['result'] == 2){
|
||||
$excelData[$k][4] = '虎';
|
||||
}elseif($v['result'] == 3){
|
||||
$excelData[$k][4] = '和';
|
||||
}else{
|
||||
$excelData[$k][4] = '';
|
||||
}
|
||||
}
|
||||
$excelData[$k][5] = $v['money_before_bet'];
|
||||
$excelData[$k][6] = $v['money'];
|
||||
$excelData[$k][7] = $v['end_money'];
|
||||
$excelData[$k][8] = $v['win_total'];
|
||||
$excelData[$k][9] = $v['banker_amount'];
|
||||
$excelData[$k][10] = $v['player_amount'];
|
||||
$excelData[$k][11] = $v['tie_amount'];
|
||||
if($v['game_id'] == 1){
|
||||
$excelData[$k][12] = $v['banker_pair_amount'];
|
||||
$excelData[$k][13] = $v['player_pair_amount'];
|
||||
}else{
|
||||
$excelData[$k][12] = '';
|
||||
$excelData[$k][13] = '';
|
||||
}
|
||||
$excelData[$k][14] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$excelData[$k][15] = date('Y-m-d H:i:s',$v['bet_end_time']);
|
||||
}
|
||||
$title = array('用户名','下注桌子','靴号','铺号','结果','下注前余额','下注后余额','开结果后余额','总赢','庄下注额','闲下注额','和下注额','庄对下注额','闲对下注额','下注时间','封盘时间');
|
||||
$this->exportExcelCore($excelData, '下注明细', $title);
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}
|
||||
}
|
||||
}
|
||||
91
application/admin/controller/Info.php
Normal file
91
application/admin/controller/Info.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Info extends Common{
|
||||
public function index(){
|
||||
$user_info = Session::get('user_info');
|
||||
$last_login_info = Session::get('last_login_info');
|
||||
$last_login_info['last_login_time'] = date('Y-m-d H:i:s',$last_login_info['last_login_time']);
|
||||
$this->assign('last_login_info',$last_login_info);
|
||||
$this->assign('user_info',$user_info);
|
||||
$system_info = Db::name('system')->where(array('id' => 1))->find();
|
||||
$this->assign('system_info',$system_info);
|
||||
$this->assign('user_info',$user_info);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function pass_edit(){
|
||||
$user_info = Session::get('user_info');
|
||||
$this->assign('user_info',$user_info);
|
||||
return $this->fetch();
|
||||
}
|
||||
//修改密码
|
||||
public function update_password(){
|
||||
$id = $this->request->param('id');
|
||||
$oldPassword = $this->request->param('oldPassword');
|
||||
$newPassword = $this->request->param('newPassword');
|
||||
$confirmNewPassword = $this->request->param('confirmNewPassword');
|
||||
if(!$oldPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写旧密码!';
|
||||
return $msg;
|
||||
}
|
||||
$user_pass = Db::name('admin')->where('id',$id)->value('password');
|
||||
$oldPassword = think_ucenter_md5($oldPassword,UC_AUTH_KEY);
|
||||
if($user_pass != $oldPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '原密码错误';
|
||||
return $msg;
|
||||
}
|
||||
if(!$newPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请填写新密码!';
|
||||
return $msg;
|
||||
}
|
||||
if(strlen($newPassword) < 6 || strlen($newPassword) > 20){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '密码长度必须是6到20个字符!';
|
||||
return $msg;
|
||||
}
|
||||
if(!$confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '请再次填写新密码!';
|
||||
return $msg;
|
||||
}
|
||||
if($newPassword != $confirmNewPassword){
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '两次输入的密码不一致!';
|
||||
return $msg;
|
||||
}
|
||||
$newPassword = think_ucenter_md5($newPassword,UC_AUTH_KEY);
|
||||
$is_passwprd = Db::name('admin')->where('id',$id)->update(['password' => $newPassword]);
|
||||
if($is_passwprd == 1){
|
||||
$msg['status'] = 2;
|
||||
$msg['code'] = '修改成功';
|
||||
}else{
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '修改失败,请稍后再试';
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
//修改个人信息
|
||||
public function update_info(){
|
||||
$casino_name = $this->request->param('casino_name');
|
||||
$ws_url = $this->request->param('ws_url');
|
||||
$pc_video = $this->request->param('pc_video');
|
||||
$wap_video = $this->request->param('wap_video');
|
||||
$is_update = Db::name('system')->where('id',1)->update(['casino_name' => $casino_name,'ws_url' => $ws_url,'pc_video' => $pc_video,'wap_video' => $wap_video]);
|
||||
if($is_update == 1){
|
||||
$msg['status'] = 2;
|
||||
$msg['code'] = '修改成功';
|
||||
}else{
|
||||
$msg['status'] = 1;
|
||||
$msg['code'] = '修改成功';
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
}
|
||||
574
application/admin/controller/Log.php
Normal file
574
application/admin/controller/Log.php
Normal file
@ -0,0 +1,574 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class Log extends Common
|
||||
{
|
||||
// 代理操作日志
|
||||
public function index()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索参数
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = array('like',"%".$username."%");
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['control_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
if($export == 1){
|
||||
$log_list = Db::name('agent_log')->where($where)->order('control_time desc')->select();
|
||||
}else{
|
||||
// 查询所有的日志信息
|
||||
$log_list = Db::name('agent_log')->where($where)->order('control_time desc')->paginate(15,false,array('query'=>$get));
|
||||
}
|
||||
$log_sum = Db::name('agent_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['control_time'] = date('Y-m-d H:i:s',$v['control_time']);
|
||||
if(empty($v['ip_location'])) $v['ip_location'] = "无";
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($log_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($log_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['control'];
|
||||
$excelData[$k][2] = $v['remake'];
|
||||
$excelData[$k][3] = $v['control_time'];
|
||||
}
|
||||
$title = array('操作人','操作类型','操作描述','操作时间');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '操作日志-'.$startDate."-".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '操作日志', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 代理操作日志
|
||||
public function admin()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索参数
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['space_admin'] = array('like',"%".$username."%");
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['control_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
if($export == 1){
|
||||
$log_list = Db::name('space_system_log')->where($where)->order('control_time desc')->select();
|
||||
}else{
|
||||
// 查询所有的日志信息
|
||||
$log_list = Db::name('space_system_log')->where($where)->order('control_time desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
$log_sum = Db::name('agent_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['control_time'] = date('Y-m-d H:i:s',$v['control_time']);
|
||||
if(empty($v['ip_location'])) $v['ip_location'] = "无";
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($log_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($log_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['space_admin'];
|
||||
$excelData[$k][1] = $v['control'];
|
||||
$excelData[$k][2] = $v['remake'];
|
||||
$excelData[$k][3] = $v['control_time'];
|
||||
}
|
||||
$title = array('操作人','操作类型','操作描述','操作时间');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '操作日志-'.$startDate."-".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '操作日志', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function admin_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
$where = array();
|
||||
if(!empty($username)) $where['space_admin'] = array('like',"%".$username."%");
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['control_time'] = array('between',[$startTime,$endTime]);
|
||||
$log_list = Db::name('space_system_log')->where($where)->order('control_time desc')->select();
|
||||
$log_sum = Db::name('agent_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['control_time'] = date('Y-m-d H:i:s',$v['control_time']);
|
||||
if(empty($v['ip_location'])) $v['ip_location'] = "无";
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function user_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = array('like',"%".$username."%");
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['control_time'] = array('between',[$startTime,$endTime]);
|
||||
$log_list = Db::name('agent_log')->where($where)->order('control_time desc')->select();
|
||||
$log_sum = Db::name('agent_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['control_time'] = date('Y-m-d H:i:s',$v['control_time']);
|
||||
if(empty($v['ip_location'])) $v['ip_location'] = "无";
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 用户登录日志
|
||||
public function user_login()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索参数
|
||||
$username = Request::instance()->get('username');
|
||||
$remark = Request::instance()->get('remark');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = array('like',"%".$username."%");
|
||||
if(!empty($remark)) $where['remark'] = $remark;
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
if($export == 1){
|
||||
$log_list = Db::name('user_log')->where($where)->order('create_time desc')->select();
|
||||
}else{
|
||||
// 查询所有的日志信息
|
||||
$log_list = Db::name('user_log')->where($where)->order('create_time desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
$log_sum = Db::name('user_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($log_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($log_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['nickname'];
|
||||
$excelData[$k][2] = $v['ip'];
|
||||
$excelData[$k][3] = $v['ip_location'];
|
||||
$excelData[$k][4] = $v['client'];
|
||||
$excelData[$k][5] = $v['remark'];
|
||||
$excelData[$k][6] = $v['create_time'];
|
||||
}
|
||||
$title = array('账号','姓名','IP','IP所属地区','登录客户端','备注','操作时间');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '用户登录日志-'.$startDate."-".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '用户登录日志', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function user_login_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$username = Request::instance()->get('username');
|
||||
$remark = Request::instance()->get('remark');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$startTime = 0;
|
||||
$endTime = time();
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = array('like',"%".$username."%");
|
||||
if(!empty($remark)) $where['remark'] = $remark;
|
||||
if($startDate) $startTime = strtotime($startDate);
|
||||
if($endDate) $endTime = strtotime($endDate);
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$log_list = Db::name('user_log')->where($where)->order('create_time desc')->select();
|
||||
$log_sum = Db::name('user_log')->count();
|
||||
foreach($log_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$log_list[$k] = $v;
|
||||
}
|
||||
$this->assign('log_list',$log_list);
|
||||
$this->assign('log_sum',$log_sum);
|
||||
return $this->fetch();
|
||||
}
|
||||
// 扫描用户
|
||||
public function scan_admin(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
$admin_list = Db::name('scan_account')->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin_list',$admin_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
// 接口用户
|
||||
public function api_admin(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
$admin_list = Db::name('api_account')->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin_list',$admin_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 扫描用户添加页面
|
||||
public function scan_admin_add(){
|
||||
// 渲染参数和模板
|
||||
return $this->fetch();
|
||||
}
|
||||
// API用户添加页面
|
||||
public function api_admin_add(){
|
||||
// 渲染参数和模板
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 处理扫描用户添加
|
||||
public function do_scan_admin_add(){
|
||||
// 接收提交过来的数据
|
||||
$appid = Request::instance()->post('appid');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$name = Request::instance()->post('name');
|
||||
$remake = Request::instance()->post('remake');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($appid) && empty($appid) ){
|
||||
return json(['code'=>0,'msg'=>'用户名不能为空!']);
|
||||
}
|
||||
if( !isset($pass) && empty($pass) ){
|
||||
return json(['code'=>0,'msg'=>'密码不能为空!']);
|
||||
}
|
||||
if( !isset($repass) && empty($repass) ){
|
||||
return json(['code'=>0,'msg'=>'确认密码不能为空!']);
|
||||
}
|
||||
if( $repass != $pass ){
|
||||
return json(['code'=>0,'msg'=>'两次密码不一致!']);
|
||||
}
|
||||
if( !isset($name) && empty($name) ){
|
||||
return json(['code'=>0,'msg'=>'名称不能为空!']);
|
||||
}
|
||||
|
||||
// 检测用户名是否已经被注册
|
||||
$user = Db::name('scan_account')->where('appid',$appid)->find();
|
||||
if($user){
|
||||
return json(['code'=>0,'msg'=>'用户已存在!']);
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['appid'] = $appid;
|
||||
$data['appsecret'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['name'] = $name;
|
||||
$data['remake'] = $remake;
|
||||
$insert_id = Db::name('scan_account')->insertGetId($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('添加扫描用户','添加扫描用户:| ID: '.$insert_id.' | appid: '.$appid);
|
||||
return json(['code'=>1,'msg'=>'添加成功!']);
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'添加失败!']);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理API用户添加
|
||||
public function do_api_admin_add(){
|
||||
// 接收提交过来的数据
|
||||
$appid = Request::instance()->post('appid');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$name = Request::instance()->post('name');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($appid) && empty($appid) ){
|
||||
return json(['code'=>0,'msg'=>'APPID不能为空']);
|
||||
}
|
||||
if( !isset($pass) && empty($pass) ){
|
||||
return json(['code'=>0,'msg'=>'秘钥不能为空']);
|
||||
}
|
||||
if( !isset($repass) && empty($repass) ){
|
||||
return json(['code'=>0,'msg'=>'确认秘钥不能为空']);
|
||||
}
|
||||
if( $repass != $pass ){
|
||||
return json(['code'=>0,'msg'=>'两次秘钥不一致']);
|
||||
}
|
||||
if( !isset($name) && empty($name) ){
|
||||
return json(['code'=>0,'msg'=>'名称不能为空!']);
|
||||
}
|
||||
|
||||
// 检测用户名是否已经被注册
|
||||
$user = Db::name('api_account')->where('appid',$appid)->find();
|
||||
if($user){
|
||||
return json(['code'=>0,'msg'=>'APPID已存在']);
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['appid'] = $appid;
|
||||
$data['appsecret'] = $pass;
|
||||
$data['name'] = $name;
|
||||
$insert_id = Db::name('api_account')->insertGetId($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('添加扫描用户','添加API用户:| ID: '.$insert_id.' | appid: '.$appid);
|
||||
return json(['code'=>1,'msg'=>'添加成功!']);
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'添加失败!']);
|
||||
}
|
||||
}
|
||||
|
||||
// 扫描用户编辑页面
|
||||
public function scan_admin_edit(){
|
||||
// 扫描用户
|
||||
$id = Request::instance()->get('id');
|
||||
$admin = Db::name('scan_account')->find($id);
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin',$admin);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// API用户编辑页面
|
||||
public function api_admin_edit(){
|
||||
// API用户
|
||||
$id = Request::instance()->get('id');
|
||||
$admin = Db::name('api_account')->find($id);
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('admin',$admin);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 处理扫描用户编辑
|
||||
public function do_scan_admin_edit(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$scan_admin_id = Request::instance()->post('scan_admin_id');
|
||||
$appid = Request::instance()->post('appid');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$name = Request::instance()->post('name');
|
||||
$remake = Request::instance()->post('remake');
|
||||
|
||||
//数据验证
|
||||
if(empty($appid)){
|
||||
return json(['code'=>0,'msg'=>'appid不能为空!']);
|
||||
}
|
||||
if(!empty($pass) && strlen($pass) < 6){
|
||||
return json(['code'=>0,'msg'=>'密码长度不能少于6位!']);
|
||||
}
|
||||
if(!empty($pass) && $pass != $repass){
|
||||
return json(['code'=>0,'msg'=>'两次密码输入不一致!']);
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
if(!empty($pass)) $data['appsecret'] = think_ucenter_md5($pass, UC_AUTH_KEY);
|
||||
$data['name'] = $name;
|
||||
$data['remake'] = $remake;
|
||||
|
||||
// 修改管理员资料
|
||||
$result = Db::name('scan_account')->where('id',$scan_admin_id)->update($data);
|
||||
if($result){
|
||||
insertAdminLog('修改扫描用户','修改扫描用户:| ID: '.$scan_admin_id.' | appid:'.$appid);
|
||||
return json(['code'=>1,'msg'=>'修改成功!']);
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'修改失败!']);
|
||||
}
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'操作错误!']);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理API用户编辑
|
||||
public function do_api_admin_edit(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$id = Request::instance()->post('id');
|
||||
$appid = Request::instance()->post('appid');
|
||||
$pass = Request::instance()->post('pass');
|
||||
$repass = Request::instance()->post('repass');
|
||||
$name = Request::instance()->post('name');
|
||||
|
||||
//数据验证
|
||||
if(empty($appid)){
|
||||
return json(['code'=>0,'msg'=>'appid不能为空!']);
|
||||
}
|
||||
if(!empty($pass) && strlen($pass) < 6){
|
||||
return json(['code'=>0,'msg'=>'密码长度不能少于6位!']);
|
||||
}
|
||||
if(!empty($pass) && $pass != $repass){
|
||||
return json(['code'=>0,'msg'=>'两次密码输入不一致!']);
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['appsecret'] = $pass;
|
||||
$data['name'] = $name;
|
||||
|
||||
// 修改管理员资料
|
||||
$result = Db::name('api_account')->where('id',$id)->update($data);
|
||||
if($result){
|
||||
insertAdminLog('修改API用户','修改API用户:| ID: '.$id.' | appid:'.$appid);
|
||||
return json(['code'=>1,'msg'=>'修改成功!']);
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'修改失败!']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除扫描用户
|
||||
public function scan_admin_del()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$scan_admin_id = Request::instance()->post('scan_admin_id');
|
||||
$scan_admin = Db::name('scan_account')->where('id',$scan_admin_id)->find();
|
||||
// 数据验证
|
||||
if(!$scan_admin){
|
||||
return json(['code'=>0,'msg'=>'用户不存在']);
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
$result = Db::name('scan_account')->where('id',$scan_admin_id)->delete();
|
||||
if($result){
|
||||
insertAdminLog('删除扫描用户',"删除扫描用户: | appid: ".$scan_admin['appid']);
|
||||
return json(['code'=>1,'msg'=>'删除成功!']);
|
||||
}else{
|
||||
return json(['code'=>1,'msg'=>'删除失败!']);
|
||||
}
|
||||
}else{
|
||||
return json(['code'=>0,'msg'=>'操作错误!']);
|
||||
}
|
||||
}
|
||||
// 删除API用户
|
||||
public function api_admin_del(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('id');
|
||||
// 删除用户
|
||||
$result = Db::name('api_account')->where('id',$id)->delete();
|
||||
if($result){
|
||||
insertAdminLog('删除API用户',"删除API用户: | id: ".$id);
|
||||
return json(['code'=>1,'msg'=>'删除成功!']);
|
||||
}else{
|
||||
return json(['code'=>1,'msg'=>'删除失败!']);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更改APIStatus
|
||||
public function api_admin_status(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('id');
|
||||
// 删除用户
|
||||
$find = Db::name('api_account')->where('id',$id)->find();
|
||||
if($find['status'] == 1){
|
||||
$status = 0;
|
||||
}else{
|
||||
$status = 1;
|
||||
}
|
||||
$result = Db::name('api_account')->where('id',$id)->update(array('status' => $status));
|
||||
if($result){
|
||||
insertAdminLog('更改API用户状态',"更改API用户状态: | id: ".$id);
|
||||
return json(['code'=>1,'msg'=>'更改状态成功!']);
|
||||
}else{
|
||||
return json(['code'=>1,'msg'=>'更改状态失败!']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
97
application/admin/controller/Login.php
Executable file
97
application/admin/controller/Login.php
Executable file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Session;
|
||||
use think\Controller;
|
||||
use ValidateCode\ValidateCode;
|
||||
use think\Request;
|
||||
use think\Db;
|
||||
|
||||
class Login extends Controller{
|
||||
/**
|
||||
* 登录页面
|
||||
*/
|
||||
public function index(){
|
||||
$user_info = Session::get('user_info');
|
||||
if(!empty($user_info)){
|
||||
$this->redirect('/',302);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理登录
|
||||
*/
|
||||
public function do_login(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收表单提交过来的数据,做数据验证
|
||||
$admin = Request::instance()->post('username');
|
||||
$password = Request::instance()->post('password');
|
||||
$code = Request::instance()->post('code');
|
||||
if(!isset($admin) || empty($admin)){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户名不能为空!']));
|
||||
}
|
||||
if(!isset($password) || empty($password)){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码不能为空!']));
|
||||
}
|
||||
if(!isset($code) || empty($code)){
|
||||
die(json_encode(['code'=>0,'msg'=>'验证码不能为空!']));
|
||||
}
|
||||
|
||||
// 从session里拿到验证码,进行验证码对比
|
||||
$validate_code = Session::get('validate_code');
|
||||
if($code != $validate_code){
|
||||
die(json_encode(['code'=>0,'msg'=>'验证码错误!']));
|
||||
}
|
||||
|
||||
// 查询客户信息,判断用户名和密码是否正确
|
||||
$admin_info = Db::name('admin')->where('admin',$admin)->find();
|
||||
if(empty($admin_info)){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户不存在!']));
|
||||
}
|
||||
|
||||
if(think_ucenter_md5($password,UC_AUTH_KEY) != $admin_info['password']){
|
||||
die(json_encode(['code'=>0,'msg'=>'密码错误!']));
|
||||
}
|
||||
if($admin_info['status'] != 1){
|
||||
die(json_encode(['code'=>0,'msg'=>'该账户未激活!']));
|
||||
}
|
||||
$last_login_info = Db::name('admin')->where(array('id' => $admin_info['id']))->field(['last_login_time','last_login_ip'])->find();
|
||||
Session::set('last_login_info',$last_login_info);
|
||||
|
||||
// 生成login_token用于WebSocket连接验证
|
||||
$login_token = md5($admin_info['id'] . time() . uniqid());
|
||||
Db::name('admin')->where(array('id' => $admin_info['id']))->update(array(
|
||||
'last_login_time' => time(),
|
||||
'last_login_ip' => getIP(),
|
||||
'login_token' => $login_token
|
||||
));
|
||||
|
||||
$user_info = Db::name('admin')->where('id',$admin_info['id'])->find();
|
||||
Session::set('user_info',$user_info);
|
||||
insertAdminLog('登录');
|
||||
die(json_encode(['code'=>1,'msg'=>'登录成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登出
|
||||
*/
|
||||
public function logout(){
|
||||
insertAdminLog('退出');
|
||||
Session::set('user_info',"");
|
||||
Session::set('last_login_info',"");
|
||||
$this->redirect('/login/index',302);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
public function validateCode(){
|
||||
$validate = new ValidateCode();
|
||||
$validate->doimg();
|
||||
}
|
||||
}
|
||||
505
application/admin/controller/Memo.php
Normal file
505
application/admin/controller/Memo.php
Normal file
@ -0,0 +1,505 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class Memo extends Common{
|
||||
// 公告列表
|
||||
public function memo(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$title = Request::instance()->get('title');
|
||||
$status = Request::instance()->get('status');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 拼装查询条件
|
||||
$where = array();
|
||||
if($title) $where['title'] = array('like','%'.$title.'%');
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
|
||||
if($export == 1){
|
||||
$memo_list = Db::name('memo')->where('type', 'in', '1, 2')->where($where)->order('id desc')->select();
|
||||
}else{
|
||||
// 公告列表
|
||||
$memo_list = Db::name('memo')->where('type', 'in', '1, 2')->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($memo_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$v['table_name'] = Db::name('table')->where('id',$v['table_id'])->value('table_name');
|
||||
if($v['position'] == 1){
|
||||
$v['position'] = "投注页面";
|
||||
}
|
||||
if($v['position'] == 2){
|
||||
$v['position'] = "路单页面";
|
||||
}
|
||||
if($v['position'] == 3){
|
||||
$v['position'] = "所有页面";
|
||||
}
|
||||
$memo_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($memo_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($memo_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['table_name'];
|
||||
$excelData[$k][1] = $v['title'];
|
||||
$excelData[$k][2] = $v['url'];
|
||||
$excelData[$k][3] = $v['content'];
|
||||
$excelData[$k][4] = $v['remark'];
|
||||
$excelData[$k][5] = $v['position'];
|
||||
$excelData[$k][6] = $v['create_time'];
|
||||
if($v['status'] == 1){
|
||||
$excelData[$k][7] = '正常';
|
||||
}else{
|
||||
$excelData[$k][7] = '锁定中';
|
||||
}
|
||||
}
|
||||
$title = array('桌子名称','标题','链接地址','内容','备注','显示位置','创建时间','状态');
|
||||
$this->exportExcelCore($excelData, '公告列表', $title);
|
||||
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('memo_list',$memo_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 活动列表
|
||||
public function activity(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$title = Request::instance()->get('title');
|
||||
$status = Request::instance()->get('status');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 拼装查询条件
|
||||
$where = array();
|
||||
if($title) $where['title'] = array('like','%'.$title.'%');
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
if($export == 1){
|
||||
$memo_list = Db::name('memo')->where('type',2)->where($where)->order('id desc')->select();
|
||||
}else{
|
||||
// 活动列表
|
||||
$memo_list = Db::name('memo')->where('type',2)->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($memo_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$v['table_name'] = Db::name('table')->where('id',$v['table_id'])->value('table_name');
|
||||
if($v['position'] == 1){
|
||||
$v['position'] = "投注页面";
|
||||
}
|
||||
if($v['position'] == 2){
|
||||
$v['position'] = "路单页面";
|
||||
}
|
||||
if($v['position'] == 3){
|
||||
$v['position'] = "所有页面";
|
||||
}
|
||||
$memo_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($memo_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($memo_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['table_name'];
|
||||
$excelData[$k][1] = $v['title'];
|
||||
$excelData[$k][2] = $v['url'];
|
||||
$excelData[$k][3] = $v['content'];
|
||||
$excelData[$k][4] = $v['remark'];
|
||||
$excelData[$k][5] = $v['position'];
|
||||
$excelData[$k][6] = $v['create_time'];
|
||||
if($v['status'] == 1){
|
||||
$excelData[$k][7] = '正常';
|
||||
}else{
|
||||
$excelData[$k][7] = '锁定中';
|
||||
}
|
||||
}
|
||||
$title = array('桌子名称','标题','链接地址','内容','备注','显示位置','创建时间','状态');
|
||||
$this->exportExcelCore($excelData, '活动列表', $title);
|
||||
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('memo_list',$memo_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 添加公告
|
||||
public function memo_add(){
|
||||
$table_list = Db::name('table')->select();
|
||||
$this->assign('table_list',$table_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 添加活动
|
||||
public function activity_add(){
|
||||
$table_list = Db::name('table')->select();
|
||||
$this->assign('table_list',$table_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 处理添加公告和添加活动
|
||||
public function do_memo_add()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
|
||||
// 接收提交过来的数据
|
||||
//$table_id = Request::instance()->post('table_id');
|
||||
$title = Request::instance()->post('title');
|
||||
//$url = Request::instance()->post('url');
|
||||
//$content = Request::instance()->post('content');
|
||||
//$position = Request::instance()->post('position');
|
||||
//$remark = Request::instance()->post('remark');
|
||||
$type = intval(Request::instance()->post('type')); //区分公告和活动 1:公告 2:活动
|
||||
if( !isset($title) && empty($title) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'标题不能为空!']));
|
||||
}
|
||||
// 数据验证
|
||||
/*
|
||||
if($table_id == -1 || $table_id == ''){
|
||||
die(json_encode(['code'=>0,'msg'=>'请选择桌子!']));
|
||||
}
|
||||
if( !isset($url) && empty($url) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'链接不能为空!']));
|
||||
}
|
||||
if( !isset($content) && empty($content) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'内容不能为空!']));
|
||||
}
|
||||
if($position == -1 || $position == ''){
|
||||
die(json_encode(['code'=>0,'msg'=>'请选择公告位置!']));
|
||||
}
|
||||
if( !isset($remark) && empty($remark) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'备注不能为空!']));
|
||||
}
|
||||
*/
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['type'] = $type;
|
||||
$data['title'] = $title;
|
||||
/*
|
||||
$data['table_id'] = $table_id;
|
||||
$data['url'] = $url;
|
||||
$data['content'] = $content;
|
||||
$data['position'] = $position;
|
||||
$data['remark'] = $remark;
|
||||
$data['status'] = 1;
|
||||
*/
|
||||
$data['create_time'] = time();
|
||||
/*
|
||||
if($data['table_id'] == 'all'){
|
||||
$all_table = Db::name('table')->select();
|
||||
foreach($all_table as $k => $v){
|
||||
$data['table_id'] = $v['id'];
|
||||
$insert_id = Db::name('memo')->insertGetId($data);
|
||||
if(!$insert_id){
|
||||
die(json_encode(['code'=>0,'msg'=>$v['table_name'].'添加失败!']));
|
||||
}
|
||||
// 写入管理员日志
|
||||
if($type == 1){
|
||||
insertAdminLog('添加公告','添加公告:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}elseif($type == 2){
|
||||
insertAdminLog('添加活动','添加活动:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}
|
||||
}
|
||||
|
||||
}else if($data['table_id'] == 'all_baccarat'){
|
||||
$all_table = Db::name('table')->where('game_id',1)->select();
|
||||
foreach($all_table as $k => $v){
|
||||
$data['table_id'] = $v['id'];
|
||||
$insert_id = Db::name('memo')->insertGetId($data);
|
||||
if(!$insert_id){
|
||||
die(json_encode(['code'=>0,'msg'=>$v['table_name'].'添加失败!']));
|
||||
}
|
||||
// 写入管理员日志
|
||||
if($type == 1){
|
||||
insertAdminLog('添加公告','添加公告:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}elseif($type == 2){
|
||||
insertAdminLog('添加活动','添加活动:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}
|
||||
}
|
||||
}else if($data['table_id'] == 'all_dt'){
|
||||
$all_table = Db::name('table')->where('game_id',2)->select();
|
||||
foreach($all_table as $k => $v){
|
||||
$data['table_id'] = $v['id'];
|
||||
$insert_id = Db::name('memo')->insertGetId($data);
|
||||
if(!$insert_id){
|
||||
die(json_encode(['code'=>0,'msg'=>$v['table_name'].'添加失败!']));
|
||||
}
|
||||
// 写入管理员日志
|
||||
if($type == 1){
|
||||
insertAdminLog('添加公告','添加公告:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}elseif($type == 2){
|
||||
insertAdminLog('添加活动','添加活动:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
*/
|
||||
$insert_id = Db::name('memo')->insertGetId($data);
|
||||
if(!$insert_id){
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
// 写入管理员日志
|
||||
if($type == 1){
|
||||
insertAdminLog('添加公告','添加公告:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}elseif($type == 2){
|
||||
insertAdminLog('添加活动','添加活动:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
/*
|
||||
}
|
||||
|
||||
*/
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑公告
|
||||
public function memo_edit()
|
||||
{
|
||||
// 接收代理ID,查询代理信息
|
||||
$id = Request::instance()->get('id');
|
||||
$memo = Db::name('memo')->find($id);
|
||||
$table = Db::name('table')->find($memo['table_id']);
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('memo',$memo);
|
||||
$this->assign('table',$table);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 编辑活动
|
||||
public function activity_edit()
|
||||
{
|
||||
// 接收代理ID,查询代理信息
|
||||
$id = Request::instance()->get('id');
|
||||
$memo = Db::name('memo')->find($id);
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('memo',$memo);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
// 处理修改公告和修改活动
|
||||
public function do_memo_edit()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
|
||||
// 接收提交过来的数据
|
||||
$id = intval(Request::instance()->post('id'));
|
||||
$title = Request::instance()->post('title');
|
||||
/*
|
||||
$url = Request::instance()->post('url');
|
||||
$content = Request::instance()->post('content');
|
||||
$remark = Request::instance()->post('remark');
|
||||
$position = Request::instance()->post('position');
|
||||
*/
|
||||
$type = Request::instance()->post('type'); //区分公告和活动 1:公告 2:活动
|
||||
|
||||
// 数据验证
|
||||
if( !isset($title) && empty($title) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'标题不能为空!']));
|
||||
}
|
||||
/*
|
||||
if( !isset($content) && empty($content) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'内容不能为空!']));
|
||||
}
|
||||
*/
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['type'] = $type;
|
||||
$data['title'] = $title;
|
||||
/*
|
||||
$data['url'] = $url;
|
||||
$data['content'] = $content;
|
||||
$data['remark'] = $remark;
|
||||
$data['position'] = $position;
|
||||
$data['status'] = 1;
|
||||
*/
|
||||
$data['create_time'] = time();
|
||||
$insert_id = Db::name('memo')->where('id',$id)->update($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
if($type == 1){
|
||||
insertAdminLog('修改公告','修改公告:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}elseif($type == 2){
|
||||
insertAdminLog('修改活动','修改活动:| ID: '.$insert_id.' | 标题: '.$title);
|
||||
}
|
||||
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态(锁定和解锁)
|
||||
*/
|
||||
public function change_status()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收传过来的数据
|
||||
$id = Request::instance()->post('id');
|
||||
$status = Request::instance()->post('status');
|
||||
$type = Request::instance()->post('type');
|
||||
|
||||
// 数据验证
|
||||
if( !isset($id) && empty($id) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户不能为空!']));
|
||||
}
|
||||
if( !isset($status) && empty($status) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'状态不能为空!']));
|
||||
}
|
||||
|
||||
// 修改用户状态
|
||||
$result = Db::name('memo')->where('id',$id)->update(['status'=>$status]);
|
||||
if($status == 1) $msg = "解锁";
|
||||
if($status == 0) $msg = "锁定";
|
||||
if($type == 1) $type_msg = "公告";
|
||||
if($type == 2) $type_msg = "活动";
|
||||
if($result){
|
||||
insertAdminLog($msg.$type_msg,$msg.$type_msg.": | ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>$msg.'成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>$msg.'失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告或者活动
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('id');
|
||||
$type = Request::instance()->post('type');
|
||||
|
||||
// 删除公告或者活动
|
||||
$result = Db::name('memo')->delete($id);
|
||||
if($result){
|
||||
if($type == 1) $type_msg = "公告";
|
||||
if($type == 2) $type_msg = "活动";
|
||||
insertAdminLog('删除'.$type_msg,"删除".$type_msg.": | ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>'删除成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'删除失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function memo_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$title = Request::instance()->get('title');
|
||||
$status = Request::instance()->get('status');
|
||||
$where = array();
|
||||
if($title) $where['title'] = array('like','%'.$title.'%');
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
$memo_list = Db::name('memo')->where('type',1)->where($where)->order('id desc')->select();
|
||||
foreach($memo_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$v['table_name'] = Db::name('table')->where('id',$v['table_id'])->value('table_name');
|
||||
if($v['position'] == 1){
|
||||
$v['position'] = "投注页面";
|
||||
}
|
||||
if($v['position'] == 2){
|
||||
$v['position'] = "路单页面";
|
||||
}
|
||||
if($v['position'] == 3){
|
||||
$v['position'] = "所有页面";
|
||||
}
|
||||
$memo_list[$k] = $v;
|
||||
}
|
||||
$this->assign('memo_list',$memo_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function activity_print(){
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$title = Request::instance()->get('title');
|
||||
$status = Request::instance()->get('status');
|
||||
$where = array();
|
||||
if($title) $where['title'] = array('like','%'.$title.'%');
|
||||
if($status > 0){
|
||||
// 锁定不能用0作为判断,用2代替
|
||||
if($status == 2){
|
||||
$where['status'] = 0;
|
||||
}else{
|
||||
$where['status'] = $status;
|
||||
}
|
||||
}
|
||||
$memo_list = Db::name('memo')->where('type',2)->where($where)->order('id desc')->select();
|
||||
foreach($memo_list as $k => $v){
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$v['table_name'] = Db::name('table')->where('id',$v['table_id'])->value('table_name');
|
||||
if($v['position'] == 1){
|
||||
$v['position'] = "投注页面";
|
||||
}
|
||||
if($v['position'] == 2){
|
||||
$v['position'] = "路单页面";
|
||||
}
|
||||
if($v['position'] == 3){
|
||||
$v['position'] = "所有页面";
|
||||
}
|
||||
$memo_list[$k] = $v;
|
||||
}
|
||||
$this->assign('memo_list',$memo_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
2835
application/admin/controller/Pcapi.php
Executable file
2835
application/admin/controller/Pcapi.php
Executable file
File diff suppressed because it is too large
Load Diff
1715
application/admin/controller/Player.php
Executable file
1715
application/admin/controller/Player.php
Executable file
File diff suppressed because it is too large
Load Diff
596
application/admin/controller/Recharge.php
Normal file
596
application/admin/controller/Recharge.php
Normal file
@ -0,0 +1,596 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Recharge extends Common{
|
||||
/**
|
||||
* 代理列表
|
||||
*/
|
||||
public function index(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
$recharge_list = Db::name('receivables')->where('receivables_type',1)->where('type',1)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
foreach($recharge_list as $k => $v){
|
||||
$v['create_time'] = date("Y-m-d H:i",$v['create_time']);
|
||||
if($v['status'] == 1){
|
||||
$v['is_use'] = '使用中';
|
||||
}elseif($v['status'] == 0){
|
||||
$v['is_use'] = '禁用中';
|
||||
}
|
||||
$recharge_list[$k] = $v;
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('recharge_list',$recharge_list);
|
||||
$this->assign('query',$query);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function do_add_bank(){
|
||||
if(Request::instance()->post()){
|
||||
// 获取管理员信息
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
// 接收提交过来的数据
|
||||
$receivables_name = Request::instance()->post('receivables_name');
|
||||
$receivables_bank = Request::instance()->post('receivables_bank');
|
||||
$receivables_cardnum = Request::instance()->post('receivables_cardnum');
|
||||
$is_use = Request::instance()->post('is_use');
|
||||
// 数据验证
|
||||
if( !isset($receivables_name) && empty($receivables_name) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人姓名不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_bank) && empty($receivables_bank) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人银行不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_cardnum) && empty($receivables_cardnum) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人卡号不能为空!']));
|
||||
}
|
||||
if( !isset($is_use) && empty($is_use) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款银行卡状态不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['receivables_type'] = 1;
|
||||
$data['receivables_name'] = $receivables_name;
|
||||
$data['receivables_bank'] = $receivables_bank;
|
||||
$data['receivables_bank_number'] = $receivables_cardnum;
|
||||
$data['status'] = $is_use;
|
||||
$data['create_time'] = time();
|
||||
$data['type'] = 1;
|
||||
|
||||
$insert_id = Db::name('receivables')->insertGetId($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('添加收款银行卡','添加收款银行卡:| ID: '.$insert_id.' | 收款人: '.$receivables_name);
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function do_edit_bank(){
|
||||
if(Request::instance()->post()){
|
||||
// 获取管理员信息
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
// 接收提交过来的数据
|
||||
$id = Request::instance()->post('receivables_id');
|
||||
$receivables_name = Request::instance()->post('receivables_name');
|
||||
$receivables_bank = Request::instance()->post('receivables_bank');
|
||||
$receivables_cardnum = Request::instance()->post('receivables_cardnum');
|
||||
$is_use = Request::instance()->post('is_use');
|
||||
// 数据验证
|
||||
if( !isset($receivables_name) && empty($receivables_name) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人姓名不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_bank) && empty($receivables_bank) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人银行不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_cardnum) && empty($receivables_cardnum) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人卡号不能为空!']));
|
||||
}
|
||||
if( !isset($is_use) && empty($is_use) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款银行卡状态不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['receivables_type'] = 1;
|
||||
$data['receivables_name'] = $receivables_name;
|
||||
$data['receivables_bank'] = $receivables_bank;
|
||||
$data['receivables_bank_number'] = $receivables_cardnum;
|
||||
$data['status'] = $is_use;
|
||||
|
||||
$insert_id = Db::name('receivables')->where('id',$id)->update($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('修改收款银行卡','修改收款银行卡:| ID: '.$insert_id.' | 收款人: '.$receivables_name);
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function qr_code(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
$recharge_list = Db::name('receivables')->wherein('receivables_type','2,3')->where('type',1)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
foreach($recharge_list as $k => $v){
|
||||
$v['create_time'] = date("Y-m-d H:i",$v['create_time']);
|
||||
if($v['status'] == 1){
|
||||
$v['is_use'] = '使用中';
|
||||
}elseif($v['status'] == 0){
|
||||
$v['is_use'] = '禁用中';
|
||||
}
|
||||
if($v['receivables_type'] == 2){
|
||||
$v['receivables_type_word'] = '微信';
|
||||
}elseif($v['receivables_type'] == 3){
|
||||
$v['receivables_type_word'] = '支付宝';
|
||||
}
|
||||
$recharge_list[$k] = $v;
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('recharge_list',$recharge_list);
|
||||
$this->assign('query',$query);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function deposit() {
|
||||
if ($this->request->isPost() && $this->request->param('action') != 'upload') {
|
||||
$base64 = $this->request->param('base64');
|
||||
$base64 = str_replace(' ', '+', $base64);
|
||||
if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64, $result)) {
|
||||
|
||||
$type = $result[2];
|
||||
if (in_array($type,array('pjpeg','jpeg','jpg','gif','bmp','png'))) {
|
||||
$path = APP_PATH . '../public/static/admin/uploads/';
|
||||
|
||||
$fileName = time() . '.' . $type;
|
||||
$relPathFile = '/static/admin/uploads/' . $fileName;
|
||||
$absPathFile = $path . $fileName;
|
||||
|
||||
if (file_put_contents($absPathFile, base64_decode(str_replace($result[1], '', $base64)))) {
|
||||
//$this->success('上传成功');
|
||||
$this->success($relPathFile);
|
||||
} else {
|
||||
$this->error('上传失败');
|
||||
}
|
||||
} else {
|
||||
$this->error('非法操作,类型不允许!');
|
||||
}
|
||||
} else {
|
||||
$this->error('网络错误,请稍后再试');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public function do_add_code(){
|
||||
if(Request::instance()->post()){
|
||||
// 获取管理员信息
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
// 接收提交过来的数据
|
||||
$receivables_name = Request::instance()->post('receivables_name');
|
||||
$receivables_qr_code = Request::instance()->post('img_url');
|
||||
$code_type = Request::instance()->post('code_type');
|
||||
$is_use = Request::instance()->post('is_use');
|
||||
// 数据验证
|
||||
if( !isset($receivables_name) && empty($receivables_name) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款人姓名不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_qr_code) && empty($receivables_qr_code) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款二维码不能为空!']));
|
||||
}
|
||||
if( !isset($code_type) && empty($code_type) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款二维码类型不能为空!']));
|
||||
}
|
||||
if( !isset($is_use) && empty($is_use) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款二维码状态不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
if($code_type == 2){
|
||||
$data['receivables_type'] = 2;
|
||||
}elseif($code_type == 3){
|
||||
$data['receivables_type'] = 3;
|
||||
}
|
||||
$data['receivables_name'] = $receivables_name;
|
||||
$data['receivables_qr_code'] = $receivables_qr_code;
|
||||
$data['status'] = $is_use;
|
||||
$data['create_time'] = time();
|
||||
$data['type'] = 1;
|
||||
|
||||
if($is_use == 1){
|
||||
Db::name('receivables')->where('receivables_type',$code_type)->update(['status' => 0]);
|
||||
}
|
||||
$insert_id = Db::name('receivables')->insertGetId($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('添加收款二维码','添加收款二维码:| ID: '.$insert_id.' | 收款账号: '.$receivables_name);
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function do_edit_code(){
|
||||
if(Request::instance()->post()){
|
||||
// 获取管理员信息
|
||||
$user_info = Session::get('user_info');
|
||||
|
||||
// 接收提交过来的数据
|
||||
$id = Request::instance()->post('receivables_id');
|
||||
$receivables_name = Request::instance()->post('receivables_name');
|
||||
$receivables_type = Request::instance()->post('code_type');
|
||||
$is_use = Request::instance()->post('is_use');
|
||||
// 数据验证
|
||||
if( !isset($receivables_name) && empty($receivables_name) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款账号不能为空!']));
|
||||
}
|
||||
if( !isset($receivables_type) && empty($receivables_type) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款二维码类型不能为空!']));
|
||||
}
|
||||
if( !isset($is_use) && empty($is_use) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'收款银行卡状态不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['receivables_type'] = $receivables_type;
|
||||
$data['receivables_name'] = $receivables_name;
|
||||
$data['status'] = $is_use;
|
||||
if($is_use == 1){
|
||||
Db::name('receivables')->where('receivables_type',$receivables_type)->update(['status' => 0]);
|
||||
}
|
||||
$insert_id = Db::name('receivables')->where('id',$id)->update($data);
|
||||
if($insert_id){
|
||||
// 写入管理员日志
|
||||
insertAdminLog('修改收款二维码','修改收款二维码:| ID: '.$insert_id.' | 收款账号: '.$receivables_name);
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function recharge_record(){
|
||||
Session::set('allowSubmit',"YES");
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
// 接收搜索的条件信息
|
||||
$username = trim(Request::instance()->get('username'));
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
$where['record_type'] = 1;
|
||||
if($export == 1){
|
||||
$recharge_list = Db::name('receivables_record')->where($where)->order('id desc')->select();
|
||||
}else{
|
||||
//获取所有代理信息
|
||||
$recharge_list = Db::name('receivables_record')->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($recharge_list as $k => $v){
|
||||
$v['create_time'] = date("Y-m-d H:i",$v['create_time']);
|
||||
if($v['recharge_type'] == 1){
|
||||
$v['recharge_type'] = '银行卡充值';
|
||||
}elseif($v['recharge_type'] == 2){
|
||||
$v['recharge_type'] = '微信充值';
|
||||
}elseif($v['recharge_type'] == 3){
|
||||
$v['recharge_type'] = '支付宝充值';
|
||||
}
|
||||
if(!$v['recharge_bank']){
|
||||
$v['recharge_bank'] = '-';
|
||||
}
|
||||
if(!$v['recharge_cardnumber']){
|
||||
$v['recharge_cardnumber'] = '-';
|
||||
}
|
||||
$v['receivables_id'] = $v['recharge_type'].'-'.$v['receivables_id'];
|
||||
$recharge_list[$k] = $v;
|
||||
}
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($recharge_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($recharge_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['recharge_type'];
|
||||
$excelData[$k][2] = $v['receivables_id'];
|
||||
$excelData[$k][3] = $v['recharge_name'];
|
||||
$excelData[$k][4] = $v['recharge_bank'];
|
||||
$excelData[$k][5] = $v['recharge_cardnumber'];
|
||||
$excelData[$k][6] = $v['recharge_money'];
|
||||
$excelData[$k][7] = $v['create_time'];
|
||||
if($v['status'] == 0){
|
||||
$excelData[$k][8] = '未充值';
|
||||
}else{
|
||||
$excelData[$k][8] = '已充值';
|
||||
}
|
||||
$excelData[$k][9] = $v['controller_admin'];
|
||||
}
|
||||
$title = array('用户名','充值类型','收款方式ID','充值着账号/姓名','充值银行','充值银行账户','充值金额','创建时间','状态','操作员');
|
||||
$this->exportExcelCore($excelData, '充值列表', $title);
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('recharge_list',$recharge_list);
|
||||
$this->assign('query',$query);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function deal_recharge(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('recharge_id');
|
||||
|
||||
// 数据验证
|
||||
if(!$id){
|
||||
die(json_encode(['code'=>0,'msg'=>'充值记录不存在']));
|
||||
}
|
||||
$user_info = Session::get('user_info');
|
||||
$result = Db::name('receivables_record')->where('id',$id)->update(array('status' => 1,'controller_admin'=>$user_info['admin']));
|
||||
if($result){
|
||||
insertAdminLog('处理充值',"处理充值 | 订单ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>'充值成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'充值失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function withdrawal_record(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
// 接收搜索的条件信息
|
||||
$username = trim(Request::instance()->get('username'));
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
$where['record_type'] = 2;
|
||||
if($export == 1){
|
||||
$withdrawal_list = Db::name('receivables_record')->where($where)->order('id desc')->select();
|
||||
}else{
|
||||
//获取所有代理信息
|
||||
$withdrawal_list = Db::name('receivables_record')->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($withdrawal_list as $k => $v){
|
||||
$v['create_time'] = date("Y-m-d H:i",$v['create_time']);
|
||||
$withdrawal_list[$k] = $v;
|
||||
}
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($withdrawal_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($withdrawal_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['recharge_bank'];
|
||||
$excelData[$k][2] = $v['recharge_bank_branch'];
|
||||
$excelData[$k][3] = $v['recharge_cardnumber'];
|
||||
$excelData[$k][4] = $v['recharge_money'];
|
||||
$excelData[$k][5] = $v['create_time'];
|
||||
if($v['status'] == 0){
|
||||
$excelData[$k][6] = '未提现';
|
||||
}else{
|
||||
$excelData[$k][6] = '已提现';
|
||||
}
|
||||
$excelData[$k][7] = $v['controller_admin'];
|
||||
}
|
||||
$title = array('用户名','提现银行','提现银行支行','提现银行账户','提现金额','创建时间','状态','操作员');
|
||||
$this->exportExcelCore($excelData, '提现列表', $title);
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('withdrawal_list',$withdrawal_list);
|
||||
$this->assign('query',$query);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function deal_withdrawal(){
|
||||
if(Request::instance()->post()){
|
||||
$user_info = Session::get('user_info');
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('recharge_id');
|
||||
// 数据验证
|
||||
$receivables_record = Db::name('receivables_record')->where(array('id' => $id, 'record_type' => 2))->find();
|
||||
if(!$receivables_record){
|
||||
die(json_encode(['code'=>0,'msg'=>'提现记录不存在']));
|
||||
}
|
||||
if($receivables_record['status'] > 0){
|
||||
die(json_encode(['code'=>0,'msg'=>'该记录已经处理过了']));
|
||||
}
|
||||
$user = Db::name('user')->where(array('id' => $receivables_record['user_id'], 'status' => 1, 'is_delete' => 0, 'agent' => 0))->find();
|
||||
if(!$user){
|
||||
die(json_encode(['code'=>0,'msg'=>'没找到相关会员信息']));
|
||||
}
|
||||
$zdlIdArr = explode(',',$user['agent_parent_id_path']);
|
||||
$zdlId = $zdlIdArr[0];
|
||||
$zdl = Db::name('user')->where(array('id' => $zdlId, 'status' => 1, 'is_delete' => 0, 'agent' => 1))->find();
|
||||
if(!$zdl){
|
||||
die(json_encode(['code'=>0,'msg'=>'所属总代理账号异常,暂不能提现']));
|
||||
}
|
||||
//防止重复提交
|
||||
$allowSubmit = Session::get('allowSubmit');
|
||||
if($allowSubmit == 'YES'){
|
||||
Session::delete('allowSubmit');
|
||||
}else{
|
||||
Session::delete('allowSubmit');
|
||||
return json(array('code' => 0, 'msg' => "请勿重复提交"));
|
||||
}
|
||||
//插入上分表并增加余分 总代理
|
||||
$recharge = array();
|
||||
$recharge['type'] = 5;
|
||||
$recharge['amount'] = $receivables_record['recharge_money'];
|
||||
$recharge['mode'] = 1;
|
||||
$recharge['agent_or_admin'] = 3;
|
||||
$recharge['user_id'] = $zdl['id'];
|
||||
$recharge['user_type'] = $zdl['agent'];
|
||||
$recharge['user_agent_level'] = 0;
|
||||
$recharge['username_for'] = $zdl['username'];
|
||||
$recharge['nickname_for'] = $zdl['nickname'];
|
||||
$recharge['user_parent_id'] = $zdl['agent_parent_id'];
|
||||
$recharge['admin_id'] = $user_info['id'];
|
||||
$recharge['admin_user_name'] = $user_info['admin'];
|
||||
$recharge['create_time'] = time();
|
||||
$recharge['old_money'] = $zdl['money'];
|
||||
$recharge['new_money'] = $zdl['money'] + $receivables_record['recharge_money'];
|
||||
$recharge['controller_system'] = 3;
|
||||
$recharge['remake'] = '总后台操作允许玩家提现,提现金额加到所属总代余额上';
|
||||
Db::name('recharge')->insert($recharge);
|
||||
//插入上分表 记录玩家余分变动
|
||||
$rechargeUser = array();
|
||||
$rechargeUser['type'] = 5;
|
||||
$rechargeUser['amount'] = $receivables_record['recharge_money'];
|
||||
$rechargeUser['mode'] = 2;
|
||||
$rechargeUser['agent_or_admin'] = 3;
|
||||
$rechargeUser['controller_id'] = $zdl['id'];
|
||||
$rechargeUser['controller_username'] = $zdl['username'];
|
||||
$rechargeUser['controller_nickname'] = $zdl['nickname'];
|
||||
$rechargeUser['controller_type'] = '总后台操作允许玩家提现,提现金额加到所属总代余额上';
|
||||
$rechargeUser['controller_old_money'] = $zdl['money'];
|
||||
$rechargeUser['controller_new_money'] = $zdl['money'] + $receivables_record['recharge_money'];
|
||||
$rechargeUser['user_id'] = $user['id'];
|
||||
$rechargeUser['user_type'] = $user['agent'];
|
||||
$rechargeUser['user_agent_level'] = 0;
|
||||
$rechargeUser['username_for'] = $user['username'];
|
||||
$rechargeUser['nickname_for'] = $user['nickname'];
|
||||
$rechargeUser['user_parent_id'] = $user['agent_parent_id'];
|
||||
$rechargeUser['admin_id'] = $user_info['id'];
|
||||
$rechargeUser['admin_user_name'] = $user_info['admin'];
|
||||
$rechargeUser['create_time'] = time();
|
||||
$rechargeUser['old_money'] = $user['money'] + $receivables_record['recharge_money'];
|
||||
$rechargeUser['new_money'] = $user['money'];
|
||||
$rechargeUser['controller_system'] = 3;
|
||||
$rechargeUser['remake'] = '总后台操作允许玩家提现,提现金额加到所属总代余额上';
|
||||
Db::name('recharge')->insert($rechargeUser);
|
||||
$zdlMoney = $zdl['money'] + $receivables_record['recharge_money'];
|
||||
Db::name('user')->where(array('id' => $zdlId))->limit(1)->update(array('money' => $zdlMoney));
|
||||
$result = Db::name('receivables_record')->where('id',$id)->update(array('status' => 1,'controller_admin'=>$user_info['admin']));
|
||||
if($result){
|
||||
insertAdminLog('提现充值',"提现充值 | 订单ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>'提现成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'提现失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'页面错误']));
|
||||
}
|
||||
}
|
||||
public function do_add_remarks(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('record_id');
|
||||
$remarks = Request::instance()->post('remarks');
|
||||
// 数据验证
|
||||
if(!$id){
|
||||
die(json_encode(['code'=>0,'msg'=>'提现记录不存在']));
|
||||
}
|
||||
if(!$remarks){
|
||||
die(json_encode(['code'=>0,'msg'=>'原因不能为空']));
|
||||
}
|
||||
$record_info = Db::name('receivables_record')->where('id',$id)->find();
|
||||
$player_info = Db::name('user')->where('id',$record_info['user_id'])->find();
|
||||
$user_info = Session::get('user_info');
|
||||
$result = Db::name('receivables_record')->where('id',$id)->update(array('status' => 2,'controller_admin'=>$user_info['admin'],'remarks'=>$remarks));
|
||||
if($result){
|
||||
$new_money = $player_info['money'] + $record_info['recharge_money'];
|
||||
Db::name('user')->where('id',$record_info['user_id'])->update(array('money' => $new_money));
|
||||
insertAdminLog('拒绝提现',"拒绝提现 | 订单ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>'拒绝成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'拒绝失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
public function do_add_remarks_recharge(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收数据
|
||||
$id = Request::instance()->post('record_id');
|
||||
$remarks = Request::instance()->post('remarks');
|
||||
// 数据验证
|
||||
if(!$id){
|
||||
die(json_encode(['code'=>0,'msg'=>'充值记录不存在']));
|
||||
}
|
||||
if(!$remarks){
|
||||
die(json_encode(['code'=>0,'msg'=>'原因不能为空']));
|
||||
}
|
||||
$user_info = Session::get('user_info');
|
||||
$result = Db::name('receivables_record')->where('id',$id)->update(array('status' => 2,'controller_admin'=>$user_info['admin'],'remarks'=>$remarks));
|
||||
if($result){
|
||||
insertAdminLog('拒绝充值',"拒绝充值 | 订单ID: ".$id);
|
||||
die(json_encode(['code'=>1,'msg'=>'拒绝成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'拒绝失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置
|
||||
*/
|
||||
public function setting()
|
||||
{
|
||||
$system = Db::name('system')->find();
|
||||
$this->assign('system',$system);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function saveSetting()
|
||||
{
|
||||
$post = Request::instance()->post();
|
||||
$data = [
|
||||
'recharge_money' => $post['recharge_money'],
|
||||
'withdraw_money' => $post['withdraw_money'],
|
||||
'withdraw_fee' => $post['withdraw_fee']
|
||||
];
|
||||
$system = Db::name('system')->find();
|
||||
if($system){
|
||||
$res = Db::name('system')->where('id',$system['id'])->update($data);
|
||||
}else{
|
||||
$res = Db::name('system')->insert($data);
|
||||
}
|
||||
|
||||
if($res){
|
||||
insertAdminLog('充值提现配置',"修改充值提现配置 ");
|
||||
die(json_encode(['code'=>1,'msg'=>'操作成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>1,'msg'=>'操作失败!']));
|
||||
}
|
||||
}
|
||||
}
|
||||
445
application/admin/controller/Report.php
Normal file
445
application/admin/controller/Report.php
Normal file
@ -0,0 +1,445 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use pay\Usdt;
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Report extends Common{
|
||||
// 收益报表
|
||||
public function profit(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收查询条件
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$username = Request::instance()->get('username');
|
||||
$export = Request::instance()->get('export');
|
||||
$agent_id = Request::instance()->get('agent_id');
|
||||
|
||||
// 代理查询条件
|
||||
$where = array();
|
||||
// $where['agent_parent_id'] = 0;
|
||||
$where['agent'] = 1;
|
||||
if($username){
|
||||
$where['username'] = $username;
|
||||
unset($where['agent_parent_id']);
|
||||
}
|
||||
if($agent_id > 0){
|
||||
$where['agent_parent_id'] = $agent_id;
|
||||
}
|
||||
$agent_list = Db::name('user')->where($where)->select();
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 数据查询条件
|
||||
$timeWhere = array();
|
||||
$timeWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$dataAgent = array();
|
||||
foreach($agent_list as $k => $v){
|
||||
// 查询是否有下级代理
|
||||
$v['child_agent'] = Db::name('user')->where('agent_parent_id',$v['id'])->count();
|
||||
// 自己的洗码收益
|
||||
$v['self_income_xima'] = Db::name('xima')->where('user_id',$v['id'])->where($timeWhere)->sum('maliang');
|
||||
$v['self_income_xima'] = $v['self_income_xima'] * (1 - $v['agent_cs']/100);
|
||||
// 自己的占成收益
|
||||
$v['self_income_cs'] = Db::name('cs')->where('user_id',$v['id'])->where($timeWhere)->sum('share_amount');
|
||||
// 总收益(自己的洗码 + 自己的占成)
|
||||
$v['total_income'] = $v['self_income_xima'] + $v['self_income_cs'];
|
||||
// 有数据才显示
|
||||
if($v['total_income'] != 0){
|
||||
$dataAgent[] = $v;
|
||||
}
|
||||
}
|
||||
$agent_list = $dataAgent;
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($agent_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($agent_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['agent_cs'];
|
||||
$excelData[$k][2] = $v['self_income_cs'];
|
||||
$excelData[$k][3] = $v['self_income_xima'];
|
||||
$excelData[$k][4] = $v['agent_ximalv'];
|
||||
$excelData[$k][5] = $v['total_income'];
|
||||
}
|
||||
$title = array('用户名','占成','占成收益','洗码率','洗码收益','总收益金额');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '收益日报表-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '收益日报表', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('agent_list',$agent_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
// 收益报表打印
|
||||
public function profit_print(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$username = Request::instance()->get('username');
|
||||
$agent_id = Request::instance()->get('agent_id');
|
||||
|
||||
// 代理查询条件
|
||||
$where = array();
|
||||
$where['agent_parent_id'] = 0;
|
||||
$where['agent'] = 1;
|
||||
if($username){
|
||||
$where['username'] = $username;
|
||||
unset($where['agent_parent_id']);
|
||||
}
|
||||
if($agent_id > 0){
|
||||
$where['agent_parent_id'] = $agent_id;
|
||||
}
|
||||
$agent_list = Db::name('user')->where($where)->select();
|
||||
|
||||
// 统计数据的时间条件
|
||||
if(!$startDate){
|
||||
// 默认日期为当天
|
||||
$startDate = date('Y-m-d H:i:s',strtotime(date('Y-m-d')));
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
}else{
|
||||
$startTime = strtotime($startDate);
|
||||
}
|
||||
if(!$endDate){
|
||||
// 默认日期为当天
|
||||
$endDate = date('Y-m-d H:i:s',time());
|
||||
$endTime = time();
|
||||
}else{
|
||||
$endTime = strtotime($endDate);
|
||||
}
|
||||
|
||||
// 查询数据条件
|
||||
$timeWhere = array();
|
||||
$timeWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$dataAgent = array();
|
||||
foreach($agent_list as $k => $v){
|
||||
// 自己的洗码收益
|
||||
$v['self_income_xima'] = Db::name('xima')->where('user_id',$v['id'])->where($timeWhere)->sum('maliang');
|
||||
$v['self_income_xima'] = $v['self_income_xima'] * (1 - $v['agent_cs']/100);
|
||||
// 自己的占成收益
|
||||
$v['self_income_cs'] = Db::name('cs')->where('user_id',$v['id'])->where($timeWhere)->sum('share_amount');
|
||||
// 总收益
|
||||
$v['total_income'] = $v['self_income_xima'] + $v['self_income_cs'];
|
||||
// 有数据才显示
|
||||
if($v['total_income'] != 0){
|
||||
$dataAgent[] = $v;
|
||||
}
|
||||
}
|
||||
$agent_list = $dataAgent;
|
||||
// 渲染参数和模板
|
||||
$this->assign('agent_list',$agent_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
// 充值查询
|
||||
public function user_recharge(){
|
||||
|
||||
// 用于分页和搜索查询的数据
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收参数
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$username = Request::instance()->get('username');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 转换日期时间
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = 0;
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
}
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
$whereStr = '';
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
if($username){
|
||||
$user = Db::connect('DB2')->name('user')->where(['username'=>$username,'is_delete'=>0])->find();
|
||||
if($user){
|
||||
// $where['user_id'] = $user['id'];
|
||||
$whereStr = "find_in_set({$user['id']},u.agent_parent_id_path)";
|
||||
}else{
|
||||
$where['user_id'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$list = Db::connect('DB2')->name('user_recharge')
|
||||
->alias('r')
|
||||
->field('r.*,u.username,u.nickname')
|
||||
->join('cg_user u','r.user_id=u.id')
|
||||
->where($where)
|
||||
->where($whereStr)
|
||||
->order('r.id desc')
|
||||
->paginate(20,false,array('query'=>$get));
|
||||
foreach($list as $k => $v){
|
||||
// 信息组装
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
|
||||
// 数据格式转换
|
||||
$v['amount'] = round($v['amount'],2);
|
||||
$v['old_money'] = round($v['old_money'],2);
|
||||
$v['new_money'] = round($v['new_money'],2);
|
||||
$list[$k] = $v;
|
||||
}
|
||||
|
||||
// 汇总金额
|
||||
$total = Db::connect('DB2')
|
||||
->name('user_recharge')
|
||||
->alias('r')
|
||||
->field('sum(r.amount) as amount, sum(r.money) as money')
|
||||
->join('cg_user u','r.user_id=u.id')
|
||||
->where($where)->find();
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($list AS $k => $v){
|
||||
$excelData[$k][] = $v['nickname'];
|
||||
$excelData[$k][] = $v['username'];
|
||||
$excelData[$k][] = $v['amount'];
|
||||
$excelData[$k][] = $v['money'];
|
||||
$excelData[$k][] = $v['old_money'];
|
||||
$excelData[$k][] = $v['new_money'];
|
||||
$excelData[$k][] = $v['out_trade_no'];
|
||||
$excelData[$k][] = $v['from_addr'];
|
||||
$excelData[$k][] = $v['to_addr'];
|
||||
}
|
||||
$title = array('用户名','帐号','充值U币','充值金额','充值前余额','充值后余额','外部交易号','转账地址','入账地址');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '充值报表-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '充值报表', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('list',$list);
|
||||
$this->assign('total',$total);
|
||||
return $this->fetch();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 提现查询
|
||||
public function user_withdraw(){
|
||||
// 用于分页和搜索查询的数据
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收参数
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$username = Request::instance()->get('username');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 转换日期时间
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = 0;
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
}
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
$whereStr = '';
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
if($username){
|
||||
$user = Db::connect('DB2')->name('user')->where(['username'=>$username,'is_delete'=>0])->find();
|
||||
if($user){
|
||||
// $where['user_id'] = $user['id'];
|
||||
$whereStr = "find_in_set({$user['id']},u.agent_parent_id_path)";
|
||||
}else{
|
||||
$where['user_id'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$list = Db::connect('DB2')->name('user_withdraw')
|
||||
->alias('r')
|
||||
->field('r.*,u.username,u.nickname')
|
||||
->join('cg_user u','r.user_id=u.id')
|
||||
->where($where)
|
||||
->where($whereStr)
|
||||
->order('r.id desc')
|
||||
->paginate(20,false,array('query'=>$get));
|
||||
|
||||
|
||||
// 提现状态
|
||||
$status = [
|
||||
'SUCCESS' => "提现成功",
|
||||
'FAIL' => "提现失败",
|
||||
'WAIT' => "等待审核",
|
||||
'AGREE' => "已同意",
|
||||
'DISAGREE' => "已拒绝",
|
||||
'CANCEL' => "已取消",
|
||||
];
|
||||
foreach($list as $k => $v){
|
||||
// 信息组装
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
// 提现状态
|
||||
$v['status_msg'] = $status[$v['status']];
|
||||
|
||||
// 操作类型
|
||||
if($v['operator_source'] == 1){
|
||||
$v['operator_source_msg'] = '总台操作';
|
||||
}else if($v['operator_source'] == 2){
|
||||
$v['operator_source_msg'] = '代理操作';
|
||||
}else{
|
||||
$v['operator_source_msg'] = '';
|
||||
}
|
||||
// 数据格式转换
|
||||
$v['amount'] = round($v['amount'],2);
|
||||
$v['old_money'] = round($v['old_money'],2);
|
||||
$v['new_money'] = round($v['new_money'],2);
|
||||
$list[$k] = $v;
|
||||
}
|
||||
|
||||
// 汇总金额
|
||||
$total = Db::connect('DB2')
|
||||
->name('user_withdraw')
|
||||
->alias('r')
|
||||
->field('sum(r.amount) as amount, sum(r.service_fee) as service_fee, sum(r.money) as money, sum(r.service_fee_money) as service_fee_money')
|
||||
->join('cg_user u','r.user_id=u.id')
|
||||
->where($where)->find();
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($list AS $k => $v){
|
||||
$excelData[$k][] = $v['create_time'];
|
||||
$excelData[$k][] = $v['nickname'];
|
||||
$excelData[$k][] = $v['username'];
|
||||
$excelData[$k][] = $v['amount'];
|
||||
$excelData[$k][] = $v['service_fee'];
|
||||
$excelData[$k][] = $v['money'];
|
||||
$excelData[$k][] = $v['service_fee_money'];
|
||||
$excelData[$k][] = $v['old_money'];
|
||||
$excelData[$k][] = $v['new_money'];
|
||||
$excelData[$k][] = $v['status_msg'];
|
||||
$excelData[$k][] = $v['operator_nickname']."(".$v['operator_username'].")";
|
||||
$excelData[$k][] = $v['operator_source_msg'];
|
||||
}
|
||||
$title = array('时间','用户名','帐号','提现U币','手续费(U币)','提现金额','手续费金额','提现前余额','提现后余额','审核状态','操作人[账号]','操作类型');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '提现报表-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '提现报表', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('list',$list);
|
||||
$this->assign('total',$total);
|
||||
return $this->fetch();
|
||||
}
|
||||
// 处理提现
|
||||
public function doUserWithdraw()
|
||||
{
|
||||
if(Request::instance()->isPost()){
|
||||
// 总代类型判断 1现金线
|
||||
$user_info = Session::get('user_info');
|
||||
$user_info = Db::connect('DB2')->name('admin')->where('id',$user_info['id'])->find();
|
||||
|
||||
$id = Request::instance()->post('id');
|
||||
$withdraw = Db::name('user_withdraw')->where('id',$id)->find();
|
||||
if(empty($withdraw) || $withdraw['status'] != "WAIT"){
|
||||
die(json_encode(['code'=>0,'msg'=>'非待审核状态无法操作!']));
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
$Usdt = new Usdt();
|
||||
$res = $Usdt->applyUserWithdraw($withdraw['order_no'],$withdraw['to_address'],$withdraw['amount']);
|
||||
if($res['code'] == 0){
|
||||
Db::name('user_withdraw')->where('id',$id)->update([
|
||||
'status' => 'AGREE',
|
||||
'type' => $res['processor']['asset'],
|
||||
'from_address' => $res['processor']['from_addr'],
|
||||
'audit_time' => time(),
|
||||
'operator_source' => 2,
|
||||
'operator_id' => $user_info['id'],
|
||||
'operator_username' => $user_info['admin'],
|
||||
]);
|
||||
die(json_encode(['code'=>1,'msg'=>'审核通过!']));
|
||||
}else{
|
||||
Db::startTrans();
|
||||
|
||||
// 退返余额
|
||||
$user = Db::name('user')->where('id',$withdraw['user_id'])->lock(true)->find();
|
||||
$money = $user['money'] + $withdraw['money'] + $withdraw['service_fee_money'];
|
||||
Db::name('user')->where('id',$withdraw['user_id'])->update(['money' => $money]);
|
||||
|
||||
// 更新记录
|
||||
Db::name('user_withdraw')->where('id',$id)->update([
|
||||
'status' => 'FAIL',
|
||||
'err_msg' => $res['debug'],
|
||||
'audit_time' => time(),
|
||||
'operator_source' => 2,
|
||||
'operator_id' => $user_info['id'],
|
||||
'operator_username' => $user_info['admin']
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
die(json_encode(['code'=>0,'msg'=>'提现失败!']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
847
application/admin/controller/Table.php
Normal file
847
application/admin/controller/Table.php
Normal file
@ -0,0 +1,847 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Table extends Common{
|
||||
/**
|
||||
* 百家乐桌子账目
|
||||
*/
|
||||
public function baccarat()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收查询条件
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 百家乐所有桌子信息
|
||||
$table_list = Db::name('table')->where('game_id',1)->select();
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',1)->where('id',$table_id)->paginate(10,false,array('query'=>$get));
|
||||
}else{
|
||||
if($export == 1){
|
||||
$table = Db::name('table')->where('game_id',1)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',1)->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
}
|
||||
|
||||
// 定义百家乐汇总参数
|
||||
$total_baccarat = array();
|
||||
$total_baccarat['total_sum'] = 0;
|
||||
$total_baccarat['total_win_sum'] = 0;
|
||||
$total_baccarat['ximaliang'] = 0;
|
||||
$total_baccarat['total_maliang'] = 0;
|
||||
$total_baccarat['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装数据
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
//庄下注总额
|
||||
$v['bankerSum'] = Db::name('bet')->where($betWhere)->sum('banker_amount');
|
||||
//闲下注总额
|
||||
$v['playerSum'] = Db::name('bet')->where($betWhere)->sum('player_amount');
|
||||
//和下注总额
|
||||
$v['tieSum'] = Db::name('bet')->where($betWhere)->sum('tie_amount');
|
||||
//庄对下注总额
|
||||
$v['bankerPairSum'] = Db::name('bet')->where($betWhere)->sum('banker_pair_amount');
|
||||
//闲对下注总额
|
||||
$v['playerPairSum'] = Db::name('bet')->where($betWhere)->sum('player_pair_amount');
|
||||
//庄次数
|
||||
$betCountWhere['result'] = 1;
|
||||
$v['bankerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//闲次数
|
||||
$betCountWhere['result'] = 2;
|
||||
$v['playerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//和次数
|
||||
$betCountWhere['result'] = 3;
|
||||
$v['tieCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//庄对次数
|
||||
unset($betCountWhere['result']);
|
||||
$betCountWhere['pair'] = 1;
|
||||
$v['bankerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//闲对次数
|
||||
$betCountWhere['pair'] = 2;
|
||||
$v['playerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//庄闲对次数
|
||||
$betCountWhere['pair'] = 3;
|
||||
$v['bankerPlayerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['bankerSum'] + $v['playerSum'] + $v['tieSum'] + $v['bankerPairSum'] + $v['playerPairSum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//洗码量
|
||||
$v['ximaliang'] = Db::name('xima')->where($ximaWhere)->sum('ximaliang');
|
||||
//码量
|
||||
$v['totalMaliang'] = Db::name('xima')->where($ximaWhere)->sum('maliang');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_baccarat['total_sum'] += $v['totalSum'];
|
||||
$total_baccarat['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_baccarat['ximaliang'] += $v['ximaliang'];
|
||||
$total_baccarat['total_maliang'] += $v['totalMaliang'];
|
||||
$total_baccarat['income'] += $v['income'];
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($table){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($table AS $k => $v){
|
||||
$excelData[$k][0] = $v['table_name'];
|
||||
$excelData[$k][1] = $v['bankerSum'];
|
||||
$excelData[$k][2] = $v['playerSum'];
|
||||
$excelData[$k][3] = $v['tieSum'];
|
||||
$excelData[$k][4] = $v['bankerPairSum'];
|
||||
$excelData[$k][5] = $v['playerPairSum'];
|
||||
$excelData[$k][6] = $v['bankerCount'];
|
||||
$excelData[$k][7] = $v['playerCount'];
|
||||
$excelData[$k][8] = $v['tieCount'];
|
||||
$excelData[$k][9] = $v['bankerPairCount'];
|
||||
$excelData[$k][10] = $v['playerPairCount'];
|
||||
$excelData[$k][11] = $v['bankerPlayerPairCount'];
|
||||
$excelData[$k][12] = $v['totalSum'];
|
||||
$excelData[$k][13] = $v['totalWinSum'];
|
||||
$excelData[$k][14] = $v['ximaliang'];
|
||||
$excelData[$k][15] = $v['totalMaliang'];
|
||||
$excelData[$k][16] = $v['income'];
|
||||
}
|
||||
$title = array('桌号','庄(下注额)','闲(下注额)','和(下注额)','庄对(下注额)','闲对(下注额)','庄(次)','闲(次)','和(次)','庄对(次)','闲对(次)','庄闲对(次)','总押','会员赢','洗码量','码量','收益');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '百家乐桌子账目-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '百家乐桌子账目', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('table',$table);
|
||||
$this->assign('table_list',$table_list);
|
||||
$this->assign('total_baccarat',$total_baccarat);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 龙虎斗桌子账目
|
||||
*/
|
||||
public function dt()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收查询条件
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 百家乐所有桌子信息
|
||||
$table_list = Db::name('table')->where('game_id',2)->select();
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',2)->where('id',$table_id)->paginate(10,false,array('query'=>$get));
|
||||
}else{
|
||||
if($export == 1){
|
||||
$table = Db::name('table')->where('game_id',2)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',2)->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
}
|
||||
|
||||
// 定义百家乐汇总参数
|
||||
$total_dt = array();
|
||||
$total_dt['total_sum'] = 0;
|
||||
$total_dt['total_win_sum'] = 0;
|
||||
$total_dt['ximaliang'] = 0;
|
||||
$total_dt['total_maliang'] = 0;
|
||||
$total_dt['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装数据
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
//龙下注总额
|
||||
$v['bankerSum'] = Db::name('bet')->where($betWhere)->sum('banker_amount');
|
||||
//虎下注总额
|
||||
$v['playerSum'] = Db::name('bet')->where($betWhere)->sum('player_amount');
|
||||
//和下注总额
|
||||
$v['tieSum'] = Db::name('bet')->where($betWhere)->sum('tie_amount');
|
||||
//龙次数
|
||||
$betCountWhere['result'] = 1;
|
||||
$v['bankerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//虎次数
|
||||
$betCountWhere['result'] = 2;
|
||||
$v['playerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//和次数
|
||||
$betCountWhere['result'] = 3;
|
||||
$v['tieCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['bankerSum'] + $v['playerSum'] + $v['tieSum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_dt['total_sum'] += $v['totalSum'];
|
||||
$total_dt['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_dt['income'] += $v['income'];
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($table){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($table AS $k => $v){
|
||||
$excelData[$k][0] = $v['table_name'];
|
||||
$excelData[$k][1] = $v['bankerSum'];
|
||||
$excelData[$k][2] = $v['playerSum'];
|
||||
$excelData[$k][3] = $v['tieSum'];
|
||||
$excelData[$k][4] = $v['bankerCount'];
|
||||
$excelData[$k][5] = $v['playerCount'];
|
||||
$excelData[$k][6] = $v['tieCount'];
|
||||
$excelData[$k][7] = $v['totalSum'];
|
||||
$excelData[$k][8] = $v['totalWinSum'];
|
||||
$excelData[$k][9] = $v['income'];
|
||||
}
|
||||
$title = array('桌号','龙(下注额)','虎(下注额)','和(下注额)','龙(次)','虎(次)','和(次)','总押','会员赢','收益');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '龙虎斗桌子账目-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '龙虎斗桌子账目', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('table',$table);
|
||||
$this->assign('table_list',$table_list);
|
||||
$this->assign('total_dt',$total_dt);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 牛牛桌子账目
|
||||
*/
|
||||
public function nn()
|
||||
{
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收查询条件
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
$export = Request::instance()->get('export');
|
||||
|
||||
// 牛牛所有桌子信息
|
||||
$table_list = Db::name('table')->where('game_id',4)->select();
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',4)->where('id',$table_id)->paginate(10,false,array('query'=>$get));
|
||||
}else{
|
||||
if($export == 1){
|
||||
$table = Db::name('table')->where('game_id',4)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',4)->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
}
|
||||
|
||||
// 定义牛牛汇总参数
|
||||
$total_nn = array();
|
||||
$total_nn['total_sum'] = 0;
|
||||
$total_nn['total_win_sum'] = 0;
|
||||
$total_nn['ximaliang'] = 0;
|
||||
$total_nn['total_maliang'] = 0;
|
||||
$total_nn['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装数据
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
$v['amount_player_1_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1');
|
||||
$v['amount_player_1_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_times');
|
||||
$v['amount_player_1_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_banker');
|
||||
$v['amount_player_1_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_banker_times');
|
||||
$v['amount_player_2_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2');
|
||||
$v['amount_player_2_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_times');
|
||||
$v['amount_player_2_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_banker');
|
||||
$v['amount_player_2_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_banker_times');
|
||||
$v['amount_player_3_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3');
|
||||
$v['amount_player_3_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_times');
|
||||
$v['amount_player_3_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_banker');
|
||||
$v['amount_player_3_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_banker_times');
|
||||
//闲一次数
|
||||
$win_player_1['win_player_1'] = 1;
|
||||
$v['win_player_1'] = Db::name('number_tab')->where($win_player_1)->count();
|
||||
//闲二次数
|
||||
$win_player_2['win_player_2'] = 1;
|
||||
$v['win_player_2'] = Db::name('number_tab')->where($win_player_2)->count();
|
||||
//闲三次数
|
||||
$win_player_3['win_player_3'] = 1;
|
||||
$v['win_player_3'] = Db::name('number_tab')->where($win_player_3)->count();
|
||||
//庄次数
|
||||
$win_banker['win_player_1'] = 0;
|
||||
$win_banker['win_player_2'] = 0;
|
||||
$win_banker['win_player_2'] = 0;
|
||||
$v['win_banker'] = Db::name('number_tab')->where($win_banker)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['amount_player_1_Sum'] + $v['amount_player_1_times_Sum']+ $v['amount_player_1_banker_Sum']+ $v['amount_player_1_banker_times_Sum']+$v['amount_player_2_Sum'] + $v['amount_player_2_times_Sum']+ $v['amount_player_2_banker_Sum']+ $v['amount_player_2_banker_times_Sum']+$v['amount_player_3_Sum'] + $v['amount_player_3_times_Sum']+ $v['amount_player_3_banker_Sum']+ $v['amount_player_3_banker_times_Sum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_nn['total_sum'] += $v['totalSum'];
|
||||
$total_nn['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_nn['income'] += $v['income'];
|
||||
}
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($table){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($table AS $k => $v){
|
||||
$excelData[$k][0] = $v['table_name'];
|
||||
$excelData[$k][1] = $v['amount_player_1_Sum'];
|
||||
$excelData[$k][2] = $v['amount_player_1_times_Sum'];
|
||||
$excelData[$k][3] = $v['amount_player_1_banker_Sum'];
|
||||
$excelData[$k][4] = $v['amount_player_1_banker_times_Sum'];
|
||||
$excelData[$k][5] = $v['amount_player_2_Sum'];
|
||||
$excelData[$k][6] = $v['amount_player_2_times_Sum'];
|
||||
$excelData[$k][7] = $v['amount_player_2_banker_Sum'];
|
||||
$excelData[$k][8] = $v['amount_player_2_banker_times_Sum'];
|
||||
$excelData[$k][9] = $v['amount_player_3_Sum'];
|
||||
$excelData[$k][10] = $v['amount_player_3_times_Sum'];
|
||||
$excelData[$k][11] = $v['amount_player_3_banker_Sum'];
|
||||
$excelData[$k][12] = $v['amount_player_3_banker_times_Sum'];
|
||||
$excelData[$k][13] = $v['win_banker'];
|
||||
$excelData[$k][14] = $v['win_player_1'];
|
||||
$excelData[$k][15] = $v['win_player_2'];
|
||||
$excelData[$k][16] = $v['win_player_3'];
|
||||
$excelData[$k][17] = $v['totalSum'];
|
||||
$excelData[$k][18] = $v['totalWinSum'];
|
||||
$excelData[$k][19] = $v['income'];
|
||||
}
|
||||
$title = array('桌号','闲一','闲一翻倍','闲一-庄','闲一-庄翻倍','闲二','闲二翻倍','闲二-庄','闲二-庄翻倍','闲三','闲三翻倍','闲三-庄','闲三-庄翻倍','庄(次)','闲一(次)','闲二(次)','闲三(次)','总押','会员赢','收益');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '斗牛桌子账目-'.$startDate.'--'.$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '斗牛桌子账目', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
$this->assign('table',$table);
|
||||
$this->assign('table_list',$table_list);
|
||||
$this->assign('total_nn',$total_nn);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function baccarat_print(){
|
||||
// 接收参数
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
|
||||
// 查询桌子
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',1)->where('id',$table_id)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',1)->select();
|
||||
}
|
||||
|
||||
// 定义百家乐汇总参数
|
||||
$total_baccarat = array();
|
||||
$total_baccarat['total_sum'] = 0;
|
||||
$total_baccarat['total_win_sum'] = 0;
|
||||
$total_baccarat['ximaliang'] = 0;
|
||||
$total_baccarat['total_maliang'] = 0;
|
||||
$total_baccarat['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装数据
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
//庄下注总额
|
||||
$v['bankerSum'] = Db::name('bet')->where($betWhere)->sum('banker_amount');
|
||||
//闲下注总额
|
||||
$v['playerSum'] = Db::name('bet')->where($betWhere)->sum('player_amount');
|
||||
//和下注总额
|
||||
$v['tieSum'] = Db::name('bet')->where($betWhere)->sum('tie_amount');
|
||||
//庄对下注总额
|
||||
$v['bankerPairSum'] = Db::name('bet')->where($betWhere)->sum('banker_pair_amount');
|
||||
//闲对下注总额
|
||||
$v['playerPairSum'] = Db::name('bet')->where($betWhere)->sum('player_pair_amount');
|
||||
//庄次数
|
||||
$betCountWhere['result'] = 1;
|
||||
$v['bankerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//闲次数
|
||||
$betCountWhere['result'] = 2;
|
||||
$v['playerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//和次数
|
||||
$betCountWhere['result'] = 3;
|
||||
$v['tieCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//庄对次数
|
||||
unset($betCountWhere['result']);
|
||||
$betCountWhere['pair'] = 1;
|
||||
$v['bankerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//闲对次数
|
||||
$betCountWhere['pair'] = 2;
|
||||
$v['playerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//庄闲对次数
|
||||
$betCountWhere['pair'] = 3;
|
||||
$v['bankerPlayerPairCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['bankerSum'] + $v['playerSum'] + $v['tieSum'] + $v['bankerPairSum'] + $v['playerPairSum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//洗码量
|
||||
$v['ximaliang'] = Db::name('xima')->where($ximaWhere)->sum('ximaliang');
|
||||
//码量
|
||||
$v['totalMaliang'] = Db::name('xima')->where($ximaWhere)->sum('maliang');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
// 记账日期
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_baccarat['total_sum'] += $v['totalSum'];
|
||||
$total_baccarat['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_baccarat['ximaliang'] += $v['ximaliang'];
|
||||
$total_baccarat['total_maliang'] += $v['totalMaliang'];
|
||||
$total_baccarat['income'] += $v['income'];
|
||||
}
|
||||
$this->assign('table',$table);
|
||||
$this->assign('total_baccarat',$total_baccarat);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function dt_print(){
|
||||
// 接收参数
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
|
||||
// 查询桌子
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',2)->where('id',$table_id)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',2)->select();
|
||||
}
|
||||
// 汇总参数
|
||||
$total_dt = array();
|
||||
$total_dt['total_sum'] = 0;
|
||||
$total_dt['total_win_sum'] = 0;
|
||||
$total_dt['ximaliang'] = 0;
|
||||
$total_dt['total_maliang'] = 0;
|
||||
$total_dt['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
//龙下注总额
|
||||
$v['bankerSum'] = Db::name('bet')->where($betWhere)->sum('banker_amount');
|
||||
//虎下注总额
|
||||
$v['playerSum'] = Db::name('bet')->where($betWhere)->sum('player_amount');
|
||||
//和下注总额
|
||||
$v['tieSum'] = Db::name('bet')->where($betWhere)->sum('tie_amount');
|
||||
//龙次数
|
||||
$betCountWhere['result'] = 1;
|
||||
$v['bankerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//虎次数
|
||||
$betCountWhere['result'] = 2;
|
||||
$v['playerCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//和次数
|
||||
$betCountWhere['result'] = 3;
|
||||
$v['tieCount'] = Db::name('number_tab')->where($betCountWhere)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['bankerSum'] + $v['playerSum'] + $v['tieSum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_dt['total_sum'] += $v['totalSum'];
|
||||
$total_dt['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_dt['income'] += $v['income'];
|
||||
}
|
||||
$this->assign('table',$table);
|
||||
$this->assign('total_dt',$total_dt);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function nn_print(){
|
||||
// 接收参数
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$table_id = Request::instance()->get('table_id');
|
||||
// 查询桌子信息
|
||||
$table_list = Db::name('table')->where('game_id',4)->select();
|
||||
if($table_id > 0){
|
||||
$table = Db::name('table')->where('game_id',4)->where('id',$table_id)->select();
|
||||
}else{
|
||||
$table = Db::name('table')->where('game_id',4)->select();
|
||||
}
|
||||
|
||||
// 定义汇总参数
|
||||
$total_nn = array();
|
||||
$total_nn['total_sum'] = 0;
|
||||
$total_nn['total_win_sum'] = 0;
|
||||
$total_nn['ximaliang'] = 0;
|
||||
$total_nn['total_maliang'] = 0;
|
||||
$total_nn['income'] = 0;
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
// 拼装数据
|
||||
foreach($table AS $k => $v){
|
||||
// 注单查询条件
|
||||
$betWhere = array();
|
||||
$betWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
$betWhere['table_id'] = $v['id'];
|
||||
$v['status'] = 1;
|
||||
// 洗码查询条件
|
||||
$ximaWhere = array();
|
||||
$ximaWhere['table_id'] = $v['id'];
|
||||
$ximaWhere['status'] = 1;
|
||||
$ximaWhere['type'] = 1;
|
||||
$ximaWhere['ximaliang'] = array('gt',0);
|
||||
$ximaWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
// 结果统计查询条件
|
||||
$betCountWhere = array();
|
||||
$betCountWhere['table_id'] = $v['id'];
|
||||
$betCountWhere['start_time'] = array('between',[$startTime,$endTime]);
|
||||
|
||||
$v['amount_player_1_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1');
|
||||
$v['amount_player_1_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_times');
|
||||
$v['amount_player_1_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_banker');
|
||||
$v['amount_player_1_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_1_banker_times');
|
||||
$v['amount_player_2_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2');
|
||||
$v['amount_player_2_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_times');
|
||||
$v['amount_player_2_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_banker');
|
||||
$v['amount_player_2_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_2_banker_times');
|
||||
$v['amount_player_3_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3');
|
||||
$v['amount_player_3_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_times');
|
||||
$v['amount_player_3_banker_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_banker');
|
||||
$v['amount_player_3_banker_times_Sum'] = Db::name('bet')->where($betWhere)->sum('amount_player_3_banker_times');
|
||||
//闲一次数
|
||||
$win_player_1['win_player_1'] = 1;
|
||||
$v['win_player_1'] = Db::name('number_tab')->where($win_player_1)->count();
|
||||
//闲二次数
|
||||
$win_player_2['win_player_2'] = 1;
|
||||
$v['win_player_2'] = Db::name('number_tab')->where($win_player_2)->count();
|
||||
//闲三次数
|
||||
$win_player_3['win_player_3'] = 1;
|
||||
$v['win_player_3'] = Db::name('number_tab')->where($win_player_3)->count();
|
||||
//庄次数
|
||||
$win_banker['win_player_1'] = 0;
|
||||
$win_banker['win_player_2'] = 0;
|
||||
$win_banker['win_player_2'] = 0;
|
||||
$v['win_banker'] = Db::name('number_tab')->where($win_banker)->count();
|
||||
//总下注金额
|
||||
$v['totalSum'] = $v['amount_player_1_Sum'] + $v['amount_player_1_times_Sum']+ $v['amount_player_1_banker_Sum']+ $v['amount_player_1_banker_times_Sum']+$v['amount_player_2_Sum'] + $v['amount_player_2_times_Sum']+ $v['amount_player_2_banker_Sum']+ $v['amount_player_2_banker_times_Sum']+$v['amount_player_3_Sum'] + $v['amount_player_3_times_Sum']+ $v['amount_player_3_banker_Sum']+ $v['amount_player_3_banker_times_Sum'];
|
||||
//总赢
|
||||
$v['totalWinSum'] = Db::name('bet')->where($betWhere)->sum('win_total');
|
||||
//收益
|
||||
$v['income'] = to_number($v['totalWinSum']);
|
||||
|
||||
$table[$k] = $v;
|
||||
// 汇总参数
|
||||
$total_nn['total_sum'] += $v['totalSum'];
|
||||
$total_nn['total_win_sum'] += $v['totalWinSum'];
|
||||
$total_nn['income'] += $v['income'];
|
||||
}
|
||||
$this->assign('table',$table);
|
||||
$this->assign('total_nn',$total_nn);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function edit_numberTab(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收查询条件
|
||||
$get['table_id'] = Request::instance()->get('table_id');
|
||||
$get['number_id'] = Request::instance()->get('number_id');
|
||||
$get['boot_id'] = Request::instance()->get('boot_id');
|
||||
$get['boot_num'] = Request::instance()->get('boot_num');
|
||||
$get['number'] = Request::instance()->get('number');
|
||||
|
||||
|
||||
|
||||
$this->assign('get',$get);
|
||||
// 百家乐所有桌子信息
|
||||
$table_list = Db::name('table')->where('game_id','between',[1,2])->select();
|
||||
|
||||
|
||||
$where = array();
|
||||
$where['result_before_edit'] = array('gt',0);
|
||||
if($get['table_id'] > 0){
|
||||
$where['table_id'] = $get['table_id'];
|
||||
}
|
||||
if($get['number_id']){
|
||||
$where['id'] = $get['number_id'];
|
||||
}
|
||||
if($get['boot_id']){
|
||||
$where['boot_id'] = $get['boot_id'];
|
||||
}
|
||||
if($get['boot_num']){
|
||||
$where['boot_num'] = $get['boot_num'];
|
||||
}
|
||||
if($get['number']){
|
||||
$where['number'] = $get['number'];
|
||||
}
|
||||
$where['game_id'] = array('between',[1,2]);
|
||||
$editData = Db::name('number_tab')->where($where)->order('id DESC')->paginate(100,false,array('query'=>$get));
|
||||
foreach ($editData as $key => $val){
|
||||
if($val['game_id'] == 1){
|
||||
if($val['result'] == 1){
|
||||
$val['after_result'] = '庄';
|
||||
}elseif($val['result'] == 2){
|
||||
$val['after_result'] = '闲';
|
||||
}else{
|
||||
$val['after_result'] = '和';
|
||||
}
|
||||
if($val['pair'] == 1){
|
||||
$val['after_result'] .= ',庄对';
|
||||
}elseif($val['pair'] == 2){
|
||||
$val['after_result'] .= ',闲对';
|
||||
}elseif($val['pair'] == 3){
|
||||
$val['after_result'] .= ',庄闲对';
|
||||
}
|
||||
|
||||
if($val['result_before_edit'] == 1){
|
||||
$val['before_result'] = '庄';
|
||||
}elseif($val['result_before_edit'] == 2){
|
||||
$val['before_result'] = '闲';
|
||||
}else{
|
||||
$val['before_result'] = '和';
|
||||
}
|
||||
if($val['pair_before_edit'] == 1){
|
||||
$val['before_result'] .= ',庄对';
|
||||
}elseif($val['pair_before_edit'] == 2){
|
||||
$val['before_result'] .= ',闲对';
|
||||
}elseif($val['pair_before_edit'] == 3){
|
||||
$val['before_result'] .= ',庄闲对';
|
||||
}
|
||||
}else{
|
||||
if($val['result'] == 1){
|
||||
$val['after_result'] = '龙';
|
||||
}elseif($val['result'] == 2){
|
||||
$val['after_result'] = '虎';
|
||||
}else{
|
||||
$val['after_result'] = '和';
|
||||
}
|
||||
|
||||
if($val['result_before_edit'] == 1){
|
||||
$val['before_result'] = '龙';
|
||||
}elseif($val['result_before_edit'] == 2){
|
||||
$val['before_result'] = '虎';
|
||||
}else{
|
||||
$val['before_result'] = '和';
|
||||
}
|
||||
}
|
||||
$editData[$key] = $val;
|
||||
}
|
||||
$this->assign('editData',$editData);
|
||||
$this->assign('table_list',$table_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
113
application/admin/controller/Tip.php
Normal file
113
application/admin/controller/Tip.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
|
||||
class Tip extends Common{
|
||||
public function index(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
//接收搜索的条件信息
|
||||
$username = Request::instance()->get('username');
|
||||
$export = Request::instance()->get('export');
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
if($export == 1){
|
||||
$tip_list = Db::name('tip')->where($where)->order('id desc')->select();
|
||||
}else{
|
||||
//获取所有代理信息
|
||||
$tip_list = Db::name('tip')->where($where)->order('id desc')->paginate(15,false,array('query'=>$get));
|
||||
}
|
||||
foreach ($tip_list as $k => $v) {
|
||||
$v['create_time'] = date("Y-m-d H:i",$v['create_time']);
|
||||
$tip_list[$k] = $v;
|
||||
}
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($tip_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($tip_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['user_id'];
|
||||
$excelData[$k][1] = $v['username'];
|
||||
$excelData[$k][2] = $v['table_id'];
|
||||
$excelData[$k][3] = $v['table_name'];
|
||||
$excelData[$k][4] = $v['create_time'];
|
||||
$excelData[$k][5] = $v['money'];
|
||||
}
|
||||
$title = array('用户ID','用户账号','桌子ID','桌子名称','打赏时间','打赏金额');
|
||||
$this->exportExcelCore($excelData, '打赏列表', $title);
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
// 渲染参数和模板
|
||||
$this->assign('tip_list',$tip_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function optimum(){
|
||||
$optimum_list = Db::name('optimum')->order('win_money desc')->select();
|
||||
$this->assign('optimum_list',$optimum_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
public function do_add_optimum(){
|
||||
// 接收提交过来的数据
|
||||
$username = Request::instance()->post('username');
|
||||
$win_money = Request::instance()->post('win_money');
|
||||
if( !isset($username) && empty($username) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'账户名不能为空!']));
|
||||
}
|
||||
if( !isset($win_money) && empty($win_money) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'赢钱金额不能为空!']));
|
||||
}
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['username'] = $username;
|
||||
$data['win_money'] = $win_money;
|
||||
$insert_id = Db::name('optimum')->insertGetId($data);
|
||||
if($insert_id){
|
||||
die(json_encode(['code'=>1,'msg'=>'添加成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'添加失败!']));
|
||||
}
|
||||
}
|
||||
public function do_edit_optimum(){
|
||||
if(Request::instance()->post()){
|
||||
|
||||
// 接收提交过来的数据
|
||||
$id = Request::instance()->post('edit_id');
|
||||
$username = Request::instance()->post('username');
|
||||
$win_money = Request::instance()->post('win_money');
|
||||
// 数据验证
|
||||
if( !isset($username) && empty($username) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'用户账户不能为空!']));
|
||||
}
|
||||
if( !isset($win_money) && empty($win_money) ){
|
||||
die(json_encode(['code'=>0,'msg'=>'赢钱金额不能为空!']));
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
$data = array();
|
||||
$data['username'] = $username;
|
||||
$data['win_money'] = $win_money;
|
||||
|
||||
$insert_id = Db::name('optimum')->where('id',$id)->update($data);
|
||||
if($insert_id){
|
||||
die(json_encode(['code'=>1,'msg'=>'修改成功!']));
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'修改失败!']));
|
||||
}
|
||||
}else{
|
||||
die(json_encode(['code'=>0,'msg'=>'操作错误!']));
|
||||
}
|
||||
}
|
||||
}
|
||||
848
application/admin/controller/Waybill.php
Executable file
848
application/admin/controller/Waybill.php
Executable file
@ -0,0 +1,848 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
use think\Request;
|
||||
use think\Db;
|
||||
use think\Session;
|
||||
use think\Cache;
|
||||
|
||||
class Waybill extends Common
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 百家乐路单展示页面
|
||||
*/
|
||||
public function baccarat()
|
||||
{
|
||||
// 查询百家乐桌子信息
|
||||
$table_list = Db::name('table')->where(array('game_id' => 1, 'is_scavenging' => 0))->select();
|
||||
$table_id_arr = Db::name('table')->where(array('game_id' => 1, 'is_scavenging' => 0))->column('id');
|
||||
// 定义只能查询前7个记账日期
|
||||
$date = get_weeks();
|
||||
|
||||
// 接收分页的数据
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get', $get);
|
||||
$this->assign('query', $query);
|
||||
|
||||
// 接收查询条件
|
||||
$table_id = Request::instance()->get('search_table_id');
|
||||
$boot_id = Request::instance()->get('search_boot_id');
|
||||
$number_id = Request::instance()->get('search_number_id');
|
||||
$startTime = strtotime(Request::instance()->get('startDate'));
|
||||
$endTime = strtotime(Request::instance()->get('endDate'));
|
||||
|
||||
// 定义查询条件
|
||||
$where = array();
|
||||
if ($table_id > 0) {
|
||||
$where['table_id'] = $table_id;
|
||||
}
|
||||
if ($boot_id > 0) {
|
||||
$where['boot_id'] = $boot_id;
|
||||
}
|
||||
if ($number_id > 0) {
|
||||
$where['id'] = $number_id;
|
||||
}
|
||||
if ($startTime > 0 && $endTime > 0){
|
||||
$where['start_time'] = array('between',[$startTime,$endTime]);
|
||||
}
|
||||
$where['bet_status'] = 3; // 已开出结果的铺
|
||||
if($table_id > 0){
|
||||
$number_tab_list = Db::name('number_tab')->where($where)->order('start_time desc,id desc')->paginate(15, false, array('query' => $get));
|
||||
}else{
|
||||
$number_tab_list = Db::name('number_tab')->where($where)->whereIn('table_id',$table_id_arr)->order('start_time desc,id desc')->paginate(15, false, array('query' => $get));
|
||||
}
|
||||
|
||||
// 重新组装数据
|
||||
foreach ($number_tab_list as $k => $v) {
|
||||
$v['start_time'] = date('Y-m-d H:i:s', $v['start_time']);
|
||||
if ($v['result'] == 1) $v['result'] = "庄";
|
||||
if ($v['result'] == 2) $v['result'] = "闲";
|
||||
if ($v['result'] == 3) $v['result'] = "和";
|
||||
if ($v['pair'] == 0) $v['pair'] = null;
|
||||
if ($v['pair'] == 1) $v['pair'] = "庄对";
|
||||
if ($v['pair'] == 2) $v['pair'] = "闲对";
|
||||
if ($v['pair'] == 3) $v['pair'] = "庄闲对";
|
||||
$number_tab_list[$k] = $v;
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('number_tab_list', $number_tab_list);
|
||||
$this->assign('table_list', $table_list);
|
||||
$this->assign('date', $date);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 龙虎斗路单展示页面
|
||||
*/
|
||||
public function dt()
|
||||
{
|
||||
// 查询百家乐桌子信息
|
||||
$table_list = Db::name('table')->where(array('game_id' => 2, 'is_scavenging' => 0))->select();
|
||||
$table_id_arr = Db::name('table')->where(array('game_id' => 2, 'is_scavenging' => 0))->column('id');
|
||||
|
||||
// 定义只能查询前7个记账日期
|
||||
$date = get_weeks();
|
||||
|
||||
// 接收分页的数据
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get', $get);
|
||||
$this->assign('query', $query);
|
||||
|
||||
// 接收查询条件
|
||||
$table_id = Request::instance()->get('search_table_id');
|
||||
$boot_id = Request::instance()->get('search_boot_id');
|
||||
$number_id = Request::instance()->get('search_number_id');
|
||||
$startTime = strtotime(Request::instance()->get('startDate'));
|
||||
$endTime = strtotime(Request::instance()->get('endDate'));
|
||||
|
||||
// 定义查询条件
|
||||
$where = array();
|
||||
if ($table_id > 0) {
|
||||
$where['table_id'] = $table_id;
|
||||
}
|
||||
if ($boot_id > 0) {
|
||||
$where['boot_id'] = $boot_id;
|
||||
}
|
||||
if ($number_id > 0) {
|
||||
$where['id'] = $number_id;
|
||||
}
|
||||
if ($startTime > 0 && $endTime > 0){
|
||||
$where['start_time'] = array('between',[$startTime,$endTime]);
|
||||
}
|
||||
$where['bet_status'] = 3;
|
||||
if($table_id > 0){
|
||||
$number_tab_list = Db::name('number_tab')->where($where)->order('start_time desc,id desc')->paginate(15, false, array('query' => $get));
|
||||
}else{
|
||||
$number_tab_list = Db::name('number_tab')->where($where)->whereIn('table_id',$table_id_arr)->order('start_time desc,id desc')->paginate(15, false, array('query' => $get));
|
||||
}
|
||||
|
||||
foreach ($number_tab_list as $k => $v) {
|
||||
$v['start_time'] = date('Y-m-d H:i:s', $v['start_time']);
|
||||
if ($v['result'] == 1) $v['result'] = "龙";
|
||||
if ($v['result'] == 2) $v['result'] = "虎";
|
||||
if ($v['result'] == 3) $v['result'] = "和";
|
||||
$number_tab_list[$k] = $v;
|
||||
}
|
||||
|
||||
// 渲染参和模板
|
||||
$this->assign('number_tab_list', $number_tab_list);
|
||||
$this->assign('table_list', $table_list);
|
||||
$this->assign('date', $date);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function add_number_tab(){
|
||||
if(Request::instance()->post()){
|
||||
$post = Request::instance()->post();
|
||||
$game_id = intval(Request::instance()->post('game_id'));
|
||||
$table_id = intval(Request::instance()->post('table_id'));
|
||||
$boot_id = intval(Request::instance()->post('boot_id'));
|
||||
$number_tab_id = intval(Request::instance()->post('number_tab_id'));
|
||||
$result = trim(Request::instance()->post('result'));
|
||||
if($game_id > 0 && $table_id > 0 && $boot_id > 0 && $number_tab_id){
|
||||
$table = Db::name('table')->where(array('id' => $table_id))->find();
|
||||
$resultArray = explode('-',$result);
|
||||
if(intval($resultArray[0]) != 1 && intval($resultArray[0]) != 2 && intval($resultArray[0]) != 3){
|
||||
return json(array('code' => 0, 'msg' => '请选择结果,然后再提交'));
|
||||
}
|
||||
if($table['game_id'] == 1){
|
||||
$number_tab_info = Db::name('number_tab')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'id' => $number_tab_id))->find();
|
||||
if(empty($number_tab_info)){
|
||||
return json(array('code' => 0, 'msg' => '当前铺数据不存在'));
|
||||
}
|
||||
$insertData = array();
|
||||
$insertData['game_id'] = $game_id;
|
||||
$insertData['game_name'] = $number_tab_info['game_name'];
|
||||
$insertData['table_id'] = $table_id;
|
||||
$insertData['table_name'] = $number_tab_info['table_name'];
|
||||
$insertData['sumday_id'] = $number_tab_info['sumday_id'];
|
||||
$insertData['day'] = $number_tab_info['day'];
|
||||
$insertData['boot_id'] = $boot_id;
|
||||
$insertData['boot_num'] = $number_tab_info['boot_num'];
|
||||
$insertData['number'] = intval($number_tab_info['number']) + 1;
|
||||
$insertData['result'] = intval($resultArray[0]);
|
||||
$insertData['pair'] = intval($resultArray[1]);
|
||||
$insertData['start_time'] = $number_tab_info['start_time'];
|
||||
$insertData['end_time'] = $number_tab_info['end_time'];
|
||||
$insertData['bet_status'] = 3;
|
||||
$insertData['bet_start_time'] = $number_tab_info['bet_start_time'];
|
||||
$insertData['bet_end_time'] = $number_tab_info['bet_end_time'];
|
||||
if($table['mode'] == 2){
|
||||
$insertData['win6'] = intval($resultArray[2]);
|
||||
}
|
||||
$insertData['is_add'] = 1;
|
||||
Db::execute("update `cg_number_tab` set `number` = `number` + 1 where `game_id` = ".$game_id." and `table_id` = ".$table_id." and `boot_id` = ".$boot_id." and `number` > ".intval($number_tab_info['number']));
|
||||
Db::name('number_tab')->insert($insertData);
|
||||
return json(array('code' => 1, 'msg' => '修改成功'));
|
||||
}elseif($table['game_id'] == 2){
|
||||
$number_tab_info = Db::name('number_tab')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'id' => $number_tab_id))->find();
|
||||
if(empty($number_tab_info)){
|
||||
return json(array('code' => 0, 'msg' => '当前铺数据不存在'));
|
||||
}
|
||||
$insertData = array();
|
||||
$insertData['game_id'] = $game_id;
|
||||
$insertData['game_name'] = $number_tab_info['game_name'];
|
||||
$insertData['table_id'] = $table_id;
|
||||
$insertData['table_name'] = $number_tab_info['table_name'];
|
||||
$insertData['sumday_id'] = $number_tab_info['sumday_id'];
|
||||
$insertData['day'] = $number_tab_info['day'];
|
||||
$insertData['boot_id'] = $boot_id;
|
||||
$insertData['boot_num'] = $number_tab_info['boot_num'];
|
||||
$insertData['number'] = intval($number_tab_info['number']) + 1;
|
||||
$insertData['result'] = intval($resultArray[0]);
|
||||
$insertData['start_time'] = $number_tab_info['start_time'];
|
||||
$insertData['end_time'] = $number_tab_info['end_time'];
|
||||
$insertData['bet_status'] = 3;
|
||||
$insertData['bet_start_time'] = $number_tab_info['bet_start_time'];
|
||||
$insertData['bet_end_time'] = $number_tab_info['bet_end_time'];
|
||||
$insertData['is_add'] = 1;
|
||||
Db::execute("update `cg_number_tab` set `number` = `number` + 1 where `game_id` = ".$game_id." and `table_id` = ".$table_id." and `boot_id` = ".$boot_id." and `number` > ".intval($number_tab_info['number']));
|
||||
Db::name('number_tab')->insert($insertData);
|
||||
return json(array('code' => 1, 'msg' => '修改成功'));
|
||||
}
|
||||
}else{
|
||||
return json(array('code' => 0, 'msg' => '数据出错,不能修改,请稍后再试'));
|
||||
}
|
||||
}else{
|
||||
die('ERROR');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit_number_tab(){
|
||||
if(Request::instance()->post()){
|
||||
$post = Request::instance()->post();
|
||||
$game_id = intval(Request::instance()->post('game_id'));
|
||||
$table_id = intval(Request::instance()->post('table_id'));
|
||||
$boot_id = intval(Request::instance()->post('boot_id'));
|
||||
$number_tab_id = intval(Request::instance()->post('number_tab_id'));
|
||||
$result = trim(Request::instance()->post('result'));
|
||||
if($game_id > 0 && $table_id > 0 && $boot_id > 0 && $number_tab_id){
|
||||
$table = Db::name('table')->where(array('id' => $table_id))->find();
|
||||
$resultArray = explode('-',$result);
|
||||
if($table['game_id'] == 1){
|
||||
$number_tab_info = Db::name('number_tab')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'id' => $number_tab_id))->find();
|
||||
if(empty($number_tab_info)){
|
||||
return json(array('code' => 0, 'msg' => '数据出错,不能修改,请稍后再试'));
|
||||
}
|
||||
if($table['mode'] == 2){
|
||||
$resultData = array();
|
||||
$resultData['opening'] = intval($resultArray[0]);
|
||||
$resultData['pair'] = intval($resultArray[1]);
|
||||
$resultData['win6'] = intval($resultArray[2]);
|
||||
if($resultData['opening'] > 0 && $resultData['opening'] < 4){
|
||||
$returnInfo = $this->retreated_baccarat_win6($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info);
|
||||
return json($returnInfo);
|
||||
}else{
|
||||
return json(array('code' => 0, 'msg' => '请选择结果,然后再提交'));
|
||||
}
|
||||
}else{
|
||||
$resultData = array();
|
||||
$resultData['opening'] = intval($resultArray[0]);
|
||||
$resultData['pair'] = intval($resultArray[1]);
|
||||
if($resultData['opening'] > 0 && $resultData['opening'] < 4){
|
||||
$returnInfo = $this->retreated_baccarat($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info);
|
||||
return json($returnInfo);
|
||||
}else{
|
||||
return json(array('code' => 0, 'msg' => '请选择结果,然后再提交'));
|
||||
}
|
||||
}
|
||||
}elseif($table['game_id'] == 2){
|
||||
$number_tab_info = Db::name('number_tab')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'id' => $number_tab_id))->find();
|
||||
if(empty($number_tab_info)){
|
||||
return json(array('code' => 0, 'msg' => '数据出错,不能修改,请稍后再试'));
|
||||
}
|
||||
$resultData = array();
|
||||
$resultData['opening'] = intval($resultArray[0]);
|
||||
if($resultData['opening'] > 0 && $resultData['opening'] < 4){
|
||||
$returnInfo = $this->retreated_dt($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info);
|
||||
return json($returnInfo);
|
||||
}else{
|
||||
return json(array('code' => 0, 'msg' => '请选择结果,然后再提交'));
|
||||
}
|
||||
}elseif($table['game_id'] == 4){
|
||||
// 牛牛作废本局 - 取消单局输赢,退回原投注额
|
||||
$number_tab_info = Db::name('number_tab')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'id' => $number_tab_id))->find();
|
||||
if(empty($number_tab_info)){
|
||||
return json(array('code' => 0, 'msg' => '数据出错,不能修改,请稍后再试'));
|
||||
}
|
||||
if($number_tab_info['bet_status'] != 3){
|
||||
return json(array('code' => 0, 'msg' => '该局尚未开出结果,无法作废'));
|
||||
}
|
||||
$returnInfo = $this->retreated_nn($game_id,$table_id,$boot_id,$number_tab_id,$number_tab_info);
|
||||
return json($returnInfo);
|
||||
}
|
||||
}else{
|
||||
return json(array('code' => 0, 'msg' => '数据出错,不能修改,请稍后再试'));
|
||||
}
|
||||
}else{
|
||||
die('ERROR');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理龙虎回档
|
||||
* $table_info 桌子的数据
|
||||
* $data 当前回合数据
|
||||
* $serv swoole对象
|
||||
* $connections 链接ID
|
||||
*/
|
||||
function retreated_dt($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info){
|
||||
$lastNumberTabInfo = $number_tab_info;
|
||||
$table_info = Db::name('table')->where('id',$table_id)->find();
|
||||
//首先更新会员账户余额,减去相应的投注额
|
||||
$bets = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'status' => 1))->select();
|
||||
$oBets = $bets;
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id']);
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('agent_commission')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
$opening = $resultData['opening'];
|
||||
Db::name('number_tab')->where(array('id' => $lastNumberTabInfo['id']))->update(array('result' => $opening));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $lastNumberTabInfo['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $lastNumberTabInfo['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $number_tab_id;
|
||||
$retreated_log_data['number'] = $lastNumberTabInfo['number'];
|
||||
$str = '';
|
||||
if($lastNumberTabInfo['result'] == 1) $str = '龙';
|
||||
if($lastNumberTabInfo['result'] == 2) $str = '虎';
|
||||
if($lastNumberTabInfo['result'] == 3) $str = '和';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '龙';
|
||||
if($opening == 2) $nstr = '虎';
|
||||
if($opening == 3) $nstr = '和';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
if(!empty($oBets)){
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->where(array('id' => intval($v['user_id'])))->find();
|
||||
$agent_commission = $user_info['agent_commission_dt'] / 100;
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'];
|
||||
$win_money = 0;
|
||||
// 双边洗码
|
||||
$ximaliang = 0;
|
||||
if($user_info['type_xima'] == 1){
|
||||
$ximaliang = $v['banker_amount'] - $v['player_amount'];
|
||||
$ximaliang = abs($ximaliang);
|
||||
}
|
||||
// 龙赢
|
||||
if ($opening == 1) {
|
||||
if($v['banker_amount'] > 0){
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_dragon']),2) + $win_money;
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['player_amount'];
|
||||
}
|
||||
}
|
||||
// 虎赢
|
||||
if ($opening == 2) {
|
||||
if($v['player_amount'] > 0){
|
||||
$win_money = round($v['player_amount'] * (1 + $user_info['price_tiger']),2) + $win_money;
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['banker_amount'];
|
||||
}
|
||||
}
|
||||
// 和
|
||||
if ($opening == 3) {
|
||||
if(DT_HALF == 1){
|
||||
$win_money = round(($v['banker_amount'] + $v['player_amount']) / 2,2) + $win_money;
|
||||
}else{
|
||||
$win_money = $v['banker_amount'] + $v['player_amount'] + $win_money;
|
||||
}
|
||||
$ximaliang = 0;
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + $user_info['price_tie_dt']) + $win_money;
|
||||
}
|
||||
}
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
$money = $user_info['money'] + $win_total;
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertBetData = $v;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
$insertBetData['is_edit'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']); //切割多个代理ID为数组
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
$nextMaliang = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
$maliang = 0;
|
||||
$ximalv = $user_path_info['agent_ximalv_dt'];
|
||||
$maliang_true = 0;
|
||||
if($ximalv > 0 && $ximaliang > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$maliang = round(($ximaliang * $ximalv) / 100,2);
|
||||
$maliang_true = $maliang;
|
||||
if($user_path_info['agent_cs'] > 0 && $user_path_info['share_xima'] == 2){
|
||||
$maliang_true = $maliang - round($maliang * ($user_path_info['agent_cs'] / 100),2);
|
||||
}
|
||||
$net_maliang = $maliang - $nextMaliang;
|
||||
$nextMaliang = $net_maliang + $nextMaliang;
|
||||
$insert_xima_sql = "INSERT INTO `cg_xima` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`sumday_id`,`day`,`number_tab_id`,`boot_id`,`ximaliang`,`ximalv`,`maliang`,`maliang_true`,`total`,`win_total`,`create_time`,`type`,`net_maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['sumday_id'].",'".$v['day']."',".$v['number_tab_id'].",".$v['boot_id'].",".$ximaliang.",".$ximalv.",".$maliang.",".$maliang_true.",".$amount.",".$win_total.",".time().",".$type.",".$net_maliang.")";
|
||||
Db::execute($insert_xima_sql);
|
||||
}
|
||||
//if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(round(($user_path_info['agent_cs'] * $win_total) / 100,2));
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$share_amount_true = round(to_number($maliang + $win_total) * ($user_path_info['agent_cs'] / 100),2);
|
||||
}else{
|
||||
$share_amount_true = $maliang;
|
||||
}
|
||||
$net_cs = $share_amount - $nextCs;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`,`maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".time().",".$type.",".$net_cs.",".$maliang.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
// 代理抽水
|
||||
if($opening == 1 && $v['banker_amount'] > 0 && $user_info['agent_commission'] > 0){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',2,'龙虎',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['banker_amount'].",".$agent_commission.",".$v['banker_amount'] * $agent_commission.",".$opening.",".time().")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
if($opening == 2 && $v['player_amount'] > 0 && $user_info['agent_commission'] > 0){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',2,'龙虎',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['player_amount'].",".$user_info['agent_commission'].",".$v['player_amount'] * $agent_commission.",".$opening.",".time().")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return array('code' => 1, 'msg' => '修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理百家乐回档
|
||||
* $table_info 桌子的数据
|
||||
* $data 当前回合数据
|
||||
* $serv swoole对象
|
||||
* $connections 链接ID
|
||||
*/
|
||||
private function retreated_baccarat($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info){
|
||||
$lastNumberTabInfo = $number_tab_info;
|
||||
$table_info = Db::name('table')->where('id',$table_id)->find();
|
||||
//首先更新会员账户余额,减去相应的投注额
|
||||
$bets = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'status' => 1))->select();
|
||||
$oBets = $bets;
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id']);
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('agent_commission')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
$opening = $resultData['opening'];
|
||||
$pair = $resultData['pair'];
|
||||
Db::name('number_tab')->where(array('id' => $lastNumberTabInfo['id']))->update(array('result' => $opening, 'pair' => $pair));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $lastNumberTabInfo['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $lastNumberTabInfo['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $number_tab_id;
|
||||
$retreated_log_data['number'] = $lastNumberTabInfo['number'];
|
||||
$str = '';
|
||||
if($lastNumberTabInfo['result'] == 1) $str = '庄';
|
||||
if($lastNumberTabInfo['result'] == 2) $str = '闲';
|
||||
if($lastNumberTabInfo['result'] == 3) $str = '和';
|
||||
if($lastNumberTabInfo['pair'] == 1) $str = $str.'-庄对';
|
||||
if($lastNumberTabInfo['pair'] == 2) $str = $str.'-闲对';
|
||||
if($lastNumberTabInfo['pair'] == 3) $str = $str.'-庄闲对';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '庄';
|
||||
if($opening == 2) $nstr = '闲';
|
||||
if($opening == 3) $nstr = '和';
|
||||
if($pair == 1) $nstr = $nstr.'-庄对';
|
||||
if($pair == 2) $nstr = $nstr.'-闲对';
|
||||
if($pair == 3) $nstr = $nstr.'-庄闲对';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
if(!empty($oBets)){
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->where(array('id' => intval($v['user_id'])))->find();
|
||||
$agent_commission = $user_info['agent_commission'] / 100;
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'] + $v['banker_pair_amount'] + $v['player_pair_amount'];
|
||||
$win_money = 0;
|
||||
// 双边洗码
|
||||
$ximaliang = 0;
|
||||
if($user_info['type_xima'] == 1){
|
||||
$ximaliang = $v['banker_amount'] - $v['player_amount'];
|
||||
$ximaliang = abs($ximaliang);
|
||||
}
|
||||
if($opening == 1){
|
||||
// 庄赢
|
||||
if($v['banker_amount'] > 0){
|
||||
if($table_info['mode'] == 1){
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_banker'] - $agent_commission),2) + $win_money;
|
||||
}else{
|
||||
$win_money = round($v['banker_amount'] * (1 + $user_info['price_banker']),2) + $win_money;
|
||||
}
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['player_amount'];
|
||||
}
|
||||
}elseif($opening == 2){
|
||||
// 闲赢
|
||||
if($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] * (1 + $user_info['price_player']) + $win_money;
|
||||
}
|
||||
// 单边洗码
|
||||
if($user_info['type_xima'] == 2){
|
||||
$ximaliang = $v['banker_amount'];
|
||||
}
|
||||
}elseif($opening == 3) {
|
||||
$ximaliang = 0;
|
||||
// 和赢
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + $user_info['price_tie_baccarat']) + $win_money;
|
||||
}
|
||||
// 开 和,下注庄和闲不扣钱
|
||||
if($v['banker_amount'] > 0 && $v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $v['banker_amount'] + $win_money;
|
||||
}elseif($v['banker_amount'] > 0){
|
||||
$win_money = $v['banker_amount'] + $win_money;
|
||||
} elseif ($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $win_money;
|
||||
}
|
||||
}
|
||||
if($pair == 3){
|
||||
// 计算庄对下注的赢钱金额
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
//计算闲对下注的赢钱金额
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}elseif($pair == 1){
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}elseif($pair == 2){
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + $user_info['price_pair']) + $win_money;
|
||||
}
|
||||
}
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
$money = $user_info['money'] + $win_total;
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertBetData = $v;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['pair'] = $pair;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
$insertBetData['is_edit'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入码率表及cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']);
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
$nextMaliang = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
$maliang = 0;
|
||||
$ximalv = $user_path_info['agent_ximalv'];
|
||||
$maliang_true = 0;
|
||||
if($ximalv > 0 && $ximaliang > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$maliang = round(($ximaliang * $ximalv) / 100,2);
|
||||
$maliang_true = $maliang;
|
||||
if($user_path_info['agent_cs'] > 0 && $user_path_info['share_xima'] == 2){
|
||||
$maliang_true = $maliang - round($maliang * ($user_path_info['agent_cs'] / 100),2);
|
||||
}
|
||||
$net_maliang = $maliang - $nextMaliang;
|
||||
$nextMaliang = $net_maliang + $nextMaliang;
|
||||
$insert_xima_sql = "INSERT INTO `cg_xima` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`sumday_id`,`day`,`number_tab_id`,`boot_id`,`ximaliang`,`ximalv`,`maliang`,`maliang_true`,`total`,`win_total`,`create_time`,`type`,`net_maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['sumday_id'].",'".$v['day']."',".$v['number_tab_id'].",".$v['boot_id'].",".$ximaliang.",".$ximalv.",".$maliang.",".$maliang_true.",".$amount.",".$win_total.",".$lastNumberTabInfo['bet_start_time'].",".$type.",".$net_maliang.")";
|
||||
Db::execute($insert_xima_sql);
|
||||
}
|
||||
//if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(($user_path_info['agent_cs'] * $win_total) / 100);
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$share_amount_true = round(to_number($maliang + $win_total) * ($user_path_info['agent_cs'] / 100),2);
|
||||
}else{
|
||||
$share_amount_true = $maliang;
|
||||
}
|
||||
$net_cs = $share_amount - $nextCs;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`,`maliang`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".$lastNumberTabInfo['bet_start_time'].",".$type.",".$net_cs.",".$maliang.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
//}
|
||||
}
|
||||
}
|
||||
// 代理抽水
|
||||
if($opening == 1 && $v['banker_amount'] > 0 && $user_info['agent_commission'] > 0 ){
|
||||
$parentIdPath = explode(',',$user_info['agent_parent_id_path']);
|
||||
foreach($parentIdPath as $value){
|
||||
$user = Db::name('user')->where('id',$value)->find();
|
||||
$insert_commission_sql = "INSERT INTO `cg_agent_commission` (`user_id`,`username`,`agent_id`,`agent_username`,`game_id`,`game_name`,`table_id`,`table_name`,`boot_id`,`boot_num`,`number_tab_id`,`number`,`bet_id`,`amount`,`agent_commission`,`money_commission`,`result`,`pair`,`create_time`) VALUES (".$user['id'].",'".$user['username']."',".$user['agent_parent_id'].",'".$user['agent_parent_username']."',1,'百家乐',".$table_info['id'].",'".$table_info['table_name']."',".$v['boot_id'].",".$v['boot_num'].",".$v['number_tab_id'].",".$v['number'].",".$v['id'].",".$v['banker_amount'].",".$user_info['agent_commission'].",".$v['banker_amount'] * $agent_commission.",".$opening.",".$pair.",".time().")";
|
||||
Db::execute($insert_commission_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return array('code' => 1, 'msg' => '修改成功');
|
||||
}
|
||||
/**
|
||||
* 处理百家乐Win6回档
|
||||
* $table_info 桌子的数据
|
||||
* $data 当前回合数据
|
||||
* $serv swoole对象
|
||||
* $connections 链接ID
|
||||
*/
|
||||
function retreated_baccarat_win6($game_id,$table_id,$boot_id,$number_tab_id,$resultData,$number_tab_info){
|
||||
$lastNumberTabInfo = $number_tab_info;
|
||||
//首先更新会员账户余额,减去相应的投注额
|
||||
$bets = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'status' => 1))->select();
|
||||
$oBets = $bets;
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id']);
|
||||
}
|
||||
//删除上一铺下注、洗码、分成
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
$opening = $resultData['opening'];
|
||||
$pair = $resultData['pair'];
|
||||
$isWin6 = $resultData['win6'] == 1 ? 1 : 0;
|
||||
Db::name('number_tab')->where(array('id' => $lastNumberTabInfo['id']))->update(array('result' => $opening, 'pair' => $pair, 'win6' => $isWin6));
|
||||
//记录修改日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 1;
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $lastNumberTabInfo['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $lastNumberTabInfo['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $number_tab_id;
|
||||
$retreated_log_data['number'] = $lastNumberTabInfo['number'];
|
||||
$str = '';
|
||||
if($lastNumberTabInfo['result'] == 1) $str = '庄';
|
||||
if($lastNumberTabInfo['result'] == 2) $str = '闲';
|
||||
if($lastNumberTabInfo['result'] == 3) $str = '和';
|
||||
if($lastNumberTabInfo['pair'] == 1) $str = $str.'-庄对';
|
||||
if($lastNumberTabInfo['pair'] == 2) $str = $str.'-闲对';
|
||||
if($lastNumberTabInfo['pair'] == 3) $str = $str.'-庄闲对';
|
||||
if($lastNumberTabInfo['win6'] == 1) $str = $str.'-赢6';
|
||||
$nstr = '';
|
||||
if($opening == 1) $nstr = '庄';
|
||||
if($opening == 2) $nstr = '闲';
|
||||
if($opening == 3) $nstr = '和';
|
||||
if($pair == 1) $nstr = $nstr.'-庄对';
|
||||
if($pair == 2) $nstr = $nstr.'-闲对';
|
||||
if($pair == 3) $nstr = $nstr.'-庄闲对';
|
||||
if($isWin6 == 1) $nstr = $nstr.'-赢6';
|
||||
$retreated_log_data['remark'] = '该口原本结果为:'.$str.',更改为:'.$nstr;
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
if(!empty($oBets)){
|
||||
foreach($oBets AS $k => $v){
|
||||
$user_info = Db::name('user')->field(array('id','money','agent_parent_id_path'))->where(array('id' => intval($v['user_id'])))->find();
|
||||
if($user_info){
|
||||
$amount = 0;
|
||||
$amount = $v['banker_amount'] + $v['player_amount'] + $v['tie_amount'] + $v['banker_pair_amount'] + $v['player_pair_amount'];
|
||||
$win_money = 0;
|
||||
$BPT_ximaliang = 0;
|
||||
if($opening == 1){
|
||||
// 庄赢
|
||||
if($v['banker_amount'] > 0){
|
||||
if($isWin6 === 1){
|
||||
$win_money = $v['banker_amount'] * (1 + 0.5) + $win_money;
|
||||
}else{
|
||||
$win_money = $v['banker_amount'] * (1 + 1) + $win_money;
|
||||
}
|
||||
}
|
||||
$BPT_ximaliang = $v['player_amount'] + $v['tie_amount'];
|
||||
}elseif($opening == 2){
|
||||
// 闲赢
|
||||
if($v['player_amount'] > 0){
|
||||
if($isWin6 === 1){
|
||||
$win_money = $v['player_amount'] * (1 + 0.5) + $win_money;
|
||||
}else{
|
||||
$win_money = $v['player_amount'] * (1 + 1) + $win_money;
|
||||
}
|
||||
}
|
||||
$BPT_ximaliang = $v['banker_amount'] + $v['tie_amount'];
|
||||
}elseif($opening == 3) {
|
||||
// 和赢
|
||||
if($v['tie_amount'] > 0){
|
||||
$win_money = $v['tie_amount'] * (1 + 8) + $win_money;
|
||||
}
|
||||
// 开 和,下注庄和闲不扣钱
|
||||
if($v['banker_amount'] > 0 && $v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $v['banker_amount'] + $win_money;
|
||||
}elseif($v['banker_amount'] > 0){
|
||||
$win_money = $v['banker_amount'] + $win_money;
|
||||
} elseif ($v['player_amount'] > 0){
|
||||
$win_money = $v['player_amount'] + $win_money;
|
||||
}
|
||||
//$BPT_ximaliang = $v['banker_amount'] + $v['player_amount'];
|
||||
}
|
||||
$PAIR_ximaliang = 0;
|
||||
if($pair == 3){
|
||||
// 计算庄对下注的赢钱金额
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
//计算闲对下注的赢钱金额
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
}elseif($pair == 1){
|
||||
if ($v['banker_pair_amount'] > 0) {
|
||||
$win_money = $v['banker_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
$PAIR_ximaliang = $PAIR_ximaliang + $v['player_pair_amount'];
|
||||
}elseif($pair == 2){
|
||||
if ($v['player_pair_amount'] > 0) {
|
||||
$win_money = $v['player_pair_amount'] * (1 + 11) + $win_money;
|
||||
}
|
||||
$PAIR_ximaliang = $PAIR_ximaliang + $v['banker_pair_amount'];
|
||||
}else{
|
||||
$PAIR_ximaliang = $v['player_pair_amount'] + $v['banker_pair_amount'];
|
||||
}
|
||||
$ximaliang = $BPT_ximaliang + $PAIR_ximaliang;
|
||||
// 计算最终赢钱还是输钱
|
||||
$win_total = $win_money - $amount;
|
||||
//更新user表余额
|
||||
$money = $user_info['money'] + $win_total;
|
||||
Db::name('user')->where(array('id' => $user_info['id']))->update(array('money' => $money));
|
||||
//更新bet表
|
||||
$insertBetData = $v;
|
||||
$insertBetData['result'] = $opening;
|
||||
$insertBetData['pair'] = $pair;
|
||||
$insertBetData['win_total'] = $win_total;
|
||||
$insertBetData['is_edit'] = 1;
|
||||
Db::name('bet')->insert($insertBetData);
|
||||
//写入cs表
|
||||
$agent = explode(',', $user_info['agent_parent_id_path']); //切割多个代理ID为数组
|
||||
krsort($agent);
|
||||
$nextCs = 0;
|
||||
foreach($agent as $key => $value){
|
||||
$user_path_info = Db::name('user')->where(array('id' => $value))->find();
|
||||
if($user_path_info){
|
||||
if($user_path_info['agent_cs'] > 0){
|
||||
$type = $key == 0 ? 1 : 0;
|
||||
$share_amount = to_number(($user_path_info['agent_cs'] * $win_total) / 100);
|
||||
$share_amount_true = 0;
|
||||
$net_cs = $share_amount - $share_amount;
|
||||
$nextCs = $net_cs + $nextCs;
|
||||
$insert_cs_sql = "INSERT INTO `cg_cs` (`user_id`,`bet_user_id`,`bet_id`,`game_id`,`table_id`,`number_tab_id`,`boot_id`,`sumday_id`,`day`,`share_amount`,`share_amount_true`,`share_percent`,`total`,`win_total`,`create_time`,`type`,`net_cs`) VALUES (".$value.",".$user_info['id'].",".$v['id'].",".$v['game_id'].",".$v['table_id'].",".$v['number_tab_id'].",".$v['boot_id'].",".$v['sumday_id'].",'".$v['day']."',".$share_amount.",".$share_amount_true.",".$user_path_info['agent_cs'].",".$amount.",".$win_total.",".time().",".$type.",".$net_cs.")";
|
||||
Db::execute($insert_cs_sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return array('code' => 1, 'msg' => '修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理牛牛作废本局
|
||||
* 作废逻辑:回滚所有用户余额,将bet状态标记为已作废(status=2),删除洗码/分成/代理抽水记录
|
||||
* $game_id 游戏ID (4=牛牛)
|
||||
* $table_id 桌子ID
|
||||
* $boot_id 靴ID
|
||||
* $number_tab_id 铺ID
|
||||
* $number_tab_info 当前铺数据
|
||||
*/
|
||||
function retreated_nn($game_id,$table_id,$boot_id,$number_tab_id,$number_tab_info){
|
||||
$lastNumberTabInfo = $number_tab_info;
|
||||
// 1. 获取该局所有有效下注记录(status=1)
|
||||
$bets = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'status' => 1))->select();
|
||||
if(empty($bets)){
|
||||
return array('code' => 0, 'msg' => '该局没有下注记录,无需作废');
|
||||
}
|
||||
// 2. 回滚用户余额:减去已结算的win_total(赢了的扣回,输了的退回)
|
||||
foreach($bets AS $key => $value){
|
||||
$bet_win_total = $value['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$value['user_id']);
|
||||
}
|
||||
// 3. 将bet记录标记为已作废(status=2),而非删除,保留审计痕迹
|
||||
Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'status' => 1))->update(array('status' => 2));
|
||||
// 4. 删除该局的洗码、分成、代理抽水记录
|
||||
Db::name('xima')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('cs')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
Db::name('agent_commission')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id']))->delete();
|
||||
// 5. 处理抢庄用户的余额回滚
|
||||
if($lastNumberTabInfo['rob_banker_id'] > 0){
|
||||
$bankerBet = Db::name('bet')->where(array('game_id' => $game_id, 'table_id' => $table_id, 'boot_id' => $boot_id, 'number_tab_id' => $lastNumberTabInfo['id'], 'user_id' => $lastNumberTabInfo['rob_banker_id']))->find();
|
||||
if($bankerBet && $bankerBet['status'] != 2){
|
||||
$bet_win_total = $bankerBet['win_total'];
|
||||
Db::execute("update `cg_user` set `money` = `money` - ".$bet_win_total." where `id`=".$bankerBet['user_id']);
|
||||
Db::name('bet')->where(array('id' => $bankerBet['id']))->update(array('status' => 2));
|
||||
}
|
||||
}
|
||||
// 6. 记录作废操作日志
|
||||
$retreated_log_data = array();
|
||||
$retreated_log_data['mode'] = 2; // mode=2 表示作废
|
||||
$retreated_log_data['type'] = 1;
|
||||
$retreated_log_data['create_time'] = time();
|
||||
$retreated_log_data['gamei_id'] = $game_id;
|
||||
$retreated_log_data['table_id'] = $table_id;
|
||||
$retreated_log_data['table_name'] = $lastNumberTabInfo['table_name'];
|
||||
$retreated_log_data['boot_id'] = $boot_id;
|
||||
$retreated_log_data['boot_num'] = $lastNumberTabInfo['boot_num'];
|
||||
$retreated_log_data['number_tab_id'] = $number_tab_id;
|
||||
$retreated_log_data['number'] = $lastNumberTabInfo['number'];
|
||||
$str = '庄:'.$lastNumberTabInfo['result_banker'].' 闲1:'.$lastNumberTabInfo['result_player_1'].' 闲2:'.$lastNumberTabInfo['result_player_2'].' 闲3:'.$lastNumberTabInfo['result_player_3'];
|
||||
$retreated_log_data['remark'] = '牛牛作废本局,原结果为:'.$str.',已退回所有投注额';
|
||||
Db::name('retreated_log')->insert($retreated_log_data);
|
||||
return array('code' => 1, 'msg' => '作废成功,已退回所有投注额');
|
||||
}
|
||||
}
|
||||
246
application/admin/controller/Xima.php
Normal file
246
application/admin/controller/Xima.php
Normal file
@ -0,0 +1,246 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Db;
|
||||
use think\Request;
|
||||
use think\Session;
|
||||
|
||||
class Xima extends Common{
|
||||
/**
|
||||
* 可以洗码的会员及列表
|
||||
*/
|
||||
public function index(){
|
||||
Session::set('allowSubmit','YES');
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('get',$get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索的条件信息
|
||||
$username = Request::instance()->get('username');
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
if(!empty($username)) $where['username'] = $username;
|
||||
$where['is_delete'] = 0;
|
||||
$where['agent'] = 1;
|
||||
$where['agent_parent_id'] = 0;
|
||||
// 获取所有代理信息
|
||||
$agent_list = Db::name('user')->where($where)->order('id desc')->paginate(10,false,array('query'=>$get));
|
||||
// 数据查询条件
|
||||
$sumWhere = array();
|
||||
$sumWhere['create_time'] = array('between',[$startTime,$endTime]);
|
||||
foreach($agent_list AS $k => $v){
|
||||
$sumWhere['user_id'] = $v['id'];
|
||||
$sumWhere['status'] = 1;
|
||||
//洗码量
|
||||
$v['totalXimaliang'] = Db::name('xima')->where($sumWhere)->sum('ximaliang');
|
||||
//码量
|
||||
$v['maliang'] = Db::name('xima')->where($sumWhere)->sum('maliang');
|
||||
//已结码量
|
||||
$v['checkoutMaliang'] = Db::name('xima')->where($sumWhere)->where(array('is_checkout' => 1))->sum('maliang');
|
||||
//未结码量
|
||||
$v['noCheckoutMaliang'] = Db::name('xima')->where(array('user_id'=>$v['id'],'is_checkout' => 0))->sum('maliang');
|
||||
//最后结算时间
|
||||
if($v['last_xima_time'] > 0){
|
||||
$v['last_xima_time'] = date('Y-m-d H:i:s',$v['last_xima_time']);
|
||||
}else{
|
||||
$v['last_xima_time'] = '-';
|
||||
}
|
||||
$agent_list[$k] = $v;
|
||||
}
|
||||
// 渲染变量和模板
|
||||
$this->assign('agent_list',$agent_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
//处理洗码
|
||||
public function do_xima(){
|
||||
$result = array();
|
||||
$user_info = Session::get('user_info');
|
||||
if(Request::instance()->post() && intval(Request::instance()->post('user_id')) > 0){
|
||||
$user_id = intval(Request::instance()->post('user_id'));
|
||||
$find = Db::name('user')->where(array('id' => $user_id, 'status' => 1, 'is_delete' => 0))->find();
|
||||
if(!$find){
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '账号处于非正常状态,请确保账号正常再进行操作';
|
||||
die(json_encode($result));
|
||||
}
|
||||
if($find['agent_parent_id'] > 0) {
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '不允许洗码。请联系其经纪人为其洗码。';
|
||||
die(json_encode($result));
|
||||
}
|
||||
$ximaliang_unbalanced = Db::name('xima')->where(array('status' => 1, 'user_id' => $user_id, 'is_checkout' => 0))->sum('ximaliang');
|
||||
$maliang_unbalanced = Db::name('xima')->where(array('status' => 1, 'user_id' => $user_id, 'is_checkout' => 0))->sum('maliang');
|
||||
if($maliang_unbalanced > 0){
|
||||
//防止重复提交
|
||||
$allowSubmit = Session::get('allowSubmit');
|
||||
if($allowSubmit == 'YES'){
|
||||
Session::delete('allowSubmit');
|
||||
}else{
|
||||
Session::delete('allowSubmit');
|
||||
die(json_encode(['errorCode' => 1, 'errorMessage' => "请勿重复提交"]));
|
||||
}
|
||||
//查找下边的会员
|
||||
$uodateRusult = Db::name('xima')->where(array('status' => 1, 'user_id' => $user_id, 'is_checkout' => 0))->update(array('is_checkout' => 1,'checkout_time' => time()));
|
||||
if($uodateRusult){
|
||||
//记录到洗码日志
|
||||
$insertData = array();
|
||||
$insertData['user_id'] = $user_id;
|
||||
$insertData['username'] = $find['username'];
|
||||
$insertData['ximaliang'] = $ximaliang_unbalanced;
|
||||
$insertData['maliang'] = $maliang_unbalanced;
|
||||
if($find['type_xima'] == 1){
|
||||
$insertData['agent_ximalv'] = $find['agent_ximalv'].'/'.$find['agent_ximalv_dt'].'/'.$find['agent_ximalv_nn'];
|
||||
}elseif($user['type_xima'] == 2){
|
||||
$insertData['agent_ximalv'] = $find['agent_ximalv_single'].'/'.$find['agent_ximalv_dt_single'].'/'.$find['agent_ximalv_nn_single'];
|
||||
}else{
|
||||
$insertData['agent_ximalv'] = '0/0/0';
|
||||
}
|
||||
$insertData['create_time'] = time();
|
||||
$insertData['old_money'] = 0;
|
||||
$insertData['new_money'] = 0;
|
||||
$insertData['admin_id'] = $user_info['id'];
|
||||
$insertData['admin_username'] = $user_info['admin'];
|
||||
$insertData['admin_or_agent'] = 1;
|
||||
Db::name('xima_log')->insert($insertData);
|
||||
//上分表增加记录
|
||||
$rechargeData = array();
|
||||
$rechargeData['type'] = 2;
|
||||
$rechargeData['amount'] = $maliang_unbalanced;
|
||||
$rechargeData['mode'] = 1;
|
||||
$rechargeData['agent_or_admin'] = 1;
|
||||
$rechargeData['user_id'] = $user_id;
|
||||
$rechargeData['user_type'] = $find['agent'];
|
||||
$rechargeData['user_agent_level'] = $find['agent_level'];
|
||||
$rechargeData['username_for'] = $find['username'];
|
||||
$rechargeData['nickname_for'] = $find['nickname'];
|
||||
$rechargeData['user_parent_id'] = $find['agent_parent_id'];
|
||||
$rechargeData['admin_id'] = $user_info['id'];
|
||||
$rechargeData['admin_user_name'] = $user_info['admin'];
|
||||
$rechargeData['create_time'] = time();
|
||||
$rechargeData['old_money'] = $find['money'];
|
||||
$rechargeData['new_money'] = $find['money'];
|
||||
$rechargeData['remake'] = '总后台操作洗码';
|
||||
Db::name('recharge')->insert($rechargeData);
|
||||
Db::name('user')->where(array('id' => $user_id))->update(array('last_xima_time' => time()));
|
||||
}
|
||||
$result['errorCode'] = 0;
|
||||
$result['errorMessage'] = '洗码成功';
|
||||
die(json_encode($result));
|
||||
}else{
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = '洗码数目必须大于0';
|
||||
die(json_encode($result));
|
||||
}
|
||||
}else{
|
||||
$result['errorCode'] = 1;
|
||||
$result['errorMessage'] = 'ERROR';
|
||||
die(json_encode($result));
|
||||
}
|
||||
}
|
||||
public function xima_check(){
|
||||
// 接收分页的条件
|
||||
$get = Request::instance()->get();
|
||||
$query = http_build_query($get);
|
||||
$this->assign('query',$query);
|
||||
|
||||
// 接收搜索条件
|
||||
$startDate = Request::instance()->get('startDate');
|
||||
$endDate = Request::instance()->get('endDate');
|
||||
$export = Request::instance()->get('export');
|
||||
$admin_or_agent = intval(Request::instance()->get('admin_or_agent'));
|
||||
|
||||
// 时间条件
|
||||
if($startDate){
|
||||
$startTime = strtotime($startDate);
|
||||
}else{
|
||||
$startTime = strtotime(date('Y-m-d'));
|
||||
$get['startDate'] = date('Y-m-d H:i:s',$startTime);
|
||||
}
|
||||
if($endDate){
|
||||
$endTime = strtotime($endDate);
|
||||
}else{
|
||||
$endTime = time();
|
||||
$get['endDate'] = date('Y-m-d H:i:s',$endTime);
|
||||
}
|
||||
$this->assign('get',$get);
|
||||
|
||||
// 拼装搜索条件
|
||||
$where = array();
|
||||
$where['create_time'] = array('between',[$startTime,$endTime]);
|
||||
if($admin_or_agent > 0) $where['admin_or_agent'] = $admin_or_agent;
|
||||
|
||||
if($export == 1){
|
||||
$xima_list = Db::name('xima_log')->where($where)->order('create_time desc')->select();
|
||||
}else{
|
||||
// 所有的洗码记录
|
||||
$xima_list = Db::name('xima_log')->where($where)->order('create_time desc')->paginate(10,false,array('query'=>$get));
|
||||
}
|
||||
foreach($xima_list as $k => $v){
|
||||
// 操作人
|
||||
if($v['admin_or_agent'] == 1 ){
|
||||
$v['connection_username'] = $v['admin_username'];
|
||||
$v['admin_or_agent_msg'] = '总台操作';
|
||||
}else{
|
||||
$v['admin_or_agent_msg'] = '代理操作';
|
||||
}
|
||||
// 数据格式转换
|
||||
$v['ximaliang'] = round($v['ximaliang'],2);
|
||||
$v['maliang'] = round($v['maliang'],2);
|
||||
$user = Db::name('user')->where('id',$v['user_id'])->find();
|
||||
$v['agent_ximalv'] = round($user['agent_ximalv'],2).'/'.round($user['agent_ximalv_dt'],2).'/'.round($user['agent_ximalv_nn'],2);
|
||||
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
|
||||
$xima_list[$k] = $v;
|
||||
}
|
||||
|
||||
//导出excel列表
|
||||
if($export == 1){
|
||||
if($xima_list){
|
||||
//重新组合
|
||||
$excelData = array();
|
||||
foreach($xima_list AS $k => $v){
|
||||
$excelData[$k][0] = $v['username'];
|
||||
$excelData[$k][1] = $v['agent_ximalv'];
|
||||
$excelData[$k][2] = $v['ximaliang'];
|
||||
$excelData[$k][3] = $v['maliang'];
|
||||
$excelData[$k][4] = $v['connection_username'];
|
||||
$excelData[$k][5] = $v['create_time'];
|
||||
$excelData[$k][6] = $v['admin_or_agent_msg'];
|
||||
}
|
||||
$title = array('账号','洗码率(百/龙/牛)%','洗码量','洗码费','操作人','洗码时间','备注');
|
||||
if($startDate && $endDate){
|
||||
$this->exportExcelCore($excelData, '洗码记录-'.$startDate."-".$endDate, $title);
|
||||
}else{
|
||||
$this->exportExcelCore($excelData, '洗码记录', $title);
|
||||
}
|
||||
exit('已导出支持列表,请不要重复刷新该页面!');
|
||||
}else{
|
||||
exit('没有可以导出的列表!');
|
||||
}
|
||||
}
|
||||
|
||||
// 渲染参数和模板
|
||||
$this->assign('xima_list',$xima_list);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
168
application/admin/view/admin/admin-add.html
Normal file
168
application/admin/view/admin/admin-add.html
Normal file
@ -0,0 +1,168 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">状态:</label>
|
||||
<div class="controls">
|
||||
<select id="L_status" name="L_status" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<option value="1" selected>正常</option>
|
||||
<option value="0">锁定</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remarks" name="L_remarks" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/admin/index';
|
||||
if(id == "2") location.href = '/admin/admin_add';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.username = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.status = $('#L_status').val();
|
||||
query.remarks = $('#L_remarks').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.username.length == 0){
|
||||
layer.alert("请填写账号!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length <= 0){
|
||||
layer.alert("请填写密码!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length > 0 && query.pass.length < 6){
|
||||
layer.alert("密码长度为6到16个字符!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/admin/do_admin_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/admin/index";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
165
application/admin/view/admin/admin-edit.html
Normal file
165
application/admin/view/admin/admin-edit.html
Normal file
@ -0,0 +1,165 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$admin.admin}" readonly maxlength="50" minlength="3" class="required" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 密码默认为空不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 密码默认为空不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value="{$admin.mobile}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value="{$admin.email}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">状态:</label>
|
||||
<div class="controls">
|
||||
<select id="L_status" name="L_status" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<option value="1" <?php if($admin['status'] == 1) echo 'selected'; ?>>正常</option>
|
||||
<option value="0" <?php if($admin['status'] == 0) echo 'selected'; ?>>锁定</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remarks" name="L_remarks" type="text" value maxlength="50" minlength="3" class="required">{$admin.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="admin-id" value="{$admin.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/admin/index';
|
||||
if(id == "2") location.href = '/admin/admin_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.admin_id = $('#admin-id').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.remarks = $('#L_remarks').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var re = /1[\d]{6,10}/;
|
||||
if(!re.test(query.mobile)){
|
||||
layer.msg("请填写正确的手机号码!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/admin/do_admin_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/admin/index';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
37
application/admin/view/admin/admin_print.html
Normal file
37
application/admin/view/admin/admin_print.html
Normal file
@ -0,0 +1,37 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">用户列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">编号</th>
|
||||
<th style="text-align: center;">用户名</th>
|
||||
<th style="text-align: center;">电话</th>
|
||||
<th style="text-align: center;">邮箱</th>
|
||||
<th style="text-align: center;">最后登录IP</th>
|
||||
<th style="text-align: center;">最后登录时间</th>
|
||||
<th style="text-align: center;">状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="admin_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.admin}</td>
|
||||
<td>{$vo.mobile}</td>
|
||||
<td>{$vo.email}</td>
|
||||
<td>{$vo.last_login_ip}</td>
|
||||
<td>{$vo.last_login_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td>正常</td>
|
||||
{else}
|
||||
<td>锁定中</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
363
application/admin/view/admin/index.html
Executable file
363
application/admin/view/admin/index.html
Executable file
@ -0,0 +1,363 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:40%; border-left:none; text-align:right;}
|
||||
.alert-main td{border-right:none; }
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">玩家列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">玩家添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/index" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="status" id="status">
|
||||
<option value="-1" >请选择玩家状态</option>
|
||||
<option value="1" <?php if(isset($get['status']) && $get['status'] == 1) {echo 'selected';} ?>>正常</option>
|
||||
<option value="2" <?php if(isset($get['status']) && $get['status'] == 2) {echo 'selected';} ?>>锁定</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<input type="text" name="agent_parent" id="agent_parent" placeholder="请输入上级代理" autocomplete="off" class="layui-input" value="<?php if(isset($get['agent_parent'])) {echo $get['agent_parent'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>联系人</th>
|
||||
<th>手机</th>
|
||||
<th>邮箱</th>
|
||||
<th>上级代理</th>
|
||||
<th>投注方式</th>
|
||||
<th>最近上分</th>
|
||||
<th>商户余额</th>
|
||||
<th>百家乐码率(%)</th>
|
||||
<th>龙虎码率(%)</th>
|
||||
<th>总下注</th>
|
||||
<th>总赢</th>
|
||||
<th>码量</th>
|
||||
<th>日赢上限</th>
|
||||
<th>赔率</th>
|
||||
<th>创建日期</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.mobile}</td>
|
||||
<td>{$vo.email}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>{$vo.bet_type}</td>
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.agent_ximalv_dt}</td>
|
||||
<td>{$vo.all_bet_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.maliang}</td>
|
||||
<td>{$vo.win_limit}</td>
|
||||
<th>
|
||||
<a href="javascript:;" onclick="showPrice(this)" price-username="{$vo.username}" price-banker="{$vo.price_banker}" price-player="{$vo.price_player}" price-tie-baccarat="{$vo.price_tie_baccarat}" price-pair="{$vo.price_pair}" price-dragon="{$vo.price_dragon}" price-tiger="{$vo.price_tiger}" price-tie-dt="{$vo.price_tie_dt}" price-n7-n9="{$vo.price_n7_n9}" price-nn="{$vo.price_nn}" price-5n="{$vo.price_5n}" price-bomb="{$vo.price_bomb}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" >查看</span>
|
||||
</a>
|
||||
</th>
|
||||
<td style="width:80px;">{$vo.reg_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="td-manage">
|
||||
{if condition="$vo.status == 1"}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="锁定">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">锁定</span>
|
||||
</a>
|
||||
{else}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="解锁">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">解锁</span>
|
||||
</a>
|
||||
{/if}
|
||||
<a href="/player/player_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$agent_list->render()}
|
||||
</div>
|
||||
<div class="alert" id="alert_price">
|
||||
<div class="alert-title" id="show_price_username"></div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th>押庄赔率:</th><td id="show_price_banker"></td></tr>
|
||||
<tr><th>押闲赔率:</th><td id="show_price_player"></td></tr>
|
||||
<tr><th>押和赔率(百家乐):</th><td id="show_price_tie_baccarat"></td></tr>
|
||||
<tr><th>押对子赔率:</th><td id="show_price_pair"></td></tr>
|
||||
<tr><th>押龙赔率:</th><td id="show_price_dragon"></td></tr>
|
||||
<tr><th>押虎赔率:</th><td id="show_price_tiger"></td></tr>
|
||||
<tr><th>押和赔率(龙虎斗):</th><td id="show_price_tie_dt"></td></tr>
|
||||
<tr><th>押牛7-牛9赔率:</th><td id="show_price_n7_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率:</th><td id="show_price_nn"></td></tr>
|
||||
<tr><th>押五公赔率:</th><td id="show_price_5n"></td></tr>
|
||||
<tr><th>押四条赔率:</th><td id="show_price_bomb"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hiddenForm('alert_price')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/*用户-锁定/解锁*/
|
||||
function member_stop(obj, id) {
|
||||
layer.confirm('确认要' + $(obj).attr('title') + '吗?', function (index) {
|
||||
if ($(obj).attr('title') == '锁定') {
|
||||
// 拼装数据发送后台 锁定 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 0;
|
||||
var result = ajax('/player/change_status', query);
|
||||
} else {
|
||||
// 拼装数据发送后台 解锁 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 1;
|
||||
var result = ajax('/player/change_status', query);
|
||||
}
|
||||
|
||||
// 判断结果 弹出提示
|
||||
if (result.code == 1) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1500});
|
||||
setInterval(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1500});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/player/player_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var status = qs["status"];
|
||||
var username = qs["username"];
|
||||
var agent_parent = qs["agent_parent"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(status == undefined){
|
||||
status = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
if(agent_parent == undefined){
|
||||
agent_parent = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'玩家列表打印',
|
||||
content: '/player/player_print?startDate='+startDate+'&endDate='+endDate+'&status='+status+'&username='+username+'&agent_parent='+agent_parent,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var status = $('#status').val();
|
||||
var agent_parent = $('#agent_parent').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/player/index?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&status="+status+"&&agent_parent="+agent_parent+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
|
||||
// 显示用户的赔率
|
||||
function showPrice(obj){
|
||||
// 获取赔率数据
|
||||
var price_username = $(obj).attr('price-username');
|
||||
var price_banker = $(obj).attr('price-banker');
|
||||
var price_player = $(obj).attr('price-player');
|
||||
var price_tie_baccarat = $(obj).attr('price-tie-baccarat');
|
||||
var price_pair = $(obj).attr('price-pair');
|
||||
var price_dragon = $(obj).attr('price-dragon');
|
||||
var price_tiger = $(obj).attr('price-tiger');
|
||||
var price_tie_dt = $(obj).attr('price-tie-dt');
|
||||
var price_n7_n9 = $(obj).attr('price-n7-n9');
|
||||
var price_nn = $(obj).attr('price-nn');
|
||||
var price_5n = $(obj).attr('price-5n');
|
||||
var price_bomb = $(obj).attr('price-bomb');
|
||||
|
||||
// 显示赔率数据
|
||||
$('#show_price_username').html(price_username+" 的赔率");
|
||||
$('#show_price_banker').html(price_banker);
|
||||
$('#show_price_player').html(price_player);
|
||||
$('#show_price_tie_baccarat').html(price_tie_baccarat);
|
||||
$('#show_price_pair').html(price_pair);
|
||||
$('#show_price_dragon').html(price_dragon);
|
||||
$('#show_price_tiger').html(price_tiger);
|
||||
$('#show_price_tie_dt').html(price_tie_dt);
|
||||
$('#show_price_n7_n9').html(price_n7_n9);
|
||||
$('#show_price_nn').html(price_nn);
|
||||
$('#show_price_5n').html(price_5n);
|
||||
$('#show_price_bomb').html(price_bomb);
|
||||
|
||||
$('#alert_price').show();
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#' + id).hide();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
411
application/admin/view/admin/player-add.html
Executable file
411
application/admin/view/admin/player-add.html
Executable file
@ -0,0 +1,411 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">玩家列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">玩家添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">上级代理:</label>
|
||||
<div class="controls">
|
||||
<select name="parent_agent" id="parent_agent">
|
||||
<option value="0">无</option>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<option value="{$vo.id}">{$vo.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占成(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1">网络投注</option>
|
||||
<option value="2">电话投注</option>
|
||||
<option value="3">所有投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="0.95" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="1" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="2" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="3" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="5" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="4.85" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="0" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_add';
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
|
||||
$('.submit').click( function(){
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.parent_agent_id = $('#parent_agent').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.username.length == 0){
|
||||
layer.alert("请填写账号!");
|
||||
return false;
|
||||
}
|
||||
if(query.nickname.length == 0){
|
||||
layer.alert("请填写昵称!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length <= 0){
|
||||
layer.alert("请填写密码!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length > 0 && query.pass.length < 6){
|
||||
layer.alert("密码长度为6到16个字符!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv >= 100){
|
||||
layer.alert("洗码率最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_dt >= 100){
|
||||
layer.alert("洗码率最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.cs > 100){
|
||||
layer.alert("占成最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_pair <= 0){
|
||||
layer.alert("押对子赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/player/do_player_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/player/index";
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
389
application/admin/view/admin/player-edit.html
Executable file
389
application/admin/view/admin/player-edit.html
Executable file
@ -0,0 +1,389 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">代理列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">玩家修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">上级代理:</label>
|
||||
<div class="controls">
|
||||
<input id="L_parent_agent" name="L_parent_agent" type="text" value="{$parent_agent.username}" maxlength="50" minlength="3" class="required" readonly>
|
||||
<span class="help-inline">
|
||||
<font color="red"> </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$player.username}" readonly maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value="{$player.nickname}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 不填密码默认不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填密码默认不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value="{$player.mobile}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value="{$player.email}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="{$player.agent_ximalv}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="{$player.agent_ximalv_dt}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv_dt}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占成(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value="{$player.agent_cs}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_cs}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" maxlength="10" class="required" value="{$player.limit_low}"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" maxlength="10" class="required" value="{$player.limit_high}"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1" <?php if($player['bet_type'] == 1) {echo 'selected';} ?>>网络投注</option>
|
||||
<option value="2" <?php if($player['bet_type'] == 2) {echo 'selected';} ?>>电话投注</option>
|
||||
<option value="3" <?php if($player['bet_type'] == 3) {echo 'selected';} ?>>所有投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="{$player.price_banker}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="{$player.price_player}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="{$player.price_tie_baccarat}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="{$player.price_dragon}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="{$player.price_tiger}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="{$player.price_tie_dt}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="{$player.price_n7_n9}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="{$player.price_nn}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="{$player.price_5n}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="{$player.price_bomb}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="{$player.win_limit}" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="player-id" value="{$player.id}">
|
||||
<input type="hidden" id="parent-ximalv" value="{$parent_agent.agent_ximalv}">
|
||||
<input type="hidden" id="parent-ximalv-dt" value="{$parent_agent.agent_ximalv_dt}">
|
||||
<input type="hidden" id="parent-cs" value="{$parent_agent.agent_cs}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function () {
|
||||
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.player_id = $('#player-id').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
var parent_ximalv = $('#parent-ximalv').val();
|
||||
var parent_ximalv_dt = $('#parent-ximalv-dt').val();
|
||||
var parent_cs = $('#parent-cs').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(parseFloat(query.ximalv) > parseFloat(parent_ximalv) || parseFloat(query.ximalv_dt) > parseFloat(parent_ximalv_dt)){
|
||||
layer.msg("码率不能超过父级码率");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.cs) > parseFloat(parent_cs)){
|
||||
layer.msg("占成不能超过父级占成");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/player/do_player_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/player/index';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
250
application/admin/view/admin/user_online.html
Executable file
250
application/admin/view/admin/user_online.html
Executable file
@ -0,0 +1,250 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:16px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:80px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:150px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert .alert-main{width:600px;height:200px;overflow-y: scroll;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:40%; border-left:none; text-align:right;}
|
||||
.alert-main td{border-right:none; }
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">实时数据</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/user_online" method="get">
|
||||
<div class="layui-input-block" >
|
||||
<select name="table_id" id="table_id">
|
||||
<option value="-1" selected>请选择桌子</option>
|
||||
{foreach name="$table_list" item="vo"}
|
||||
<option value="{$vo.id}" <?php if(isset($get['table_id']) && $get['table_id'] == $vo['id']) {echo 'selected';} ?>>{$vo.table_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<div class="layui-form-item" style="margin-bottom: 0px;">
|
||||
<label class="layui-form-label">只看未开</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" class="is_under" name="is_under" value="1" title="是" <?php if(isset($get['is_under']) && $get['is_under'] == 1) {echo 'checked';} ?>>
|
||||
<input type="radio" class="is_under" name="is_under" value="0" title="否" <?php if(isset($get['is_under']) && $get['is_under'] == 0) {echo 'checked';} ?>>
|
||||
</div>
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
|
||||
<!-- <span class="layui-btn" id="export">导出excel</span>
|
||||
<span class="layui-btn" id="print">打印</span> -->
|
||||
<span style="margin-left:20px;color:red;">数据标红则疑似对打</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>登录客户端</th>
|
||||
<th>登录IP</th>
|
||||
<th>总押</th>
|
||||
<th>总赢</th>
|
||||
<th>当前余额</th>
|
||||
<th>下注详情</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="ttable">
|
||||
{foreach name="$user_online" item="vo"}
|
||||
{if $vo.is_beat == 1}
|
||||
<tr class="refreshData" style="background:red;">
|
||||
{else}
|
||||
<tr class="refreshData">
|
||||
{/if}
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.client}</td>
|
||||
<td>{$vo.last_login_ip}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>
|
||||
{$vo.bet_detail_first.bet_detail}
|
||||
{if condition="$vo.bet_detail_count > 1"}
|
||||
<a href="javascript:;" onclick="showBetDetail(this)" data-username="{$vo.username}" data-bet_detail={$vo.bet_detail}><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">更多</span></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" onclick="logout({$vo.user_id})">强制下线</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr class="refreshData">
|
||||
<th colspan="3" style="text-align: center;">统计</th>
|
||||
<th>{$totalData.amount}</th>
|
||||
<th>{$totalData.win_total}</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<audio id="audio" hidden></audio>
|
||||
<div class="alert" id="alert_bet_detail">
|
||||
<div class="alert-title" id="show_username"></div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th>押庄赔率:</th><td id="show_price_banker"></td></tr>
|
||||
<tr><th>押闲赔率:</th><td id="show_price_player"></td></tr>
|
||||
<tr><th>押和赔率(百家乐):</th><td id="show_price_tie_baccarat"></td></tr>
|
||||
<tr><th>押对子赔率:</th><td id="show_price_pair"></td></tr>
|
||||
<tr><th>押龙赔率:</th><td id="show_price_dragon"></td></tr>
|
||||
<tr><th>押虎赔率:</th><td id="show_price_tiger"></td></tr>
|
||||
<tr><th>押和赔率(龙虎斗):</th><td id="show_price_tie_dt"></td></tr>
|
||||
<tr><th>押牛7-牛9赔率:</th><td id="show_price_n7_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率:</th><td id="show_price_nn"></td></tr>
|
||||
<tr><th>押五公赔率:</th><td id="show_price_5n"></td></tr>
|
||||
<tr><th>押四条赔率:</th><td id="show_price_bomb"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hideBetDetail()" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var b = {$betIdArrJson};
|
||||
var bt = {$betIdDtArrJson};
|
||||
autoRefresh();
|
||||
function autoRefresh(){
|
||||
setInterval(function(){
|
||||
var username = $('#username').val();
|
||||
var table_id = $('#table_id').val();
|
||||
var is_under = $('.is_under:checked').val();
|
||||
$.ajax({
|
||||
url:'/player/user_online_autoRefresh',
|
||||
data:{username:username,table_id:table_id,is_under:is_under},
|
||||
dataType:'JSON',
|
||||
type:'POST',
|
||||
success:function(data){
|
||||
// 声音
|
||||
if(data.is_new == true){
|
||||
audioShow();
|
||||
}
|
||||
if(data.user_online){
|
||||
var total = data.totalData;
|
||||
var v = data.user_online;
|
||||
b = data.betIdArr;
|
||||
bt = data.betIdDtArr;
|
||||
var str = "";
|
||||
for(var i=0; i<v.length; i++){
|
||||
if(v[i]['is_beat'] == 1){
|
||||
str += '<tr class="refreshData" style="background:red;">';
|
||||
}else{
|
||||
str += '<tr class="refreshData">';
|
||||
}
|
||||
str += '<td>'+v[i].username+'</td>';
|
||||
str += '<td>'+v[i].client+'</td>';
|
||||
str += '<td>'+v[i].last_login_ip+'</td>';
|
||||
str += '<td>'+v[i].amount+'</td>';
|
||||
str += '<td>'+v[i].win_total+'</td>';
|
||||
str += '<td>'+v[i].money+'</td>';
|
||||
str += '<td>'+v[i].bet_detail_first.bet_detail;
|
||||
if(v[i].bet_detail_count > 1){
|
||||
str += '<a href="javascript:;" onclick="showBetDetail(this)" data-username="'+v[i].username+'" data-bet_detail='+JSON.stringify(v[i].bet_detail)+'><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">更多</span></a></td>';
|
||||
}else{
|
||||
str += '</td>';
|
||||
}
|
||||
str += '<td><a href="javascript:;"><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" onclick="logout('+v[i].user_id+')">强制下线</span></a> </td>';
|
||||
str += '</tr>';
|
||||
}
|
||||
str += '<tr class="refreshData">';
|
||||
str += '<th colspan="3" style="text-align: center;">统计</th>';
|
||||
str += '<th>'+total.amount+'</th>';
|
||||
str += '<th>'+total.win_total+'</th>';
|
||||
str += '<th colspan="3"></th>';
|
||||
str += '</tr>';
|
||||
|
||||
$('.refreshData').remove();
|
||||
$('.ttable').append(str);
|
||||
}
|
||||
}
|
||||
});
|
||||
},5000);
|
||||
}
|
||||
|
||||
function showBetDetail(obj){
|
||||
var username = $(obj).attr('data-username');
|
||||
var bet_detail = $(obj).attr('data-bet_detail');
|
||||
var v = JSON.parse(bet_detail);
|
||||
var str = '';
|
||||
console.log(v)
|
||||
console.log(b.indexOf(47))
|
||||
for(var i in v){
|
||||
|
||||
if(v[i]['game_id'] == 1 && b.includes(v[i]['bet_id'])){
|
||||
str += '<tr style="background:red;"><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}else if(v[i]['game_id'] == 2 && bt.includes(v[i]['bet_id'])){
|
||||
str += '<tr style="background:red;"><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}else{
|
||||
str += '<tr><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}
|
||||
}
|
||||
$('#show_username').html(username);
|
||||
$('#alert_bet_detail').find('.layui-table').empty().html(str);
|
||||
$('#alert_bet_detail').show();
|
||||
}
|
||||
function hideBetDetail(){
|
||||
$('#alert_bet_detail').hide();
|
||||
}
|
||||
|
||||
// 踢人
|
||||
function logout(id){
|
||||
layer.confirm('确定强制该玩家下线吗?',function(){
|
||||
$.ajax({
|
||||
url:'/player/logout',
|
||||
data:{user_id:id},
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
success:function(data){
|
||||
layer.alert(data.msg,function(){
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 新客人上线声音
|
||||
function audioShow(){
|
||||
var audio = $("#audio").get(0);
|
||||
var audioPath = '/static/console/mp3/welcome.mp3';
|
||||
$('#audio').attr('src',audioPath);
|
||||
audio.play();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
815
application/admin/view/agent/agent-add.html
Executable file
815
application/admin/view/agent/agent-add.html
Executable file
@ -0,0 +1,815 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">代理列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">代理添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">总代性质:</label>
|
||||
<div class="controls">
|
||||
<input name="agent_type" class="required agent_type" type="radio" value="1" maxlength="20" style="color:#999;width:35px;" checked>
|
||||
<span style="position:relative;top:-7px;">现金线</span>
|
||||
<input name="agent_type" class="required agent_type" type="radio" value="2" maxlength="20" style="color:#999;width:35px;">
|
||||
<span style="position:relative;top:-7px;">信用线</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">支付渠道:</label>
|
||||
<div class="controls">
|
||||
{foreach name="$pay_channel_list" item="vo"}
|
||||
<span>
|
||||
<input name="pay_channel" class="required pay_channel" type="radio" value="{$vo.key}" maxlength="20" style="color:#999;width:35px;">
|
||||
<span style="position:relative;top:-7px;">{$vo.name}</span>
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">码量分担方式:</label>
|
||||
<div class="controls">
|
||||
<select id="share_xima">
|
||||
<option value="1">不分担</option>
|
||||
<option value="2">按代理占成比例分担</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">洗码方式:</label>
|
||||
<div class="controls">
|
||||
<input name="type_xima" class="required type_xima" type="radio" value="1" maxlength="20" style="color:#999;width:35px;" checked>
|
||||
<span style="position:relative;top:-7px;">双边洗码</span>
|
||||
<input name="type_xima" class="required type_xima" type="radio" value="2" maxlength="20" style="color:#999;width:35px;">
|
||||
<span style="position:relative;top:-7px;">单边洗码</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group rebate-box">
|
||||
<label class="control-label">返水率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="rebate_rate" name="rebate_rate" type="text" value="" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 返水率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">牛牛码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_nn" name="L_ximalv_nn" type="text" value="" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三卡牛牛码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_tc" name="L_ximalv_tc" type="text" value="" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占股(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 占股不能超过100%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low_tie" name="limit_low" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high_tie" name="limit_high" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低对子限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low_pair" name="limit_low" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高对子限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high_pair" name="limit_high" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1">网络投注</option>
|
||||
<option value="2">电话投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 请选择投注方式</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="0.95" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="1" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="11" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">两张牌幸运6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_luck_six_2" name="price_luck_six_2" type="text" value="12" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三张牌幸运6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_luck_six_3" name="price_luck_six_3" type="text" value="20" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押大赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_big" name="price_big" type="text" value="0.5" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押小赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_small" name="price_small" type="text" value="1.5" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押无牛-牛6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n0_n6" name="price_n0_n6" type="text" value="0.96" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="1.92" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="2.88" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="4.80" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="4.85" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛一赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n1" name="price_tc_n1" type="text" value="0.96" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛二赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n2" name="price_tc_n2" type="text" value="1.92" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛三赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n3" name="price_tc_n3" type="text" value="2.88" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛四赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n4" name="price_tc_n4" type="text" value="3.84" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛五赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n5" name="price_tc_n5" type="text" value="4.80" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛六赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n6" name="price_tc_n6" type="text" value="5.76" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛七赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n7" name="price_tc_n7" type="text" value="6.72" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛八赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n8" name="price_tc_n8" type="text" value="7.68" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛九赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n9" name="price_tc_n9" type="text" value="8.64" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_nn" name="price_tc_nn" type="text" value="9.60" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押豹子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_bz" name="price_tc_bz" type="text" value="11.52" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押同花顺赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_ths" name="price_tc_ths" type="text" value="14.40" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押皇家同花顺赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_hjths" name="price_tc_hjths" type="text" value="19.20" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="control-group">
|
||||
<label class="control-label">三卡牛牛系统抽水:</label>
|
||||
<div class="controls">
|
||||
<input id="agent_commission_tc" name="agent_commission_tc" type="text" value="0.03" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三卡牛牛庄家抽佣:</label>
|
||||
<div class="controls">
|
||||
<input id="agent_commission_tc_banker" name="agent_commission_tc_banker" type="text" value="0.05" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="0" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/agent/index';
|
||||
if(id == "2") location.href = '/agent/agent_add';
|
||||
});
|
||||
|
||||
// 切换总代性质
|
||||
$('.agent_type').change(function(){
|
||||
var agentType = $('.agent_type:checked').val();
|
||||
if(agentType == 1){
|
||||
$('.rebate-box').show();
|
||||
}else{
|
||||
$('.rebate-box').hide();
|
||||
}
|
||||
});
|
||||
$('.agent_type').change();
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.agent_type = $('.agent_type:checked').val();
|
||||
query.pay_channel = $('.pay_channel:checked').val();
|
||||
query.type_xima = $('.type_xima:checked').val();
|
||||
query.share_xima = $('#share_xima').val();
|
||||
query.rebate_rate = $('#rebate_rate').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.ximalv_nn = $('#L_ximalv_nn').val();
|
||||
query.ximalv_tc = $('#L_ximalv_tc').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.limit_low_tie = $('#limit_low_tie').val();
|
||||
query.limit_high_tie = $('#limit_high_tie').val();
|
||||
query.limit_low_pair = $('#limit_low_pair').val();
|
||||
query.limit_high_pair = $('#limit_high_pair').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_luck_six_2 = $('#price_luck_six_2').val();
|
||||
query.price_luck_six_3 = $('#price_luck_six_3').val();
|
||||
query.price_big = $('#price_big').val();
|
||||
query.price_small = $('#price_small').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n0_n6 = $('#price_n0_n6').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
query.price_tc_n1 = $('#price_tc_n1').val();
|
||||
query.price_tc_n2 = $('#price_tc_n2').val();
|
||||
query.price_tc_n3 = $('#price_tc_n3').val();
|
||||
query.price_tc_n4 = $('#price_tc_n4').val();
|
||||
query.price_tc_n5 = $('#price_tc_n5').val();
|
||||
query.price_tc_n6 = $('#price_tc_n6').val();
|
||||
query.price_tc_n7 = $('#price_tc_n7').val();
|
||||
query.price_tc_n8 = $('#price_tc_n8').val();
|
||||
query.price_tc_n9 = $('#price_tc_n9').val();
|
||||
query.price_tc_nn = $('#price_tc_nn').val();
|
||||
query.price_tc_bz = $('#price_tc_bz').val();
|
||||
query.price_tc_ths = $('#price_tc_ths').val();
|
||||
query.price_tc_hjths = $('#price_tc_hjths').val();
|
||||
// query.agent_commission_tc = $('#agent_commission_tc').val();
|
||||
// query.agent_commission_tc_banker = $('#agent_commission_tc_banker').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.username.length == 0){
|
||||
layer.alert("请填写账号!");
|
||||
return false;
|
||||
}
|
||||
if(query.nickname.length == 0){
|
||||
layer.alert("请填写昵称!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length <= 0){
|
||||
layer.alert("请填写密码!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length > 0 && query.pass.length < 6){
|
||||
layer.alert("密码长度为6到16个字符!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv.length == 0){
|
||||
layer.alert("请填写百家乐码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_dt.length == 0){
|
||||
layer.alert("请填写龙虎码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_nn.length == 0){
|
||||
layer.alert("请填写牛牛码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_tc.length == 0){
|
||||
layer.alert("请填写三卡牛牛码率");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.cs) > 100){
|
||||
layer.alert("占股不能超过100%");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low) > parseFloat(query.limit_high)){
|
||||
layer.alert("最高限红必须大于最低限红");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low_tie <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high_tie <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low_tie) > parseFloat(query.limit_high_tie)){
|
||||
layer.alert("最高和限红必须大于最低和限红");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low_pair <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high_pair <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low_pair) > parseFloat(query.limit_high_pair)){
|
||||
layer.alert("最高对子限红必须大于最低对子限红");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_pair <= 0){
|
||||
layer.alert("押对子赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_luck_six_2 <= 0){
|
||||
layer.alert("两张牌幸运6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_luck_six_3 <= 0){
|
||||
layer.alert("三张牌幸运6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_big <= 0){
|
||||
layer.alert("押大赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_small <= 0){
|
||||
layer.alert("押小赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n0_n6 <= 0){
|
||||
layer.alert("押牛1-牛6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n1 <= 0){
|
||||
layer.alert("押牛一(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n2 <= 0){
|
||||
layer.alert("押牛二(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n3 <= 0){
|
||||
layer.alert("押牛三(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n4 <= 0){
|
||||
layer.alert("押牛四(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n5 <= 0){
|
||||
layer.alert("押牛五(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n6 <= 0){
|
||||
layer.alert("押牛六(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n7 <= 0){
|
||||
layer.alert("押牛七(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n8 <= 0){
|
||||
layer.alert("押牛八(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n9 <= 0){
|
||||
layer.alert("押牛九(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_nn <= 0){
|
||||
layer.alert("押牛牛(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_bz <= 0){
|
||||
layer.alert("押豹子(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_ths <= 0){
|
||||
layer.alert("押同花顺(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_hjths <= 0){
|
||||
layer.alert("押皇家同花顺(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
// if(query.agent_commission_tc.length <= 0){
|
||||
// layer.alert("三卡牛牛系统抽水不能为空");
|
||||
// return false;
|
||||
// }
|
||||
// if(query.agent_commission_tc_banker.length <= 0){
|
||||
// layer.alert("三卡牛牛庄家抽佣不能为空");
|
||||
// return false;
|
||||
// }
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/agent/do_agent_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/agent/index";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
804
application/admin/view/agent/agent-edit.html
Executable file
804
application/admin/view/agent/agent-edit.html
Executable file
@ -0,0 +1,804 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">代理列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">修改代理</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$agent.username}" maxlength="50" minlength="3" class="required" readonly>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value="{$agent.nickname}" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 密码默认为空不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 密码默认为空不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value="{$agent.mobile}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value="{$agent.email}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">总代性质:</label>
|
||||
<div class="controls">
|
||||
<input name="agent_type" class="required agent_type" type="radio" value="1" maxlength="20" style="color:#999;width:35px;" <?php if($agent['agent_type'] == 1) echo 'checked'; ?>>
|
||||
<span style="position:relative;top:-7px;">现金线</span>
|
||||
<input name="agent_type" class="required agent_type" type="radio" value="2" maxlength="20" style="color:#999;width:35px;" <?php if($agent['agent_type'] == 2) echo 'checked'; ?>>
|
||||
<span style="position:relative;top:-7px;">信用线</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">支付渠道:</label>
|
||||
<div class="controls">
|
||||
{foreach name="$pay_channel_list" item="vo"}
|
||||
<span>
|
||||
<input name="pay_channel" class="required pay_channel" type="radio" value="{$vo.key}" maxlength="20" style="color:#999;width:35px;" <?php if($agent['pay_channel'] == $vo['key']) echo 'checked'; ?>>
|
||||
<span style="position:relative;top:-7px;">{$vo.name}</span>
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">洗码方式:</label>
|
||||
<div class="controls">
|
||||
<input name="type_xima" class="required type_xima" type="radio" value="1" maxlength="20" style="color:#999;width:35px;" <?php if($agent['type_xima'] == 1) echo 'checked'; ?>>
|
||||
<span style="position:relative;top:-7px;">双边洗码</span>
|
||||
<input name="type_xima" class="required type_xima" type="radio" value="2" maxlength="20" style="color:#999;width:35px;" <?php if($agent['type_xima'] == 2) echo 'checked'; ?>>
|
||||
<span style="position:relative;top:-7px;">单边洗码</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">码量分担方式:</label>
|
||||
<div class="controls">
|
||||
<select id="share_xima" name="share_xima">
|
||||
<option value="1" <?php if($agent['share_xima'] == 1) echo 'selected="selected"' ?>>不分担</option>
|
||||
<option value="2" <?php if($agent['share_xima'] == 2) echo 'selected="selected"' ?>>按代理占成比例分担</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">返水率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="rebate_rate" name="rebate_rate" type="text" value="{$agent.rebate_rate}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 返水率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="{$agent.agent_ximalv}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="{$agent.agent_ximalv_dt}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">牛牛码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_nn" name="L_ximalv_nn" type="text" value="{$agent.agent_ximalv_nn}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三卡牛牛码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_tc" name="L_ximalv_tc" type="text" value="{$agent.agent_ximalv_tc}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 码率取0-100之间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占股(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value="{$agent.agent_cs}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 占股不能超过100%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" maxlength="10" class="required" value="{$agent.limit_low}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" maxlength="10" class="required" value="{$agent.limit_high}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low_tie" name="limit_low_tie" type="text" maxlength="10" class="required" value="{$agent.limit_low_tie}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high_tie" name="limit_high_tie" type="text" maxlength="10" class="required" value="{$agent.limit_high_tie}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低对子限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low_pair" name="limit_low_pair" type="text" maxlength="10" class="required" value="{$agent.limit_low_pair}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高对子限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high_pair" name="limit_high_pair" type="text" maxlength="10" class="required" value="{$agent.limit_high_pair}"><span class="help-inline">
|
||||
<font color="red"> * 必填项</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1" <?php if($agent['bet_type'] == 1) {echo 'selected';} ?>>网络投注</option>
|
||||
<option value="2" <?php if($agent['bet_type'] == 2) {echo 'selected';} ?>>电话投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="{$agent.price_banker}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="{$agent.price_player}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="{$agent.price_tie_baccarat}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="{$agent.price_pair}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">两张牌幸运6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_luck_six_2" name="price_luck_six_2" type="text" value="{$agent.price_luck_six_2}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三张牌幸运6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_luck_six_3" name="price_luck_six_3" type="text" value="{$agent.price_luck_six_3}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押大赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_big" name="price_big" type="text" value="{$agent.price_big}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押小赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_small" name="price_small" type="text" value="{$agent.price_small}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="{$agent.price_dragon}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="{$agent.price_tiger}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="{$agent.price_tie_dt}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押无牛-牛6赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n0_n6" name="price_n0_n6" type="text" value="{$agent.price_n0_n6}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="{$agent.price_n7_n9}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="{$agent.price_nn}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="{$agent.price_5n}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="{$agent.price_bomb}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛一赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n1" name="price_tc_n1" type="text" value="{$agent.price_tc_n1}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛二赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n2" name="price_tc_n2" type="text" value="{$agent.price_tc_n2}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛三赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n3" name="price_tc_n3" type="text" value="{$agent.price_tc_n3}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛四赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n4" name="price_tc_n4" type="text" value="{$agent.price_tc_n4}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛五赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n5" name="price_tc_n5" type="text" value="{$agent.price_tc_n5}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛六赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n6" name="price_tc_n6" type="text" value="{$agent.price_tc_n6}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛七赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n7" name="price_tc_n7" type="text" value="{$agent.price_tc_n7}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛八赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n8" name="price_tc_n8" type="text" value="{$agent.price_tc_n8}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛九赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_n9" name="price_tc_n9" type="text" value="{$agent.price_tc_n9}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_nn" name="price_tc_nn" type="text" value="{$agent.price_tc_nn}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押豹子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_bz" name="price_tc_bz" type="text" value="{$agent.price_tc_bz}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押同花顺赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_ths" name="price_tc_ths" type="text" value="{$agent.price_tc_ths}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押皇家同花顺赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tc_hjths" name="price_tc_hjths" type="text" value="{$agent.price_tc_hjths}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="control-group">
|
||||
<label class="control-label">三卡牛牛系统抽水:</label>
|
||||
<div class="controls">
|
||||
<input id="agent_commission_tc" name="agent_commission_tc" type="text" value="{$agent.agent_commission_tc}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">三卡牛牛庄家抽佣:</label>
|
||||
<div class="controls">
|
||||
<input id="agent_commission_tc_banker" name="agent_commission_tc_banker" type="text" value="{$agent.agent_commission_tc_banker}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 三卡牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="{$agent.win_limit}" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="agent-id" value="{$agent.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/agent/index';
|
||||
if(id == "2") location.href = '/agent/agent_edit';
|
||||
});
|
||||
|
||||
// 切换总代性质
|
||||
$('.agent_type').change(function(){
|
||||
var agentType = $('.agent_type:checked').val();
|
||||
if(agentType == 1){
|
||||
$('.rebate-box').show();
|
||||
}else{
|
||||
$('.rebate-box').hide();
|
||||
}
|
||||
});
|
||||
$('.agent_type').change();
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.agent_id = $('#agent-id').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.agent_type = $('.agent_type:checked').val();
|
||||
query.pay_channel = $('.pay_channel:checked').val();
|
||||
query.type_xima = $('.type_xima:checked').val();
|
||||
query.share_xima = $('#share_xima').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.ximalv_nn = $('#L_ximalv_nn').val();
|
||||
query.ximalv_tc = $('#L_ximalv_tc').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.limit_low_tie = $('#limit_low_tie').val();
|
||||
query.limit_high_tie = $('#limit_high_tie').val();
|
||||
query.limit_low_pair = $('#limit_low_pair').val();
|
||||
query.limit_high_pair = $('#limit_high_pair').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_luck_six_2 = $('#price_luck_six_2').val();
|
||||
query.price_luck_six_3 = $('#price_luck_six_3').val();
|
||||
query.price_big = $('#price_big').val();
|
||||
query.price_small = $('#price_small').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n0_n6 = $('#price_n0_n6').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
query.price_tc_n1 = $('#price_tc_n1').val();
|
||||
query.price_tc_n2 = $('#price_tc_n2').val();
|
||||
query.price_tc_n3 = $('#price_tc_n3').val();
|
||||
query.price_tc_n4 = $('#price_tc_n4').val();
|
||||
query.price_tc_n5 = $('#price_tc_n5').val();
|
||||
query.price_tc_n6 = $('#price_tc_n6').val();
|
||||
query.price_tc_n7 = $('#price_tc_n7').val();
|
||||
query.price_tc_n8 = $('#price_tc_n8').val();
|
||||
query.price_tc_n9 = $('#price_tc_n9').val();
|
||||
query.price_tc_nn = $('#price_tc_nn').val();
|
||||
query.price_tc_bz = $('#price_tc_bz').val();
|
||||
query.price_tc_ths = $('#price_tc_ths').val();
|
||||
query.price_tc_hjths = $('#price_tc_hjths').val();
|
||||
// query.agent_commission_tc = $('#agent_commission_tc').val();
|
||||
// query.agent_commission_tc_banker = $('#agent_commission_tc_banker').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.ximalv.length == 0){
|
||||
layer.msg("请填写百家乐码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_dt.length == 0){
|
||||
layer.msg("请填写龙虎码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_nn.length == 0){
|
||||
layer.msg("请填写牛牛码率");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_tc.length == 0){
|
||||
layer.msg("请填写三卡牛牛码率");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.cs) > 100){
|
||||
layer.msg("占股不能超过100%");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low) > parseFloat(query.limit_high)){
|
||||
layer.alert("最高限红必须大于最低限红");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low_tie <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high_tie <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low_tie) > parseFloat(query.limit_high_tie)){
|
||||
layer.alert("最高和限红必须大于最低和限红");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_low_pair <= 0){
|
||||
layer.alert("最低限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.limit_high_pair <= 0){
|
||||
layer.alert("最高限红必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.limit_low_pair) > parseFloat(query.limit_high_pair)){
|
||||
layer.alert("最高对子限红必须大于最低对子限红");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_pair <= 0){
|
||||
layer.alert("押对子赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_luck_six_2 <= 0){
|
||||
layer.alert("两张牌幸运6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_luck_six_3 <= 0){
|
||||
layer.alert("三张牌幸运6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_big <= 0){
|
||||
layer.alert("押大赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_small <= 0){
|
||||
layer.alert("押小赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n0_n6 <= 0){
|
||||
layer.alert("押无牛-牛6赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n1 <= 0){
|
||||
layer.alert("押牛一(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n2 <= 0){
|
||||
layer.alert("押牛二(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n3 <= 0){
|
||||
layer.alert("押牛三(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n4 <= 0){
|
||||
layer.alert("押牛四(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n5 <= 0){
|
||||
layer.alert("押牛五(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n6 <= 0){
|
||||
layer.alert("押牛六(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n7 <= 0){
|
||||
layer.alert("押牛七(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n8 <= 0){
|
||||
layer.alert("押牛八(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_n9 <= 0){
|
||||
layer.alert("押牛九(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_nn <= 0){
|
||||
layer.alert("押牛牛(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_bz <= 0){
|
||||
layer.alert("押豹子(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_ths <= 0){
|
||||
layer.alert("押同花顺(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tc_hjths <= 0){
|
||||
layer.alert("押皇家同花顺(三卡牛牛)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
// if(query.agent_commission_tc.length <= 0){
|
||||
// layer.alert("三卡牛牛系统抽水不能为空");
|
||||
// return false;
|
||||
// }
|
||||
// if(query.agent_commission_tc_banker.length <= 0){
|
||||
// layer.alert("三卡牛牛庄家不能为空");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/agent/do_agent_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/agent/index';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
180
application/admin/view/agent/agent_delete.html
Normal file
180
application/admin/view/agent/agent_delete.html
Normal file
@ -0,0 +1,180 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="javascript:;">首页</a>
|
||||
<a href="javascript:;">代理管理</a>
|
||||
<a><cite>已删除代理</cite></a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so" action="/agent/agent_delete" method="get">
|
||||
<input class="layui-input" placeholder="开始日" name="start" id="start" value="<?php if(isset($get['start'])) {echo $get['start'];} ?>">
|
||||
<input class="layui-input" placeholder="截止日" name="end" id="end" value="<?php if(isset($get['end'])) {echo $get['end'];} ?>">
|
||||
<input type="text" name="nickname" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['nickname'])) {echo $get['nickname'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<xblock>
|
||||
<button class="layui-btn layui-btn-danger" onclick="recoverAll()"><i class="layui-icon"></i>批量恢复</button>
|
||||
<!--<button class="layui-btn" onclick="x_admin_show('添加会员','/member/member_add',800,600)"><i-->
|
||||
<!--class="layui-icon"></i>添加-->
|
||||
<!--</button>-->
|
||||
<!--<span class="x-right" style="line-height:40px">共有数据:{$user_del_sum} 条</span>-->
|
||||
</xblock>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">
|
||||
</i></div>
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>账号</th>
|
||||
<th>用户名</th>
|
||||
<th>上级代理</th>
|
||||
<th>最近上分</th>
|
||||
<th>商户余额</th>
|
||||
<th>洗码率(%)</th>
|
||||
<th>占成(%)</th>
|
||||
<th>创建日期</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="user_del_list" item="vo"}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-unselect layui-form-checkbox delete-id" lay-skin="primary" user-id='{$vo.id}'><i class="layui-icon"></i></div>
|
||||
</td>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}({$vo.agent_parent_nickname})</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.agent_cs}</td>
|
||||
<td>{$vo.reg_time}</td>
|
||||
<td class="td-manage">
|
||||
<a onclick="agent_recover(this,'{$vo.id}')" href="javascript:;">
|
||||
恢复
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$user_del_list->render()}
|
||||
<!--<div class="page">-->
|
||||
<!--<div>-->
|
||||
<!--<a class="prev" href=""><<</a>-->
|
||||
<!--<a class="num" href="">1</a>-->
|
||||
<!--<span class="current">2</span>-->
|
||||
<!--<a class="num" href="">3</a>-->
|
||||
<!--<a class="num" href="">489</a>-->
|
||||
<!--<a class="next" href="">>></a>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
</div>
|
||||
<script>
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*用户-删除*/
|
||||
function agent_recover(obj, id) {
|
||||
layer.confirm('确认要恢复吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('恢复用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/agent/agent_recover',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* 删除多个会员 */
|
||||
function recoverAll() {
|
||||
layer.confirm('确认要恢复吗?', function () {
|
||||
var user_ids = new Array;
|
||||
$('.delete-id').each(function(){
|
||||
if($(this).hasClass('layui-form-checked')){
|
||||
user_ids.push($(this).attr('user-id'));
|
||||
}
|
||||
});
|
||||
|
||||
// 发送数据给后台进行删除
|
||||
var query = new Object;
|
||||
query.user_ids = JSON.stringify(user_ids);
|
||||
var result = ajax('/agent/agent_recover_more',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1,time:1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
50
application/admin/view/agent/agent_print.html
Normal file
50
application/admin/view/agent/agent_print.html
Normal file
@ -0,0 +1,50 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">代理列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">用户名</th>
|
||||
<th style="text-align: center;">联系人</th>
|
||||
<th style="text-align: center;">代理类型</th>
|
||||
<th style="text-align: center;">上级代理</th>
|
||||
<th style="text-align: center;">投注方式</th>
|
||||
<th style="text-align: center;">最近上分</th>
|
||||
<th style="text-align: center;">商户余额</th>
|
||||
<th style="text-align: center;">洗码率(%)</th>
|
||||
<th style="text-align: center;">占成(%)</th>
|
||||
<th style="text-align: center;">创建日期</th>
|
||||
<th style="text-align: center;">状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.agent_level_msg}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}({$vo.agent_parent_nickname})</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>{$vo.bet_type}</td>
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.agent_cs}</td>
|
||||
<td>{$vo.reg_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td>正常</td>
|
||||
{else}
|
||||
<td>锁定中</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
272
application/admin/view/agent/index.html
Executable file
272
application/admin/view/agent/index.html
Executable file
@ -0,0 +1,272 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:40%; border-left:none; text-align:right;}
|
||||
.alert-main td{border-right:none; }
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">代理列表</a>
|
||||
<?php if($user_info['role'] == 0) : ?>
|
||||
<a href="javascript:;" class="list-two" data-id="2">代理添加</a>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/agent/index" method="get">
|
||||
<?php if(isset($get['id']) && $get['id'] > 0) : ?>
|
||||
<?php else : ?>
|
||||
<input type="text" name="username" id="username" placeholder="请输入总代理的用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<?php endif; ?>
|
||||
<!--<span class="layui-btn" id="export">导出 excel</span>-->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>联系人</th>
|
||||
<th>上级代理</th>
|
||||
<th>投注方式</th>
|
||||
<th>最近上分</th>
|
||||
<th>商户余额</th>
|
||||
<th>百/龙/牛/三卡 码率(%)</th>
|
||||
<th>占成(%)</th>
|
||||
<th>日赢上限</th>
|
||||
<th>赔率</th>
|
||||
<th>创建日期</th>
|
||||
<th>操作</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td><a href="javascript:;" class="relation" onclick="x_admin_show('关系结构','/index/relation?id={$vo.id}',400,500)">{$vo.username}</a></td>
|
||||
<td>{$vo.nickname}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}</td>
|
||||
{else}
|
||||
<td>-</td>
|
||||
{/if}
|
||||
<td>{$vo.bet_type}</td>
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.ximalv}</td>
|
||||
<td>{$vo.agent_cs}</td>
|
||||
<td>{$vo.win_limit}</td>
|
||||
<th>
|
||||
<a href="javascript:;" onclick="showPrice(this)" price-username="{$vo.username}" price-banker="{$vo.price_banker}" price-player="{$vo.price_player}" price-tie-baccarat="{$vo.price_tie_baccarat}" price-pair="{$vo.price_pair}" price-dragon="{$vo.price_dragon}" price-tiger="{$vo.price_tiger}" price-tie-dt="{$vo.price_tie_dt}" price-n0-n6="{$vo.price_n0_n6}" price-n7-n9="{$vo.price_n7_n9}" price-nn="{$vo.price_nn}" price-5n="{$vo.price_5n}" price-bomb="{$vo.price_bomb}" price-tc-n1="{$vo.price_tc_n1}" price-tc-n2="{$vo.price_tc_n2}" price-tc-n3="{$vo.price_tc_n3}" price-tc-n4="{$vo.price_tc_n4}" price-tc-n5="{$vo.price_tc_n5}" price-tc-n6="{$vo.price_tc_n6}" price-tc-n7="{$vo.price_tc_n7}" price-tc-n8="{$vo.price_tc_n8}" price-tc-n9="{$vo.price_tc_n9}" price-tc-nn="{$vo.price_tc_nn}" price-tc-bz="{$vo.price_tc_bz}" price-tc-ths="{$vo.price_tc_ths}" price-tc-hjths="{$vo.price_tc_hjths}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" >查看</span>
|
||||
</a>
|
||||
</th>
|
||||
<td>{$vo.reg_time}</td>
|
||||
<td class="td-manage">
|
||||
<a href="/agent/agent_edit?agent_id={$vo.id}"><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span></a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;"><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span></a>
|
||||
</td>
|
||||
<td style="color: red;">
|
||||
<?php if($vo['agent'] == 1) : ?>
|
||||
<span ><a href="/agent/index?id={$vo.id}" style="color: #1E9FFF;">查看下级</a></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$agent_list->render()}
|
||||
</div>
|
||||
<div class="alert" id="alert_price">
|
||||
<div class="alert-title" id="show_price_username"></div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th>押庄赔率:</th><td id="show_price_banker"></td></tr>
|
||||
<tr><th>押闲赔率:</th><td id="show_price_player"></td></tr>
|
||||
<tr><th>押和赔率(百家乐):</th><td id="show_price_tie_baccarat"></td></tr>
|
||||
<tr><th>押对子赔率:</th><td id="show_price_pair"></td></tr>
|
||||
<tr><th>押龙赔率:</th><td id="show_price_dragon"></td></tr>
|
||||
<tr><th>押虎赔率:</th><td id="show_price_tiger"></td></tr>
|
||||
<tr><th>押和赔率(龙虎斗):</th><td id="show_price_tie_dt"></td></tr>
|
||||
<tr><th>押无牛-牛6赔率:</th><td id="show_price_n0_n6"></td></tr>
|
||||
<tr><th>押牛7-牛9赔率:</th><td id="show_price_n7_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率:</th><td id="show_price_nn"></td></tr>
|
||||
<tr><th>押五公赔率:</th><td id="show_price_5n"></td></tr>
|
||||
<tr><th>押四条赔率:</th><td id="show_price_bomb"></td></tr>
|
||||
<tr><th>押牛一赔率(三卡):</th><td id="show_price_tc_n1"></td></tr>
|
||||
<tr><th>押牛二赔率(三卡):</th><td id="show_price_tc_n2"></td></tr>
|
||||
<tr><th>押牛三赔率(三卡):</th><td id="show_price_tc_n3"></td></tr>
|
||||
<tr><th>押牛四赔率(三卡):</th><td id="show_price_tc_n4"></td></tr>
|
||||
<tr><th>押牛五赔率(三卡):</th><td id="show_price_tc_n5"></td></tr>
|
||||
<tr><th>押牛六赔率(三卡):</th><td id="show_price_tc_n6"></td></tr>
|
||||
<tr><th>押牛七赔率(三卡):</th><td id="show_price_tc_n7"></td></tr>
|
||||
<tr><th>押牛八赔率(三卡):</th><td id="show_price_tc_n8"></td></tr>
|
||||
<tr><th>押牛九赔率(三卡):</th><td id="show_price_tc_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率(三卡):</th><td id="show_price_tc_nn"></td></tr>
|
||||
<tr><th>押豹子赔率(三卡):</th><td id="show_price_tc_bz"></td></tr>
|
||||
<tr><th>押同花顺赔率(三卡):</th><td id="show_price_tc_ths"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hiddenForm('alert_price')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/agent/index';
|
||||
if(id == "2") location.href = '/agent/agent_add';
|
||||
});
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/agent/agent_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/agent/index?export=1&{$query}";
|
||||
layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
// 显示用户的赔率
|
||||
function showPrice(obj){
|
||||
// 获取赔率数据
|
||||
var price_username = $(obj).attr('price-username');
|
||||
var price_banker = $(obj).attr('price-banker');
|
||||
var price_player = $(obj).attr('price-player');
|
||||
var price_tie_baccarat = $(obj).attr('price-tie-baccarat');
|
||||
var price_pair = $(obj).attr('price-pair');
|
||||
var price_dragon = $(obj).attr('price-dragon');
|
||||
var price_tiger = $(obj).attr('price-tiger');
|
||||
var price_tie_dt = $(obj).attr('price-tie-dt');
|
||||
var price_n0_n6 = $(obj).attr('price-n0-n6');
|
||||
var price_n7_n9 = $(obj).attr('price-n7-n9');
|
||||
var price_nn = $(obj).attr('price-nn');
|
||||
var price_5n = $(obj).attr('price-5n');
|
||||
var price_bomb = $(obj).attr('price-bomb');
|
||||
var price_tc_n1 = $(obj).attr('price-tc-n1');
|
||||
var price_tc_n2 = $(obj).attr('price-tc-n2');
|
||||
var price_tc_n3 = $(obj).attr('price-tc-n3');
|
||||
var price_tc_n4 = $(obj).attr('price-tc-n4');
|
||||
var price_tc_n5 = $(obj).attr('price-tc-n5');
|
||||
var price_tc_n6 = $(obj).attr('price-tc-n6');
|
||||
var price_tc_n7 = $(obj).attr('price-tc-n7');
|
||||
var price_tc_n8 = $(obj).attr('price-tc-n8');
|
||||
var price_tc_n9 = $(obj).attr('price-tc-n9');
|
||||
var price_tc_nn = $(obj).attr('price-tc-nn');
|
||||
var price_tc_bz = $(obj).attr('price-tc-bz');
|
||||
var price_tc_ths = $(obj).attr('price-tc-ths');
|
||||
var price_tc_hjths = $(obj).attr('price-tc-hjths');
|
||||
|
||||
// 显示赔率数据
|
||||
$('#show_price_username').html(price_username+" 的赔率");
|
||||
$('#show_price_banker').html(price_banker);
|
||||
$('#show_price_player').html(price_player);
|
||||
$('#show_price_tie_baccarat').html(price_tie_baccarat);
|
||||
$('#show_price_pair').html(price_pair);
|
||||
$('#show_price_dragon').html(price_dragon);
|
||||
$('#show_price_tiger').html(price_tiger);
|
||||
$('#show_price_tie_dt').html(price_tie_dt);
|
||||
$('#show_price_n0_n6').html(price_n0_n6);
|
||||
$('#show_price_n7_n9').html(price_n7_n9);
|
||||
$('#show_price_nn').html(price_nn);
|
||||
$('#show_price_5n').html(price_5n);
|
||||
$('#show_price_bomb').html(price_bomb);
|
||||
$('#show_price_tc_n1').html(price_tc_n1);
|
||||
$('#show_price_tc_n2').html(price_tc_n2);
|
||||
$('#show_price_tc_n3').html(price_tc_n3);
|
||||
$('#show_price_tc_n4').html(price_tc_n4);
|
||||
$('#show_price_tc_n5').html(price_tc_n5);
|
||||
$('#show_price_tc_n6').html(price_tc_n6);
|
||||
$('#show_price_tc_n7').html(price_tc_n7);
|
||||
$('#show_price_tc_n8').html(price_tc_n8);
|
||||
$('#show_price_tc_n9').html(price_tc_n9);
|
||||
$('#show_price_tc_nn').html(price_tc_nn);
|
||||
$('#show_price_tc_bz').html(price_tc_bz);
|
||||
$('#show_price_tc_ths').html(price_tc_ths);
|
||||
$('#show_price_tc_hjths').html(price_tc_hjths);
|
||||
|
||||
$('#alert_price').show();
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#' + id).hide();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
174
application/admin/view/agent/profit.html
Executable file
174
application/admin/view/agent/profit.html
Executable file
@ -0,0 +1,174 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.layui-table td, .layui-table th {padding: 5px 4px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<div class="layui-form layui-col-md12 x-so float-left">
|
||||
<div class="layui-input-block" style="width: 300px;">
|
||||
<select name="zd_agent" id="zd_agent" lay-ignore style="height: 38px;line-height: 38px;font-size: 12px;padding: 0px 0px;">
|
||||
<option value="0" selected>请选择总代</option>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<option value={$vo.id} >{$vo.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="">
|
||||
<input class="layui-input" placeholder="截止时间" name="endDate" id="end" value="">
|
||||
|
||||
<div class="layui-btn" lay-submit="" lay-filter="sreach" onclick="get_profit()"><i class="layui-icon"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="layui-table" style="width: 90%;margin: 0 auto;margin-top: 15px;font-size: 14px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 40%">总上下水</td>
|
||||
<td style="width: 60%" id="bet_win_total">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>归属总代上下水</td>
|
||||
<td id="zs_bet_win_total">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总押</td>
|
||||
<td id="bet_amount">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>码量</td>
|
||||
<td id="maliang">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>玩家数量</td>
|
||||
<td id="bet_play_num">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>幸运玩家</td>
|
||||
<td id="lucky_palyer">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>悲催玩家</td>
|
||||
<td id="fucking_player">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>百家乐总赢</td>
|
||||
<td id="baccarat_win_towal">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>三卡总赢</td>
|
||||
<td id="tk_win_towal">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>牛牛总赢</td>
|
||||
<td id="nn_win_towal">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>龙虎总赢</td>
|
||||
<td id="dt_win_towal">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>总收益</td>
|
||||
<td id="total_profit">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 计算默认时间:今天07:00:00 ~ 明天06:59:59
|
||||
var now = new Date();
|
||||
var y = now.getFullYear();
|
||||
var m = ('0' + (now.getMonth() + 1)).slice(-2);
|
||||
var d = ('0' + now.getDate()).slice(-2);
|
||||
var tomorrow = new Date(now.getTime() + 86400000);
|
||||
var ty = tomorrow.getFullYear();
|
||||
var tm = ('0' + (tomorrow.getMonth() + 1)).slice(-2);
|
||||
var td = ('0' + tomorrow.getDate()).slice(-2);
|
||||
var defaultStart = y + '-' + m + '-' + d + ' 07:00:00';
|
||||
var defaultEnd = ty + '-' + tm + '-' + td + ' 06:59:59';
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime',
|
||||
value: defaultStart
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime',
|
||||
value: defaultEnd
|
||||
});
|
||||
});
|
||||
function get_profit(){
|
||||
var zd_agent = $('#zd_agent option:selected').val();
|
||||
var start_time = $('#start').val();
|
||||
var end_time = $('#end').val();
|
||||
if(zd_agent == 0){
|
||||
layer.msg('请选择总代');
|
||||
return false;
|
||||
}
|
||||
if(!start_time){
|
||||
layer.msg('请选择开始时间');
|
||||
return false;
|
||||
}
|
||||
if(!end_time){
|
||||
layer.msg('请选择结束时间');
|
||||
return false;
|
||||
}
|
||||
var index = layer.load(1, {
|
||||
shade: [0.3,'#000'] //0.1透明度的白色背景
|
||||
});
|
||||
$.ajax({
|
||||
url:'/agent/get_profit',
|
||||
data:{zd_agent:zd_agent,start_time:start_time,end_time:end_time},
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
success:function(data){
|
||||
layer.close(index);
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg);
|
||||
}else{
|
||||
var return_data = data.data;
|
||||
$('#bet_win_total').html(return_data.bet_win_total);
|
||||
$('#zs_bet_win_total').html(return_data.zs_bet_win_total);
|
||||
$('#maliang').html(return_data.maliang);
|
||||
$('#bet_amount').html(return_data.bet_amount);
|
||||
$('#bet_play_num').html(return_data.bet_play_num);
|
||||
$('#baccarat_win_towal').html(return_data.baccarat_win_towal);
|
||||
$('#dt_win_towal').html(return_data.dt_win_towal);
|
||||
$('#nn_win_towal').html(return_data.nn_win_towal);
|
||||
$('#tk_win_towal').html(return_data.tk_win_towal);
|
||||
$('#lucky_palyer').html(return_data.lucky_palyer);
|
||||
$('#fucking_player').html(return_data.fucking_player);
|
||||
$('#total_profit').html(return_data.total_profit);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
158
application/admin/view/agent/scores.html
Normal file
158
application/admin/view/agent/scores.html
Normal file
@ -0,0 +1,158 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">代理上下分记录列表</a>
|
||||
<?php if($user_info['role'] == 0 || $user_info['role'] == 3) : ?>
|
||||
<a href="javascript:;" class="list-two" data-id="2">代理上下分记录添加</a>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/agent/scores" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="截止时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="agent_or_admin" id="agent_or_admin">
|
||||
<option value="">全部上下分记录</option>
|
||||
<option value="1" <?php if(isset($get['agent_or_admin']) && $get['agent_or_admin'] == 1) {echo 'selected';} ?>>查询总台给总代理上下分记录</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-block" >
|
||||
<select name="mode" id="mode">
|
||||
<option value="-1" selected>操作类型</option>
|
||||
<option value="1" <?php if(isset($get['mode']) && $get['mode'] == 1) {echo 'selected';} ?>>上分</option>
|
||||
<option value="2" <?php if(isset($get['mode']) && $get['mode'] == 2) {echo 'selected';} ?>>下分</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出 excel</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>联系人</th>
|
||||
<th>操作类型</th>
|
||||
<th>操作金额</th>
|
||||
<th>操作人</th>
|
||||
<th>操作前余额</th>
|
||||
<th>余额</th>
|
||||
<th>创建日期</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="scoresList" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username_for}</td>
|
||||
<td>{$vo.nickname_for}</td>
|
||||
{if condition="$vo.mode == 1"}
|
||||
<td style="color:#ff5050;">{$vo.mode_msg}</td>
|
||||
<td style="color:#ff5050;">{$vo.amount}</td>
|
||||
{else}
|
||||
<td style="color:#009688;">{$vo.mode_msg}</td>
|
||||
<td style="color:#009688;">{$vo.amount}</td>
|
||||
{/if}
|
||||
<td>{$vo.controller_username}</td>
|
||||
<td>{$vo.old_money}</td>
|
||||
<td>{$vo.new_money}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>{$vo.agent_or_admin_msg}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$scoresList->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav span').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == 1) location.href = '/agent/scores';
|
||||
if(id == 2) location.href = '/agent/scores_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var agent_level = $('#agent_level').val();
|
||||
var mode = $('#mode').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/agent/scores?export=1&{$query}";
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
291
application/admin/view/agent/scores_add.html
Normal file
291
application/admin/view/agent/scores_add.html
Normal file
@ -0,0 +1,291 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
|
||||
#search-agent{ padding-left:16px;padding-top:5px; background:#fff; border-radius:5px;position:absolute; left:315px;top:0; margin-left:-3px;display:block;height:21px; color:black; border:1px solid #ececec; width: 25px;cursor:pointer; }
|
||||
#search-agent:hover{border-color:#ccc;}
|
||||
#search-agent i{margin-top:30px;}
|
||||
#search-agent:hover > i{ color:#148cf1; }
|
||||
#search-agent i{ margin-left:-4px; }
|
||||
#L_username{ background:#ececec; cursor:pointer; }
|
||||
#agent_list{ width:300px; height:400px; border:1px solid #a2a2a2; position:absolute; left:550px; top:44px; z-index:99; background:#fff; display:none; }
|
||||
#agent_list #header-box{ width:100%; height:40px; border-bottom:1px solid #ccc; position:relative; cursor:move; }
|
||||
#agent_list #header-box a{ position:absolute; top:3px; right:20px; font-size:22px; }
|
||||
#agent_list #header-box div{ height:30px; margin:10px 25px; line-height:30px; font-size:18px; font-weight:bold; color:#333; }
|
||||
#agent_list .main-box{ height:50px; margin-top:10px; background:#fff; }
|
||||
#agent_list .main-box label{ font-size:14px; margin-left:25px; margin-right:10px; }
|
||||
#agent_list .main-box input{ border-radius:5px; height:30px; width:110px; border:1px solid #ccc; padding-left:5px; }
|
||||
#agent_list .main-box input:focus{ border:1px solid #148cf1; }
|
||||
#agent_list .main-box button{ background:#fff; border:1px solid #ccc; width:60px; height:30px; border-radius:5px; cursor:pointer; margin-left:10px; }
|
||||
#agent_list .main-box button:hover{ border:1px solid #8a8a8a; }
|
||||
#agent_list .main-box .z-tree{ margin-top:20px; height:240px; }
|
||||
#agent_list .main-box .z-tree ul{ margin-left: 50px; }
|
||||
#agent_list .main-box .z-tree ul li{ list-style: none; position:relative; height:20px; padding-left:2px; cursor:default; }
|
||||
#agent_list .main-box .z-tree ul li:before{ position:absolute; top:-12px; left:-12px; content: ''; width: 10px; height: 20px; border-style: none none dotted dotted; border-width: 1px; border-color: #9e9e9e; }
|
||||
#agent_list .main-box .z-tree ul li.first:before{ border-style: none none dotted none; }
|
||||
#agent_list .main-box .z-tree ul li span.agent_name_box.on{ background:#eaeaea; border:1px solid #ccc; }
|
||||
#agent_list .button-box{ height:40px; background:#eee; position:relative; top:249px; line-height:40px; }
|
||||
#agent_list .button-box span{ position:absolute; right:10px; }
|
||||
#agent_list .button-box span button{ width:50px; height:25px; margin-left:2px; border-radius:5px; }
|
||||
#agent_list .button-box span button:hover{ background:#edefd1; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">代理上下分记录列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">代理上下分记录添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
<input id="L_username" name="L_username" type="text" readonly maxlength="50" minlength="3" class="required">
|
||||
<span id="search-agent"><i class="layui-icon"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作类型:</label>
|
||||
<div class="controls" style="padding-top: 5px;">
|
||||
<input class="scores" name="scores" value="1" type="radio" class="required" style="width:20px;height: 14px;font-size: 14px;">上分
|
||||
<input class="scores" name="scores" value="2" type="radio" class="required" style="width:20px;height: 14px;font-size: 14px;">下分
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作金额:</label>
|
||||
<div class="controls">
|
||||
<input id="L_amount" name="L_amount" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作用户:</label>
|
||||
<div class="controls">
|
||||
<input id="L_controller" name="L_controller" type="text" readonly value="{$user_info.admin}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">余额:</label>
|
||||
<div class="controls">
|
||||
<input id="L_money" name="L_money" type="text" readonly value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea name="desc" id="L_remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="agent_list">
|
||||
<div id="header-box">
|
||||
<div>选择总代理</div>
|
||||
<a class="cancel" href="javascript:;">X</a>
|
||||
</div>
|
||||
<div class="main-box">
|
||||
<div class="search-box">
|
||||
<label class="key-word">关键字 :</label>
|
||||
<input type="text" id="agent_name">
|
||||
<button id="search_key_word">搜索</button>
|
||||
</div>
|
||||
<div class="z-tree" id="z-tree">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="button-box">
|
||||
<span>
|
||||
<button class="ensure">确定</button>
|
||||
<button class="cancel">取消</button>
|
||||
</span>
|
||||
</div>
|
||||
<input type="hidden" id="short-username" value="">
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/agent/scores';
|
||||
if(id == "2") location.href = '/agent/scores_add';
|
||||
});
|
||||
|
||||
// 鼠标按下控件跟随移动
|
||||
function mouseMoveBox(pressId,boxId){
|
||||
var _move = false;//移动标记
|
||||
var _x,_y;//鼠标离控件左上角的相对位置
|
||||
$("#"+pressId).mousedown(function(e){
|
||||
// 按下鼠标计算与控件的相对位置
|
||||
_move = true;
|
||||
_x = e.pageX-parseInt($("#"+boxId).css("left"));
|
||||
_y = e.pageY-parseInt($("#"+boxId).css("top"));
|
||||
});
|
||||
$(document).mousemove(function(e){
|
||||
if(_move){
|
||||
//移动时根据鼠标位置计算控件左上角的绝对位置
|
||||
var x=e.pageX-_x;
|
||||
var y=e.pageY-_y;
|
||||
$("#"+boxId).css({top:y,left:x});//控件新位置
|
||||
}
|
||||
}).mouseup(function(){
|
||||
//松开鼠标后停止移动
|
||||
_move = false;
|
||||
});
|
||||
}
|
||||
// 代理列表跟随鼠标移动
|
||||
mouseMoveBox('header-box','agent_list');
|
||||
|
||||
|
||||
// 点击搜索所有的代理列表
|
||||
$('#search-agent').click(function(){
|
||||
var result = ajax('/agent/getAgent');
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
});
|
||||
$('#L_username').click(function(){
|
||||
var result = ajax('/agent/getAgent');
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
});
|
||||
|
||||
// 关键字搜索所有的代理列表
|
||||
$('#search_key_word').click(function(){
|
||||
var key_word = $('#agent_name').val();
|
||||
if(key_word){
|
||||
var query = new Object();
|
||||
query.username = key_word;
|
||||
var result = ajax('/agent/getAgent',query);
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
}
|
||||
});
|
||||
|
||||
// 选择代理名字
|
||||
$('#agent_list').on('click','.tree-li',function(){
|
||||
var username = $(this).find('span').eq(1).html();
|
||||
// 调整样式
|
||||
$('.agent_name_box').removeClass('on');
|
||||
$(this).find('.agent_name_box').addClass('on');
|
||||
// 动态数据
|
||||
$('#short-username').val(username);
|
||||
});
|
||||
// 双击触发选择代理
|
||||
$('#agent_list').on('dblclick','.tree-li',function(){
|
||||
$('.ensure').trigger('click');
|
||||
});
|
||||
|
||||
// 确定
|
||||
$('.ensure').click(function(){
|
||||
var username = $('#short-username').val();
|
||||
$('#L_username').val(username);
|
||||
$('#agent_list').hide();
|
||||
// 获取代理余额信息
|
||||
var username = $('#L_username').val();
|
||||
if(username){
|
||||
var result = ajax('/agent/getAgentMoney',{username:username});
|
||||
// 显示余额限制
|
||||
$('#L_money').val(result);
|
||||
}
|
||||
});
|
||||
|
||||
// 取消
|
||||
$('.cancel').click(function(){
|
||||
$('#agent_list').hide();
|
||||
});
|
||||
|
||||
// 选择上分还是下分
|
||||
$('.scores').click(function(){
|
||||
var id = $(this).val();
|
||||
if(id == 1) $('#L_remarks').html('总台上分 !');
|
||||
if(id == 2) $('#L_remarks').html('总台下分 !');
|
||||
})
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.username = $('#L_username').val();
|
||||
query.amount = $('#L_amount').val();
|
||||
query.mode = $('.scores:checked').val();
|
||||
query.controller = $('#L_controller').val();
|
||||
query.remarks = $('#L_remarks').val();
|
||||
var money = $('#L_money').val();
|
||||
|
||||
// 验证数据
|
||||
if(!query.username){
|
||||
layer.alert("请选择账号!");
|
||||
return false;
|
||||
}
|
||||
if(!query.mode){
|
||||
layer.alert("请选择操作类型!");
|
||||
return false;
|
||||
}
|
||||
if(!query.amount){
|
||||
layer.alert("请输入操作金额!");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.amount) <= 0){
|
||||
layer.alert("操作金额必须大于0!");
|
||||
return false;
|
||||
}
|
||||
if(query.mode == 2 && parseFloat(query.amount) > parseFloat(money)){
|
||||
layer.alert("操作金额不能大于余额!");
|
||||
return false;
|
||||
}
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/agent/do_scores_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/agent/scores";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
87
application/admin/view/agent/scores_add_show.html
Normal file
87
application/admin/view/agent/scores_add_show.html
Normal file
@ -0,0 +1,87 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .scores_add_show{border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative;border-left: 1px solid #e5e5e5;}
|
||||
.change_box .scores_add_show{color: #3daae9;}
|
||||
.change_box .scores_add_show:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.layui-input-block{ width:500px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px;padding-top: 5px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.pass_back{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="change_box">
|
||||
<a href="/agent/scores" class="scores_list">代理上下分记录列表</a>
|
||||
<a href="javascript:;" class="scores_add_show">代理上下分记录查看</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<form class="layui-form form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.username_for}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作类型:</label>
|
||||
{if condition="$recharge.mode == 1"}
|
||||
<div class="controls" style="position:relative;color:#ff5050;">
|
||||
{$recharge.mode_msg}
|
||||
</div>
|
||||
{else}
|
||||
<div class="controls" style="position:relative;color:#009688;">
|
||||
{$recharge.mode_msg}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作金额:</label>
|
||||
{if condition="$recharge.mode == 1"}
|
||||
<div class="controls" style="position:relative;color:#ff5050;">
|
||||
{$recharge.amount}
|
||||
</div>
|
||||
{else}
|
||||
<div class="controls" style="position:relative;color:#009688;">
|
||||
{$recharge.amount}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作用户:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.admin_user_name}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">余额:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.new_money}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.remake}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<a href="/agent/scores">
|
||||
<div class='pass_back'>返回</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="scores-id" value="{$recharge.id}">
|
||||
</body>
|
||||
|
||||
</html>
|
||||
11
application/admin/view/agent/scores_agent_list.html
Normal file
11
application/admin/view/agent/scores_agent_list.html
Normal file
@ -0,0 +1,11 @@
|
||||
<ul class="tree">
|
||||
{foreach name="$agent_list" item="vo" key="k"}
|
||||
<li class="<?php if($k == 0) echo 'first'; ?> tree-li" data-id="{$vo.id}">
|
||||
<span class="agent_name_box">
|
||||
<i class="iconfont" style="font-size:13px;"></i>
|
||||
<span>{$vo.username}</span>
|
||||
</span>
|
||||
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
43
application/admin/view/agent/scores_print.html
Normal file
43
application/admin/view/agent/scores_print.html
Normal file
@ -0,0 +1,43 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">代理上下分列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">账号</th>
|
||||
<th style="text-align: center;">联系人</th>
|
||||
<th style="text-align: center;">代理类型</th>
|
||||
<th style="text-align: center;">操作类型</th>
|
||||
<th style="text-align: center;">操作金额</th>
|
||||
<th style="text-align: center;">操作人</th>
|
||||
<th style="text-align: center;">余额</th>
|
||||
<th style="text-align: center;">创建日期</th>
|
||||
<th style="text-align: center;">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="scoresList" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username_for}</td>
|
||||
<td>{$vo.nickname_for}</td>
|
||||
<td>{$vo.user_agent_level_msg}</td>
|
||||
{if condition="$vo.mode == 1"}
|
||||
<td>{$vo.mode_msg}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
{else}
|
||||
<td>{$vo.mode_msg}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
{/if}
|
||||
<td>{$vo.admin_user_name}</td>
|
||||
<td>{$vo.new_money}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
277
application/admin/view/betinfo/record.html
Normal file
277
application/admin/view/betinfo/record.html
Normal file
@ -0,0 +1,277 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<meta name="full-screen" content="yes">
|
||||
<meta name="x5-fullscreen" content="true">
|
||||
<meta name="browsermode" content="application">
|
||||
<meta name="x5-page-mode" content="app">
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="x5-orientation" content="landscape">
|
||||
<meta name="screen-orientation" content="landscape">
|
||||
<title>下注记录</title>
|
||||
<link rel="stylesheet" type="text/css" href="/static/horizontal/css/common.css">
|
||||
|
||||
<style>
|
||||
body{moz-user-select: -moz-none; -moz-user-select: none; -o-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -ms-user-select:none; user-select:none; }
|
||||
.records{width:100%;}
|
||||
.records li{display:block; overflow: hidden;}
|
||||
.records .dataFinish{font-size:12px;text-align:center;color:#ccc;padding-top:5px;padding-bottom:45px;}
|
||||
.record .content ul .zj span{color:#e3e657;}
|
||||
.record .content ul span{box-sizing: border-box}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="record">
|
||||
<section class="main">
|
||||
<!--<div class="head">-->
|
||||
<!--<a href="/user/index?display=2" class="back"> </a>-->
|
||||
<!--<div class="title">下注记录</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="opt_query">
|
||||
<div id="fsub" class="">
|
||||
<span class="opt_date">开始日期
|
||||
<input name="startDate" type="text" id="startDate" value="{$get.startDate}" readonly />
|
||||
</span>
|
||||
<span class="opt_date">结束日期
|
||||
<input name="endDate" type="text" id="endDate" value="{$get.endDate}" readonly/>
|
||||
</span>
|
||||
<input class="opt_type searchDate" type="button" data-id = "1" value="昨天" />
|
||||
<input class="opt_type searchDate" type="button" data-id = "2" value="今天" />
|
||||
<input class="opt_type searchDate" type="button" data-id = "3" value="上月" />
|
||||
<input class="opt_type searchDate" type="button" data-id = "4" value="本月" />
|
||||
<select name="game_id" id="game_id">
|
||||
<option value="1" <?php if(isset($get['game_id']) && $get['game_id'] == 1) echo 'selected="selected"'; ?>>百家乐</option>
|
||||
<option value="2" <?php if(isset($get['game_id']) && $get['game_id'] == 2) echo 'selected="selected"'; ?>>龙虎</option>
|
||||
<option value="4" <?php if(isset($get['game_id']) && $get['game_id'] == 4) echo 'selected="selected"'; ?>>牛牛</option>
|
||||
</select>
|
||||
<input class="querys" type="submit" id="search" value="查询">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="con">
|
||||
<ul>
|
||||
<li class="header">
|
||||
<span class="sj">时间</span>
|
||||
<span class="jh">局号</span>
|
||||
<span class="bh">赌台编号</span>
|
||||
<span class="px">结果</span>
|
||||
<span class="tzlx">投注类型</span>
|
||||
<span class="tzje">投注金额</span>
|
||||
<span class="yxtz">预扣金额</span>
|
||||
<span class="pc">派彩</span>
|
||||
</li>
|
||||
<li class="records">
|
||||
<ul>
|
||||
{foreach name="$bet" item="vo"}
|
||||
<li>
|
||||
<span class="sj">{$vo.create_time}</span>
|
||||
<span class="jh">{$vo.game_nume}</span>
|
||||
<span class="bh">{$vo.table_name}</span>
|
||||
<span class="px">{$vo.card_result}</span>
|
||||
<span class="tzlx">{$vo.bet_type}</span>
|
||||
<span class="tzje">{$vo.bet_amount}</span>
|
||||
<span class="yxtz">{$vo.bet_amount_all}</span>
|
||||
<span class="pc">{$vo.win}</span>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<div class="dataFinish">数据加载完毕</div>
|
||||
</li>
|
||||
<li class="zj">
|
||||
<span class="sj"></span>
|
||||
<span class="jh"></span>
|
||||
<span class="bh"></span>
|
||||
<span class="px"></span>
|
||||
<span class="tzlx">总计</span>
|
||||
<span class="tzje" id="betAmount">{$betAmount}</span>
|
||||
<span class="yxtz" id="allAmount">{$allAmount}</span>
|
||||
<span class="pc" id="allWinTotal">{$allWinTotal}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="user_id" value="{$user_info.id}">
|
||||
</section>
|
||||
<script type="text/javascript" src="/static/horizontal/js/jquery-2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="/static/horizontal/js/common.js"></script>
|
||||
<script src="/static/horizontal/js/laydate/laydate.js"></script>
|
||||
<script>
|
||||
// 选择时间
|
||||
laydate.render({
|
||||
elem: '#startDate',
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endDate',
|
||||
});
|
||||
|
||||
// 快捷时间查询
|
||||
$('.searchDate').click(function(){
|
||||
// 快捷时间重组
|
||||
var id = $(this).attr('data-id');
|
||||
var result = getNeedTime(id);
|
||||
$('#startDate').val(result.startDate);
|
||||
$('#endDate').val(result.endDate);
|
||||
// 快捷查询
|
||||
$('#search').trigger('click');
|
||||
});
|
||||
|
||||
// 查询数据
|
||||
$('#search').click(function(){
|
||||
// 获取查询条件
|
||||
var startDate = $('#startDate').val();
|
||||
var endDate = $('#endDate').val();
|
||||
var game_id = $('#game_id').val();
|
||||
var user_id = $('#user_id').val();
|
||||
// 发送数据给后台
|
||||
$.ajax({
|
||||
url:'/betinfo/recordAjax',
|
||||
data:{startDate:startDate,endDate:endDate,game_id:game_id,user_id:user_id},
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
success:function(data){
|
||||
if(data.code == 1){
|
||||
// 重新赋值
|
||||
var bet = data.bet;
|
||||
var betAmount = data.betAmount;
|
||||
var allAmount = data.allAmount;
|
||||
var allWinTotal = data.allWinTotal;
|
||||
// 组装数据
|
||||
var str = '';
|
||||
for(var i=0; i<bet.length; i++){
|
||||
str += '<li>';
|
||||
str += '<span class="sj">'+bet[i]["create_time"]+'</span>';
|
||||
str += '<span class="jh">'+bet[i]["game_nume"]+'</span>';
|
||||
str += '<span class="bh">'+bet[i]["table_name"]+'</span>';
|
||||
str += '<span class="px">'+bet[i]["card_result"]+'</span>';
|
||||
str += '<span class="tzlx">'+bet[i]["bet_type"]+'</span>';
|
||||
str += '<span class="tzje">'+bet[i]["bet_amount"]+'</span>';
|
||||
str += '<span class="yxtz">'+bet[i]["bet_amount_all"]+'</span>';
|
||||
str += '<span class="pc">'+bet[i]["win"]+'</span>';
|
||||
str += '</li>';
|
||||
}
|
||||
// 显示数据
|
||||
$('.records').find('ul').empty().append(str);
|
||||
$('#betAmount').html(betAmount);
|
||||
$('#allAmount').html(allAmount);
|
||||
$('#allWinTotal').html(allWinTotal);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 自定义时间函数
|
||||
function getNeedTime(type,format){
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var query = new Object();
|
||||
var startYear;
|
||||
var endYear;
|
||||
var startMonth;
|
||||
var endMonth;
|
||||
var startDay;
|
||||
var endDay;
|
||||
var startDate;
|
||||
var endDate;
|
||||
|
||||
switch(parseInt(type)){
|
||||
// 昨天
|
||||
case 1:
|
||||
startYear = year;
|
||||
endYear = year;
|
||||
startMonth = plusZero(now.getMonth() + 1);
|
||||
endMonth = plusZero(now.getMonth() + 1);
|
||||
startDay = plusZero(now.getDate() - 1);
|
||||
endDay = plusZero(now.getDate() - 1);
|
||||
break;
|
||||
// 今天
|
||||
case 2:
|
||||
startYear = year;
|
||||
endYear = year;
|
||||
startMonth = plusZero(now.getMonth() + 1);
|
||||
endMonth = plusZero(now.getMonth() + 1);
|
||||
startDay = plusZero(now.getDate());
|
||||
endDay = plusZero(now.getDate());
|
||||
break;
|
||||
// 上月
|
||||
case 3:
|
||||
if(now.getMonth() + 1 == 1){
|
||||
startYear = year - 1;
|
||||
endYear = year - 1;
|
||||
startMonth = 12;
|
||||
endMonth = 12;
|
||||
}else{
|
||||
startYear = year;
|
||||
endYear = year;
|
||||
startMonth = plusZero(now.getMonth());
|
||||
endMonth = plusZero(now.getMonth());
|
||||
}
|
||||
startDay = '01';
|
||||
endDay = plusZero(new Date(year,endMonth,0).getDate());
|
||||
break;
|
||||
// 本月
|
||||
case 4:
|
||||
startYear = year;
|
||||
endYear = year;
|
||||
startMonth = plusZero(now.getMonth() + 1);
|
||||
endMonth = plusZero(now.getMonth() + 1);
|
||||
startDay = '01';
|
||||
endDay = plusZero(new Date().getDate());
|
||||
break;
|
||||
// 全部
|
||||
case 5:
|
||||
startYear = '2018';
|
||||
endYear = year;
|
||||
startMonth = '01';
|
||||
endMonth = plusZero(now.getMonth() + 1);
|
||||
startDay = '01';
|
||||
endDay = plusZero(new Date().getDate());
|
||||
break;
|
||||
}
|
||||
if(format == 1){
|
||||
startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00';
|
||||
endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59';
|
||||
}else{
|
||||
startDate = startYear + '-' + startMonth + '-' + startDay;
|
||||
endDate = endYear + '-' + endMonth + '-' + endDay;
|
||||
}
|
||||
|
||||
query.startDate = startDate;
|
||||
query.endDate = endDate;
|
||||
return query;
|
||||
}
|
||||
|
||||
// 月和日 前加0;
|
||||
function plusZero(str){
|
||||
if(str != undefined){
|
||||
if(str >= 1 && str <= 9){
|
||||
str = "0" + str.toString();
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.page-landscape {width: 100%; height: 100%; background: #333; position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 9999999; display: none; text-align: center; }
|
||||
.page-landscape-box {position: relative; margin-left: auto; margin-right: auto; top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); }
|
||||
.page-landscape img {-webkit-animation: page-landscapeAni 1.2s ease infinite alternate; animation: page-landscapeAni 1.2s ease infinite alternate; }
|
||||
.page-landscape span {font-size: 16px; display: block; color: #FFFFFF; text-align: center; width: 100%; padding-top: 40px; line-height: 2; }
|
||||
@keyframes page-landscapeAni{0% {transform: rotate(90deg); } 30% {transform: rotate(90deg); } 70% {transform: rotate(0deg); } 100% {transform: rotate(0deg); } }
|
||||
@-webkit-keyframes page-landscapeAni{0% {-webkit-transform: rotate(90deg); } 30% {-webkit-transform: rotate(90deg); } 70% {-webkit-transform: rotate(0deg); } 100% {-webkit-transform: rotate(0deg); } }
|
||||
@-o-keyframes page-landscapeAni{0% {-o-transform: rotate(90deg); } 30% {-o-transform: rotate(90deg); } 70% {-o-transform: rotate(0deg); } 100% {-o-transform: rotate(0deg); } }
|
||||
@-ms-keyframes page-landscapeAni{0% {-ms-transform: rotate(90deg); } 30% {-ms-transform: rotate(90deg); } 70% {-ms-transform: rotate(0deg); } 100% {-ms-transform: rotate(0deg); } }
|
||||
</style>
|
||||
<div class="page-landscape" id="page-landscape" style="display: none;">
|
||||
<div class="page-landscape-box">
|
||||
<img src="/static/horizontal/img/sideways.png" id="page-landscape-pic" style="display:inline-block;" width="114" height="60">
|
||||
<span>为了更好的体验,请使用横屏浏览</span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
89
application/admin/view/chat/detail.html
Executable file
89
application/admin/view/chat/detail.html
Executable file
@ -0,0 +1,89 @@
|
||||
{include file="public/header" /}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">会话信息</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-table" lay-skin="nob">
|
||||
<tr>
|
||||
<td width="120"><strong>会话ID:</strong></td>
|
||||
<td>{$session.id}</td>
|
||||
<td width="120"><strong>用户名:</strong></td>
|
||||
<td>{$session.username}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>用户余额:</strong></td>
|
||||
<td>{$session.money}</td>
|
||||
<td><strong>客服:</strong></td>
|
||||
<td>{$session.admin_username|default='未分配'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>来源:</strong></td>
|
||||
<td>
|
||||
{switch name="session.source"}
|
||||
{case value="1"}PC{/case}
|
||||
{case value="2"}Game{/case}
|
||||
{case value="3"}Portal{/case}
|
||||
{/switch}
|
||||
</td>
|
||||
<td><strong>状态:</strong></td>
|
||||
<td>
|
||||
{switch name="session.status"}
|
||||
{case value="0"}待分配{/case}
|
||||
{case value="1"}进行中{/case}
|
||||
{case value="2"}已结束{/case}
|
||||
{/switch}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>开始时间:</strong></td>
|
||||
<td>{$session.create_time|date='Y-m-d H:i:s',###}</td>
|
||||
<td><strong>结束时间:</strong></td>
|
||||
<td>{if condition="$session.end_time"}{$session.end_time|date='Y-m-d H:i:s',###}{else/}-{/if}</td>
|
||||
</tr>
|
||||
{if condition="$session.rating"}
|
||||
<tr>
|
||||
<td><strong>评分:</strong></td>
|
||||
<td colspan="3">
|
||||
<span style="color: #FFB800;">{$session.rating}星</span>
|
||||
{if condition="$session.rating_content"}
|
||||
<br><span style="color: #666;">{$session.rating_content}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card" style="margin-top: 20px;">
|
||||
<div class="layui-card-header">聊天记录</div>
|
||||
<div class="layui-card-body" style="height: 400px; overflow-y: auto; background: #f8f8f8;">
|
||||
{volist name="messages" id="msg"}
|
||||
<div style="margin-bottom: 15px; {eq name='msg.sender_type' value='2'}text-align: right;{/eq}">
|
||||
<div style="display: inline-block; max-width: 60%; text-align: left;">
|
||||
<div style="font-size: 12px; color: #999; margin-bottom: 3px;">
|
||||
{eq name="msg.sender_type" value="1"}
|
||||
用户
|
||||
{else/}
|
||||
客服
|
||||
{/eq}
|
||||
· {$msg.create_time|date='Y-m-d H:i:s',###}
|
||||
</div>
|
||||
<div style="padding: 10px; background: {eq name='msg.sender_type' value='1'}#fff{else/}#1E9FFF{/eq};
|
||||
color: {eq name='msg.sender_type' value='1'}#333{else/}#fff{/eq};
|
||||
border-radius: 5px; word-break: break-all;">
|
||||
{eq name="msg.msg_type" value="2"}
|
||||
<img src="{$msg.content}" style="max-width: 300px;">
|
||||
{else/}
|
||||
{$msg.content}
|
||||
{/eq}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
1190
application/admin/view/chat/index.html
Executable file
1190
application/admin/view/chat/index.html
Executable file
File diff suppressed because it is too large
Load Diff
117
application/admin/view/chat/record.html
Executable file
117
application/admin/view/chat/record.html
Executable file
@ -0,0 +1,117 @@
|
||||
{include file="public/header" /}
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="">首页</a>
|
||||
<a><cite>聊天记录查询</cite></a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so" method="get">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="username" value="{$get.username|default=''}"
|
||||
placeholder="用户名" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<select name="admin_id">
|
||||
<option value="">全部客服</option>
|
||||
{volist name="admins" id="admin"}
|
||||
<option value="{$admin.id}" {if condition="isset($get['admin_id']) && $get['admin_id'] == $admin['id']"}selected{/if}>
|
||||
{$admin.nickname|default=$admin.username}
|
||||
</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="startDate" id="startDate" value="{$get.startDate|default=''}"
|
||||
placeholder="开始日期" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="endDate" id="endDate" value="{$get.endDate|default=''}"
|
||||
placeholder="结束日期" class="layui-input">
|
||||
</div>
|
||||
<button class="layui-btn" type="submit"><i class="layui-icon"></i></button>
|
||||
<button class="layui-btn layui-btn-warm" type="submit" name="export" value="1">
|
||||
<i class="layui-icon"></i>导出
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>会话ID</th>
|
||||
<th>用户名</th>
|
||||
<th>客服</th>
|
||||
<th>来源</th>
|
||||
<th>状态</th>
|
||||
<th>评分</th>
|
||||
<th>开始时间</th>
|
||||
<th>结束时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="list" id="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.admin_username|default='未分配'}</td>
|
||||
<td>
|
||||
{switch name="vo.source"}
|
||||
{case value="1"}PC{/case}
|
||||
{case value="2"}Game{/case}
|
||||
{case value="3"}Portal{/case}
|
||||
{/switch}
|
||||
</td>
|
||||
<td>
|
||||
{switch name="vo.status"}
|
||||
{case value="0"}<span class="layui-badge layui-bg-gray">待分配</span>{/case}
|
||||
{case value="1"}<span class="layui-badge layui-bg-blue">进行中</span>{/case}
|
||||
{case value="2"}<span class="layui-badge">已结束</span>{/case}
|
||||
{/switch}
|
||||
</td>
|
||||
<td>
|
||||
{if condition="$vo.rating"}
|
||||
<span style="color: #FFB800;">{$vo.rating}星</span>
|
||||
{else/}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
|
||||
<td>{if condition="$vo.end_time"}{$vo.end_time|date='Y-m-d H:i:s',###}{else/}-{/if}</td>
|
||||
<td class="td-manage">
|
||||
<a title="查看详情" onclick="x_admin_show('会话详情','/chat/detail?session_id={$vo.id}',900,600)" href="javascript:;">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">
|
||||
{$list->render()}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['laydate', 'form'], function(){
|
||||
var laydate = layui.laydate;
|
||||
var form = layui.form;
|
||||
|
||||
laydate.render({
|
||||
elem: '#startDate',
|
||||
type: 'date'
|
||||
});
|
||||
|
||||
laydate.render({
|
||||
elem: '#endDate',
|
||||
type: 'date'
|
||||
});
|
||||
|
||||
form.render();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
70
application/admin/view/chat_quick_reply/add.html
Executable file
70
application/admin/view/chat_quick_reply/add.html
Executable file
@ -0,0 +1,70 @@
|
||||
{include file="public/header" /}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<form class="layui-form" method="post">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分类</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="category" value="{$info.category|default=''}"
|
||||
placeholder="可选,如:常见问题、充值相关等" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="title" required lay-verify="required"
|
||||
value="{$info.title|default=''}" placeholder="请输入标题" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label"><span class="x-red">*</span>内容</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="content" required lay-verify="required"
|
||||
placeholder="请输入回复内容" class="layui-textarea">{$info.content|default=''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">排序</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="sort" value="{$info.sort|default='0'}"
|
||||
placeholder="数字越小越靠前" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="status" value="1" title="启用"
|
||||
{if condition="!isset($info['status']) || $info['status'] == 1"}checked{/if}>
|
||||
<input type="radio" name="status" value="0" title="禁用"
|
||||
{if condition="isset($info['status']) && $info['status'] == 0"}checked{/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<button class="layui-btn" lay-submit lay-filter="add">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layer'], function(){
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
|
||||
form.on('submit(add)', function(data){
|
||||
$.post('', data.field, function(res){
|
||||
if(res.code == 0 || res.code == 1){
|
||||
layer.alert(res.msg || '操作成功', {icon: 1}, function(){
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
parent.location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.alert(res.msg, {icon: 2});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
134
application/admin/view/chat_quick_reply/index.html
Executable file
134
application/admin/view/chat_quick_reply/index.html
Executable file
@ -0,0 +1,134 @@
|
||||
{include file="public/header" /}
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="">首页</a>
|
||||
<a><cite>快捷回复管理</cite></a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so" method="get">
|
||||
<div class="layui-input-inline">
|
||||
<select name="category">
|
||||
<option value="">全部分类</option>
|
||||
{volist name="categories" id="cat"}
|
||||
<option value="{$cat}" {if condition="isset($get['category']) && $get['category'] == $cat"}selected{/if}>{$cat}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<select name="status">
|
||||
<option value="">全部状态</option>
|
||||
<option value="1" {if condition="isset($get['status']) && $get['status'] == '1'"}selected{/if}>启用</option>
|
||||
<option value="0" {if condition="isset($get['status']) && $get['status'] == '0'"}selected{/if}>禁用</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="layui-btn" type="submit"><i class="layui-icon"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<xblock>
|
||||
<button class="layui-btn" onclick="x_admin_show('添加快捷回复','/chat_quick_reply/add',600,400)">
|
||||
<i class="layui-icon"></i>添加
|
||||
</button>
|
||||
</xblock>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>分类</th>
|
||||
<th>标题</th>
|
||||
<th>内容</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="list" id="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.category|default='无'}</td>
|
||||
<td>{$vo.title}</td>
|
||||
<td style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="{$vo.content}">{$vo.content}</td>
|
||||
<td>
|
||||
<input type="text" class="layui-input" value="{$vo.sort}"
|
||||
onchange="updateSort({$vo.id}, this.value)"
|
||||
style="width: 60px; display: inline-block;">
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="status" lay-skin="switch" lay-text="启用|禁用"
|
||||
{eq name="vo.status" value="1"}checked{/eq}
|
||||
onchange="updateStatus({$vo.id}, this.checked ? 1 : 0)">
|
||||
</td>
|
||||
<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
|
||||
<td class="td-manage">
|
||||
<a title="编辑" onclick="x_admin_show('编辑','/chat_quick_reply/edit?id={$vo.id}',600,400)" href="javascript:;">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
<a title="删除" onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<i class="layui-icon"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">
|
||||
{$list->render()}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['form', 'layer'], function(){
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
|
||||
form.render();
|
||||
});
|
||||
|
||||
// 删除
|
||||
function member_del(obj, id){
|
||||
layer.confirm('确认要删除吗?', function(index){
|
||||
$.ajax({
|
||||
url: '/chat_quick_reply/del',
|
||||
type: 'POST',
|
||||
data: {id: id},
|
||||
success: function(res){
|
||||
if(res.code == 0){
|
||||
$(obj).parents("tr").remove();
|
||||
layer.msg('删除成功', {icon: 1, time: 1000});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 更新状态
|
||||
function updateStatus(id, status){
|
||||
$.post('/chat_quick_reply/status', {id: id, status: status}, function(res){
|
||||
if(res.code == 0){
|
||||
layer.msg('操作成功', {icon: 1, time: 1000});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 更新排序
|
||||
function updateSort(id, sort){
|
||||
$.post('/chat_quick_reply/sort', {id: id, sort: sort}, function(res){
|
||||
if(res.code == 0){
|
||||
layer.msg('操作成功', {icon: 1, time: 1000});
|
||||
} else {
|
||||
layer.msg(res.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
125
application/admin/view/cs/cs_check.html
Normal file
125
application/admin/view/cs/cs_check.html
Normal file
@ -0,0 +1,125 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">结算记录</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/cs/cs_check" method="get">
|
||||
<input class="layui-input" placeholder="开始日" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="截止日" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="admin_or_agent" id="admin_or_agent">
|
||||
<option value="">全部结算记录</option>
|
||||
<option value="1" <?php if(isset($get['admin_or_agent']) && $get['admin_or_agent'] == 1) {echo 'selected';} ?>>查询总台操作结算记录</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出 excel</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>占成(%)</th>
|
||||
<th>占股结算金额</th>
|
||||
<th>操作人</th>
|
||||
<th>结算时间</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="cs_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.agent_cs}</td>
|
||||
<td>{$vo.share_amount}</td>
|
||||
<td>{$vo.connection_username}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>{$vo.admin_or_agent_msg}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$cs_list->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/cs/cs_check?export=1&{$query}";
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
177
application/admin/view/cs/index.html
Normal file
177
application/admin/view/cs/index.html
Normal file
@ -0,0 +1,177 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ /*margin-top:15px; margin-bottom:-5px;*/ padding: 10px 0; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:30%; left:30%; width:600px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#F2F2F2; height:40px; padding-left:30px; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;}
|
||||
.alert-main th{width:40%;}
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">占股管理</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/cs/index" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>联系人</th>
|
||||
<th>上级代理</th>
|
||||
<th>商户余额</th>
|
||||
<th>占股比例(%)</th>
|
||||
<th>占股数目</th>
|
||||
<th>已结占股数目</th>
|
||||
<th>未结占股数目</th>
|
||||
<th>上一次结算时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}({$vo.agent_parent_nickname})</td>
|
||||
{else}
|
||||
<td>-</td>
|
||||
{/if}
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_cs} %</td>
|
||||
<td>{$vo.total_share_amount}</td>
|
||||
<td>{$vo.checkout_share_amount}</td>
|
||||
<td>{$vo.no_checkout_share_amount}</td>
|
||||
<td>{$vo.last_cs_time}</td>
|
||||
<td class="td-manage">
|
||||
<a href="javascript:void(0);">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;" href="javascript:void(0)" data-userid="{$vo.id}"
|
||||
data-username="{$vo.username}" data-nickname="{$vo.nickname}" data-total_share_amount="{$vo.total_share_amount}"
|
||||
data-agent_cs="{$vo.agent_cs}%" data-checkout_share_amount="{$vo.checkout_share_amount}"
|
||||
data-no_checkout_share_amount="{$vo.no_checkout_share_amount}"
|
||||
data-lastCheckOutTime="{$vo.last_cs_time}"
|
||||
onclick="showXima(this,'alert_xima')">结算占股</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$agent_list->render()}
|
||||
</div>
|
||||
<div class="alert" id="alert_xima">
|
||||
<div class="alert-title">洗码</div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th style="border-left:none; text-align:right;">账号:</th><td style="border-right:none;" id="cs_username"></td></tr>
|
||||
<tr><th style="border-left:none; text-align:right;">用户名:</th><td style="border-right:none;" id="cs_nickname"></td></tr>
|
||||
<tr><th style="border-left:none; text-align:right;">未结占股:</th><td style="border-right:none;" id="cs_nocheckout_maliang"></td></tr>
|
||||
<tr><th style="border-left:none; text-align:right;">上一次结算时间:</th><td style="border-right:none;" id="cs_last_checkout_time"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<input type="hidden" id="xm_user_id" value="" />
|
||||
<span class="input_button" onclick="postXima()" style="background:#009688; color:#fff;">确定结算</span>
|
||||
<span class="input_button" style="margin-left: 20%; background:#f2f2f2; border:1px solid #e2e2e2;" onclick="hiddenForm('alert_xima')">取消结算</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
//弹出洗码窗口
|
||||
function showXima(obj, id) {
|
||||
$('#' + id).show();
|
||||
$('#xm_user_id').val($(obj).attr("data-userid"));
|
||||
$('#cs_username').html($(obj).attr("data-username"));
|
||||
$('#cs_nickname').html($(obj).attr("data-nickname"));
|
||||
$('#cs_nocheckout_maliang').html($(obj).attr("data-no_checkout_share_amount"));
|
||||
$('#cs_last_checkout_time').html($(obj).attr("data-lastCheckOutTime"));
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#' + id).hide();
|
||||
}
|
||||
//处理洗码
|
||||
function postXima() {
|
||||
layer.confirm('是否对该账号进行占股结算?', {
|
||||
btn: ['是','否'] //按钮
|
||||
}, function(){
|
||||
var query = new Object();
|
||||
if ($('#xm_user_id').val() > 0) {
|
||||
query.user_id = $('#xm_user_id').val();
|
||||
} else {
|
||||
layer.alert('结算出错');
|
||||
return false;
|
||||
}
|
||||
if (parseFloat($('#cs_nocheckout_maliang').html()) > 0 || parseFloat($('#cs_nocheckout_maliang').html()) < 0) {
|
||||
query.total = parseFloat($('#cs_nocheckout_maliang').html());
|
||||
} else {
|
||||
layer.alert('占股结算数目不能等于0');
|
||||
return false;
|
||||
}
|
||||
var url = '/cs/do_cs';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
success: function (data) {
|
||||
if (data.errorCode === 0) {
|
||||
layer.alert('结算成功',function(){
|
||||
window.location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.alert(data.errorMessage);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
571
application/admin/view/game/add_table.html
Normal file
571
application/admin/view/game/add_table.html
Normal file
@ -0,0 +1,571 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css"> textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; } .change_box a{font-size: 14px;padding: 10.5px 10px;} .change_box .table_add{border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative;border-left: 1px solid #e5e5e5;} .change_box .table_list{color: #3daae9;} .change_box .table_add:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; } .x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; } .control-group{overflow: hidden; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dotted #dddddd; } .control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; } .controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; } .controls input{width: 700px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; } .controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; } .bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; } .add_submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; } .layui-input-block{display:inline-block; width:200px; margin-left:0;min-height: 26px;} select{height: 26px;} .right_word{font-size: 14px;padding-top: 3px;}.is_check{font-size: 14px;} .is_check input{width: 20px;height: 14px;font-size: 14px;}</style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="/game/index" class="table_list">吧台列表</a>
|
||||
<a href="javascript:;" class="table_add">吧台添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from" class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌台号:</label>
|
||||
<div class="controls">
|
||||
<input id="table_num" name="table_name" type="text" style="width:80px;" class="required" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*只能填大于0的数字</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌台名称:</label>
|
||||
<div class="controls">
|
||||
<input id="table_name" name="table_name" type="text" style="width:192px;" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">游戏名称:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="game_id" id="game_id">
|
||||
<option value="" selected>--请选择游戏名称--</option>
|
||||
<option value="1">百家乐</option>
|
||||
<option value="2">龙虎斗</option>
|
||||
<option value="4">牛牛</option>
|
||||
<option value="5">三卡牛牛</option>
|
||||
<option value="6">色碟</option>
|
||||
<option value="7">骰宝</option>
|
||||
<!--
|
||||
<option value="8">轮盘</option>
|
||||
-->
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="is_mode" style="display: none;">
|
||||
<label class="control-label">游戏模式:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="mode" id="mode">
|
||||
<option value="" selected>--请选择游戏模式--</option>
|
||||
<option value="1">抽佣模式</option>
|
||||
<option value="2">免佣模式</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="bet_type" id="bet_type">
|
||||
<option value="0">--请选择投注方式--</option>
|
||||
<option value="1">网络投注</option>
|
||||
<option value="2">电话投注</option>
|
||||
<!--
|
||||
<option value="3">所有投注</option>
|
||||
-->
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">座位数:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="seat_num" id="seat_num">
|
||||
<option value="0">--请选择座位数--</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="3">4</option>
|
||||
<option value="3">5</option>
|
||||
<option value="3">6</option>
|
||||
<option value="3">7</option>
|
||||
<option value="3">8</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">本地识别设备IP:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_rtmp" name="media_near_rtmp" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">本地荷官端视频[flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_rtmp" name="media_far_rtmp" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">高清[live/hd.flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_flv" name="media_far_flv" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">标清[live/sd.flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_ws" name="media_far_ws" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">线路一:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_flv" name="media_near_flv" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">线路二:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_ws" name="media_near_ws" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空[如无,可填入线路一]</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="control-group" style="display: none;">
|
||||
<label class="control-label">近景视频地址_RTMP[已废]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_rtmp" name="media_near_rtmp" type="text" value='' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">网络-庄闲限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_bankerplayer" name="min_bankerplayer" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_bankerplayer" name="max_bankerplayer" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="w_tie" style="display: block">
|
||||
<label class="control-label" >网络-和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_tie" name="min_tie" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_tie" name="max_tie" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="w_pair" style="display: block">
|
||||
<label class="control-label" >网络-对限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_pair" name="min_pair" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_pair" name="max_pair" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子单口最大庄闲限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_total" name="limit_money_total" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*0为不设上限</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="total_tie" style="display: block">
|
||||
<label class="control-label" >桌子单口最大和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_tie_total" name="limit_money_tie_total" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*0为不设上限</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="total_pair" style="display: block">
|
||||
<label class="control-label" >桌子单口最大对限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_pair_total" name="limit_money_pair_total" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">*0为不设上限</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">下注时间:</label>
|
||||
<div class="controls">
|
||||
<input id="wait_time" name="wait_time" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 120px;" placeholder="空白则默认30秒" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="rob_time_box" style="display: none;">
|
||||
<label class="control-label">等待抢庄时间:</label>
|
||||
<div class="controls">
|
||||
<input id="rob_time" name="rob_time" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 120px;" placeholder="空白则默认8秒" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 前三秒为提示准备时间,剩余时间为抢庄时间</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">是否扫牌:</label>
|
||||
<div class="controls">
|
||||
<div class="right_word">
|
||||
<div class="is_check" id="scavenging">
|
||||
<input name="scavenging" type="radio" value="1" />是
|
||||
<input name="scavenging" type="radio" value="0" checked="checked" />否
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="is_rob_box" style="display: none;">
|
||||
<label class="control-label">是否抢庄:</label>
|
||||
<div class="controls">
|
||||
<div class="right_word">
|
||||
<div class="is_check" id="rob">
|
||||
<input name="rob" type="radio" value="1" />是
|
||||
<input name="rob" type="radio" value="0" checked="checked" />否
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="limit_banker_amount_box" style="display: none;">
|
||||
<label class="control-label">上庄金额:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_banker_amount" name="limit_banker_amount" type="text" value='' maxlength="50" minlength="3" class="required" style="width: 120px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="control_select" style="display: none;">
|
||||
<label class="control-label">桌子操作模式:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="is_localhost_control" id="is_localhost_control">
|
||||
<option value="0">联网控制</option>
|
||||
<option value="1">本地控制</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*独立点击台请选择联网控制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子备注:</label>
|
||||
<div class="controls">
|
||||
<textarea id="remarks" name="remarks" maxlength="200" class="input-xlarge" rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="username" name="username" type="text" value='' maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="newPassword" name="newPassword" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="confirmNewPassword" name="confirmNewPassword" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="nickname" name="nickname" type="text" value='' maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" style="display: none;">
|
||||
<label class="control-label">关联手机:</label>
|
||||
<div class="controls">
|
||||
<input id="phone" name="phone" type="text" value='' class="required">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">开牌间隔时间:</label>
|
||||
<div class="controls">
|
||||
<input id="interval_time" name="interval_time" type="text" value='' class="required">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">定位牌模式:</label>
|
||||
<div class="controls">
|
||||
<div class="layui-input-block" >
|
||||
<select name="card_first_type" id="card_first_type">
|
||||
<option value="0">扫牌</option>
|
||||
<option value="1">骰子</option>
|
||||
</select>
|
||||
</div>
|
||||
<span class="help-inline">
|
||||
<font color="red">*牛牛或者三卡牛牛的定位牌模式,百家乐龙虎不起作用</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='add_submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$("select#game_id").change(function(){
|
||||
var game_id = $('#game_id').val();
|
||||
$("#mode").val("");
|
||||
$("#min_pair").val('');
|
||||
$("#mxn_pair").val('');
|
||||
$("#min_tie").val('');
|
||||
$("#mxn_tie").val('');
|
||||
if(game_id == 1){
|
||||
$('#control_select').show();
|
||||
$('#is_mode').show();
|
||||
$('#w_pair').show();
|
||||
$('#w_tie').show();
|
||||
$('#total_pair').show();
|
||||
$('#total_tie').hide();
|
||||
$('#rob_time_box').hide();
|
||||
$('#is_rob_box').hide();
|
||||
$('#limit_banker_amount_box').hide();
|
||||
}else if(game_id == 2){
|
||||
$('#control_select').show();
|
||||
$('#is_mode').hide();
|
||||
$('#w_pair').hide();
|
||||
$('#total_pair').hide();
|
||||
$('#rob_time_box').hide();
|
||||
$('#is_rob_box').hide();
|
||||
$('#limit_banker_amount_box').hide();
|
||||
}else if(game_id == 4){
|
||||
$('#control_select').hide();
|
||||
$('#is_mode').hide();
|
||||
$('#w_pair').hide();
|
||||
$('#w_tie').hide();
|
||||
$('#total_pair').hide();
|
||||
$('#total_tie').hide();
|
||||
$('#rob_time_box').show();
|
||||
$('#is_rob_box').show();
|
||||
$('#limit_banker_amount_box').show();
|
||||
}else if(game_id == 5){
|
||||
$('#control_select').hide();
|
||||
$('#is_mode').hide();
|
||||
$('#w_pair').hide();
|
||||
$('#w_tie').hide();
|
||||
$('#total_pair').hide();
|
||||
$('#total_tie').hide();
|
||||
$('#rob_time_box').show();
|
||||
$('#is_rob_box').show();
|
||||
$('#limit_banker_amount_box').show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.add_submit').click(function(){
|
||||
var query = new Object();
|
||||
query.table_num = $('#table_num').val();
|
||||
query.table_name = $('#table_name').val();
|
||||
query.game_id = $('#game_id').val();
|
||||
if(query.game_id == 1){
|
||||
query.mode = $('#mode').val();
|
||||
}
|
||||
query.min_bankerplayer = $('#min_bankerplayer').val();
|
||||
query.max_bankerplayer = $('#max_bankerplayer').val();
|
||||
if(query.game_id == 1 || query.game_id == 2){
|
||||
query.min_tie = $('#min_tie').val();
|
||||
query.max_tie = $('#max_tie').val();
|
||||
}
|
||||
if(query.game_id == 1){
|
||||
query.min_pair = $('#min_pair').val();
|
||||
query.max_pair = $('#max_pair').val();
|
||||
}
|
||||
query.wait_time = $('#wait_time').val();
|
||||
query.is_scavenging = $('#scavenging').find("input:checked").attr("value");
|
||||
if(query.game_id == 4 || query.game_id == 5){
|
||||
query.rob_time = $('#rob_time').val();
|
||||
query.is_rob = $('#rob').find("input:checked").attr("value");
|
||||
query.limit_banker_amount = $('#limit_banker_amount').val();
|
||||
}
|
||||
query.remarks = $('#remarks').val();
|
||||
query.username = $('#username').val();
|
||||
query.newPassword = $('#newPassword').val();
|
||||
query.confirmNewPassword = $('#confirmNewPassword').val();
|
||||
query.nickname = $('#nickname').val();
|
||||
query.phone = $('#phone').val();
|
||||
query.bet_type = $('#bet_type').val();
|
||||
query.is_localhost_control = $('#is_localhost_control').val();
|
||||
// 视频地址
|
||||
query.media_far_rtmp = $('#media_far_rtmp').val();
|
||||
query.media_far_flv = $('#media_far_flv').val();
|
||||
query.media_far_ws = $('#media_far_ws').val();
|
||||
query.media_near_rtmp = $('#media_near_rtmp').val();
|
||||
query.media_near_flv = $('#media_near_flv').val();
|
||||
query.media_near_ws = $('#media_near_ws').val();
|
||||
|
||||
query.limit_money_total = $('#limit_money_total').val();
|
||||
query.limit_money_tie_total = $('#limit_money_tie_total').val();
|
||||
query.limit_money_pair_total = $('#limit_money_pair_total').val();
|
||||
query.interval_time = $('#interval_time').val();
|
||||
query.card_first_type = $('#card_first_type').val();
|
||||
query.seat_num = $('#seat_num').val();
|
||||
if(query.table_num == '' || query.table_num == null){
|
||||
layer.alert('请填写桌台号!');
|
||||
return false;
|
||||
}
|
||||
if(parseInt(query.table_num) <= 0){
|
||||
layer.alert('桌台号只能填写大于0的数字!');
|
||||
return false;
|
||||
}
|
||||
if(query.table_name == '' || query.table_name == null){
|
||||
layer.alert('请填写桌台名称!');
|
||||
return false;
|
||||
}
|
||||
if(query.game_id == '' || query.game_id == null){
|
||||
layer.alert('请选择游戏名称!');
|
||||
return false;
|
||||
}
|
||||
if(query.game_id == 1){
|
||||
if(query.mode == '' || query.mode == null){
|
||||
layer.alert('请选择游戏模式!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if((query.min_bankerplayer == '' || query.min_bankerplayer == null)||(query.max_bankerplayer == '' || query.max_bankerplayer == null)){
|
||||
layer.alert('请填写完整网络-庄闲限红!');
|
||||
return false;
|
||||
}
|
||||
if(query.game_id == 1 || query.game_id == 2){
|
||||
if((query.min_tie == '' || query.min_tie == null)||(query.max_tie == '' || query.max_tie == null)){
|
||||
layer.alert('请填写完整网络-和限红!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.game_id == 1){
|
||||
if((query.min_pair == '' || query.min_pair == null)||(query.max_pair == '' || query.max_pair == null)){
|
||||
layer.alert('请填写完整网络-对限红!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.is_scavenging == '' || query.is_scavenging == null){
|
||||
layer.alert('请选择是否扫牌!');
|
||||
return false;
|
||||
}
|
||||
if(query.game_id == 4 || query.game_id == 5){
|
||||
if(query.is_rob == '' || query.is_rob == null){
|
||||
layer.alert('请选择是否抢庄!');
|
||||
return false;
|
||||
}
|
||||
if(query.is_rob == 1){
|
||||
if(query.limit_banker_amount == '' || query.limit_banker_amount == null){
|
||||
layer.alert('请填写抢庄金额!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(query.username == '' || query.username == null){
|
||||
layer.alert('请填写账户名!');
|
||||
return false;
|
||||
}
|
||||
if(query.newPassword == '' || query.newPassword == null){
|
||||
layer.alert('请填写密码!');
|
||||
return false;
|
||||
}
|
||||
if(query.newPassword.length < 6 || query.newPassword.length >20){
|
||||
layer.alert('新密码长度必须是6到20个字符!');
|
||||
return false;
|
||||
}
|
||||
if(query.confirmNewPassword == '' || query.confirmNewPassword == null){
|
||||
layer.alert('请再次填写密码!');
|
||||
return false;
|
||||
}
|
||||
if(query.newPassword != query.confirmNewPassword){
|
||||
layer.alert('两次输入的密码不一致!');
|
||||
return false;
|
||||
}
|
||||
if(query.nickname == '' || query.nickname == null){
|
||||
layer.alert('请填写昵称!');
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url:"/game/do_add_table",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
success:function(data){
|
||||
if(data.status == 1){
|
||||
layer.alert(data.code);
|
||||
}else{
|
||||
layer.alert(data.code,function(){
|
||||
window.location.href='/game/index';
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
391
application/admin/view/game/edit_table_info.html
Normal file
391
application/admin/view/game/edit_table_info.html
Normal file
@ -0,0 +1,391 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .pass_edit{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .pass_edit:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 700px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; }
|
||||
.form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.info_submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
.right_word{font-size: 14px;padding-top: 3px;}
|
||||
.is_check{font-size: 14px;}
|
||||
.is_check input{width: 20px;height: 14px;font-size: 14px;}
|
||||
</style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="/game/index" class="person_info">吧台列表</a>
|
||||
<a href="javascript:;" class="pass_edit">吧台修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from" class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌台号:</label>
|
||||
<div class="controls">
|
||||
<input id="table_num" name="table_name" type="text" value='{$table_info.table_num}' maxlength="50" minlength="3" class="required" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
<span class="help-inline">
|
||||
<font color="red">(只能填数字)</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌台名称:</label>
|
||||
<div class="controls">
|
||||
<input id="table_name" name="table_name" type="text" value='{$table_info.table_name}' maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">排序:</label>
|
||||
<div class="controls">
|
||||
<input id="sort" name="sort" type="text" value='{$table_info.sort}' maxlength="9" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 数值越大,排在前面</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select name="bet_type" id="bet_type" maxlength="50" minlength="3" style="width:310px;height:25px;">
|
||||
<option value="0">--请选择投注方式--</option>
|
||||
<option value="1" <?php if($table_info['bet_type'] == 1) echo 'selected="selected"';?> >网络投注</option>
|
||||
<option value="2" <?php if($table_info['bet_type'] == 2) echo 'selected="selected"';?> >电话投注</option>
|
||||
<!--
|
||||
<option value="3" <?php if($table_info['bet_type'] == 3) echo 'selected="selected"';?> >所有投注</option>
|
||||
-->
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">座位数:</label>
|
||||
<div class="controls">
|
||||
<select name="seat_num" id="seat_num" maxlength="50" minlength="3" style="width:310px;height:25px;">
|
||||
<option value="0">--请选择座位数--</option>
|
||||
<option value="1" <?php if($table_info['seat_num'] == 1) echo 'selected="selected"';?> >1</option>
|
||||
<option value="2" <?php if($table_info['seat_num'] == 2) echo 'selected="selected"';?> >2</option>
|
||||
<option value="3" <?php if($table_info['seat_num'] == 3) echo 'selected="selected"';?> >3</option>
|
||||
<option value="4" <?php if($table_info['seat_num'] == 4) echo 'selected="selected"';?> >4</option>
|
||||
<option value="5" <?php if($table_info['seat_num'] == 5) echo 'selected="selected"';?> >5</option>
|
||||
<option value="6" <?php if($table_info['seat_num'] == 6) echo 'selected="selected"';?> >6</option>
|
||||
<option value="7" <?php if($table_info['seat_num'] == 7) echo 'selected="selected"';?> >7</option>
|
||||
<option value="8" <?php if($table_info['seat_num'] == 8) echo 'selected="selected"';?> >8</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">本地识别设备IP:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_rtmp" name="media_near_rtmp" type="text" value='{$table_info.media_near_rtmp}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">本地荷官端视频[flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_rtmp" name="media_far_rtmp" type="text" value='{$table_info.media_far_rtmp}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">高清[live/hd.flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_flv" name="media_far_flv" type="text" value='{$table_info.media_far_flv}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">标清[live/sd.flv]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_far_ws" name="media_far_ws" type="text" value='{$table_info.media_far_ws}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">线路一:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_flv" name="media_near_flv" type="text" value='{$table_info.media_near_flv}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">线路二:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_ws" name="media_near_ws" type="text" value='{$table_info.media_near_ws}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空[如无,可填入线路一]</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="control-group" style="display: none;">
|
||||
<label class="control-label">近景视频地址_RTMP[已废]:</label>
|
||||
<div class="controls">
|
||||
<input id="media_near_rtmp" name="media_near_rtmp" type="text" value='{$table_info.media_near_rtmp}' maxlength="255" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">* 不填默认为空</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子-庄闲限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_bankerplayer" name="min_bankerplayer" type="text" value='{$table_info.min_bankerplayer}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_bankerplayer" name="max_bankerplayer" type="text" value='{$table_info.max_bankerplayer}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php if($table_info['game_id'] == 1 || $table_info['game_id'] == 2) : ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子-和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_tie" name="min_tie" type="text" value='{$table_info.min_tie}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_tie" name="max_tie" type="text" value='{$table_info.max_tie}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if($table_info['game_id'] == 1) : ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子-对限红:</label>
|
||||
<div class="controls">
|
||||
<input id="min_pair" name="min_pair" type="text" value='{$table_info.min_pair}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
-
|
||||
<input id="max_pair" name="max_pair" type="text" value='{$table_info.max_pair}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子单口最大庄闲限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_total" name="limit_money_total" type="text" value='{$table_info.limit_money_total}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php if($table_info['game_id'] == 1 || $table_info['game_id'] == 2) : ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子单口最大和限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_tie_total" name="limit_money_tie_total" type="text" value='{$table_info.limit_money_tie_total}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if($table_info['game_id'] == 1) : ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">桌子单口最大对限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_money_pair_total" name="limit_money_pair_total" type="text" value='{$table_info.limit_money_pair_total}' maxlength="50" minlength="3" class="required" style="width: 80px;" onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="control-group">
|
||||
<label class="control-label">下注时间:</label>
|
||||
<div class="controls">
|
||||
<input id="wait_time" name="wait_time" type="text" value='{$table_info.wait_time}' maxlength="50" minlength="3" class="required"、
|
||||
onkeyup="value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">是否扫牌:</label>
|
||||
<div class="controls">
|
||||
<div class="right_word">
|
||||
<div class="is_check" id="scavenging">
|
||||
<input name="scavenging" type="radio" {if $table_info.is_scavenging eq 1} checked{/if} value="1" />是
|
||||
<input name="scavenging" type="radio" {if $table_info.is_scavenging eq 0} checked{/if} value="0" />否
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 修改后必须重启webSocket 手动处理改为自动处理在提交结果后重启 自动处理改为手动处理在结束下注后重启 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="username" name="username" type="text" value='{$table_info.username}' maxlength="50" minlength="3" class="required" disabled="disabled">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">新密码:</label>
|
||||
<div class="controls">
|
||||
<input id="newPassword" name="newPassword" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认新密码:</label>
|
||||
<div class="controls">
|
||||
<input id="confirmNewPassword" name="confirmNewPassword" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" style="display: none;">
|
||||
<label class="control-label">关联手机:</label>
|
||||
<div class="controls">
|
||||
<input id="phone" name="phone" type="text" value='{$table_info.phone}' class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">开牌间隔时间:</label>
|
||||
<div class="controls">
|
||||
<input id="interval_time" name="interval_time" type="text" value='{$table_info.interval_time}' class="required">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">定位牌模式:</label>
|
||||
<div class="controls">
|
||||
<select name="card_first_type" id="card_first_type" style="width:310px;height:25px;">
|
||||
<option value="0" <?php if($table_info['card_first_type'] == 0) echo 'selected="selected"';?> >扫牌</option>
|
||||
<option value="1" <?php if($table_info['card_first_type'] == 1) echo 'selected="selected"';?> >骰子</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red">*牛牛或者三卡牛牛的定位牌模式,百家乐龙虎不起作用</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='info_submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="table_id" value="{$table_info.id}">
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
$('.info_submit').click(function(){
|
||||
var query = new Object();
|
||||
query.table_num = $('#table_num').val();
|
||||
query.table_name = $('#table_name').val();
|
||||
query.table_id = $('#table_id').val();
|
||||
query.bet_type = $('#bet_type').val();
|
||||
query.seat_num = $('#seat_num').val();
|
||||
query.min_bankerplayer = $('#min_bankerplayer').val();
|
||||
query.max_bankerplayer = $('#max_bankerplayer').val();
|
||||
query.min_tie = $('#min_tie').val();
|
||||
query.max_tie = $('#max_tie').val();
|
||||
query.min_pair = $('#min_pair').val();
|
||||
query.max_pair = $('#max_pair').val();
|
||||
query.newPassword = $('#newPassword').val();
|
||||
query.confirmNewPassword = $('#confirmNewPassword').val();
|
||||
|
||||
query.wait_time = $('#wait_time').val();
|
||||
query.is_scavenging = $('#scavenging').find("input:checked").attr("value");
|
||||
query.phone = $('#phone').val();
|
||||
game_id = {$table_info.game_id};
|
||||
if(query.table_num == '' || query.table_num == null){
|
||||
layer.alert('请填写桌台号!');
|
||||
return false;
|
||||
}
|
||||
if(parseInt(query.table_num) <= 0){
|
||||
layer.alert('桌台号只能填写大于0的数字!');
|
||||
return false;
|
||||
}
|
||||
if(query.table_name == '' || query.table_name == null){
|
||||
layer.alert('请填写桌台名称!');
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert('请选择投注方式!');
|
||||
return false;
|
||||
}
|
||||
if((query.min_bankerplayer == '' || query.min_bankerplayer == null)||(query.max_bankerplayer == '' || query.max_bankerplayer == null)){
|
||||
layer.alert('请填写完整网络-庄闲限红!');
|
||||
return false;
|
||||
}
|
||||
if(game_id == 1 || game_id == 2){
|
||||
if((query.min_tie == '' || query.min_tie == null)||(query.max_tie == '' || query.max_tie == null)){
|
||||
layer.alert('请填写完整网络-和限红!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(game_id == 1){
|
||||
if((query.min_pair == '' || query.min_pair == null)||(query.max_pair == '' || query.max_pair == null)){
|
||||
layer.alert('请填写完整网络-对限红!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.wait_time == '' || query.wait_time == null){
|
||||
layer.alert('请填写下注时间!');
|
||||
return false;
|
||||
}
|
||||
if(query.newPassword){
|
||||
if(query.newPassword.length < 6 || query.newPassword.length >20){
|
||||
layer.alert('新密码长度必须是6到20个字符!');
|
||||
return false;
|
||||
}
|
||||
if(query.confirmNewPassword == '' || query.confirmNewPassword == null){
|
||||
layer.alert('请再次输入密码!');
|
||||
return false;
|
||||
}
|
||||
if(query.newPassword != query.confirmNewPassword){
|
||||
layer.alert('两次输入的密码不一致!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(query.confirmNewPassword){
|
||||
if(query.newPassword == '' || query.newPassword == null){
|
||||
layer.alert('请填写新密码!');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 视频地址
|
||||
query.media_far_rtmp = $('#media_far_rtmp').val();
|
||||
query.media_far_flv = $('#media_far_flv').val();
|
||||
query.media_far_ws = $('#media_far_ws').val();
|
||||
query.media_near_rtmp = $('#media_near_rtmp').val();
|
||||
query.media_near_flv = $('#media_near_flv').val();
|
||||
query.media_near_ws = $('#media_near_ws').val();
|
||||
|
||||
query.limit_money_total = $('#limit_money_total').val();
|
||||
query.limit_money_tie_total = $('#limit_money_tie_total').val();
|
||||
query.limit_money_pair_total = $('#limit_money_pair_total').val();
|
||||
|
||||
query.interval_time = $('#interval_time').val();
|
||||
query.card_first_type = $('#card_first_type').val();
|
||||
|
||||
query.sort = $('#sort').val();
|
||||
$.ajax({
|
||||
url:"/game/do_edit_table_info",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
success:function(data){
|
||||
if(data.status == 1 ){
|
||||
layer.alert(data.code);
|
||||
}else{
|
||||
layer.alert(data.code,function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
83
application/admin/view/game/index.html
Normal file
83
application/admin/view/game/index.html
Normal file
@ -0,0 +1,83 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css"> textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; } .change_box a{font-size: 14px;padding: 10.5px 10px;} .change_box .table_list{border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative;} .change_box .table_add{color: #3daae9;} .change_box .table_list:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; } .x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; } </style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="table_list">吧台列表</a>
|
||||
<a href="/game/add_table" class="table_add">吧台添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>网络ID号</th>
|
||||
<th>吧台号</th>
|
||||
<th>吧台名称</th>
|
||||
<th>游戏类型</th>
|
||||
<th>投注方式</th>
|
||||
<th>座位数</th>
|
||||
<th>操作账号</th>
|
||||
<th>开牌等待时间</th>
|
||||
<th>是否扫牌</th>
|
||||
<th>总发牌次数</th>
|
||||
<th>总洗牌次数</th>
|
||||
<th>备注</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="table_info" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.table_num}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.game_name}</td>
|
||||
<td>{$vo.bet_type}</td>
|
||||
<td>{$vo.seat_num}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.wait_time}</td>
|
||||
<td>{if $vo.is_scavenging eq 0}否{else}是{/if}</td>
|
||||
<td>{$vo.number_total}</td>
|
||||
<td>{if $vo.boot_total eq ''}0{else}{$vo.boot_total}{/if}</td>
|
||||
<td><?php if($vo['is_localhost_control'] == 1){echo '本地控制';}else{echo '网络控制';} ?></td>
|
||||
<td><?php if($vo['status'] == 1){echo '<span style="color:#139E5B">开启中</span>';}else{echo '<span style="color:#FF3B30">关停中</span>';} ?></td>
|
||||
<td class="td-manage">
|
||||
<a onclick="delete_table({$vo.id});" style="color:#1E90FF; cursor:pointer; text-decoration:underline; margin-right:20px;">停开 / 开台</a>
|
||||
<a href="/game/edit_table_info?table_id={$vo.id}" style="color:#1E90FF; cursor:pointer; text-decoration:underline;">修改</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function delete_table(table_id){
|
||||
layer.confirm('是否要更改该桌子',{btn: ['确定','取消']}, function(index){
|
||||
var query = new Object();
|
||||
query.table_id = parseInt(table_id);
|
||||
$.ajax({
|
||||
url:"/game/delete_table",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
success:function(data){
|
||||
if(data.Success == 1){
|
||||
layer.msg(data.Msg);
|
||||
setTimeout("window.location.reload();", 2000);
|
||||
}else{
|
||||
layer.msg(data.Msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
359
application/admin/view/index/index.html
Executable file
359
application/admin/view/index/index.html
Executable file
@ -0,0 +1,359 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>后台管理中心</title>
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<link rel="stylesheet" href="/static/admin/css/font.css">
|
||||
<link rel="stylesheet" href="/static/admin/css/xadmin.css">
|
||||
<script type="text/javascript" src="/static/admin/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
|
||||
|
||||
</head>
|
||||
<style>.layui-nav {padding: 0 10px;}</style>
|
||||
<body>
|
||||
<audio id="tk_notice" src="/static/admin/tk_notice.mp3" preload hidden="true"></audio>
|
||||
<!-- 顶部开始 -->
|
||||
<div class="container">
|
||||
<div class="logo"><a href="./index.html">后台管理中心</a></div>
|
||||
<div class="left_open">
|
||||
<i title="展开左侧栏" class="iconfont"></i>
|
||||
</div>
|
||||
<ul class="layui-nav left" >
|
||||
<li class="layui-nav-item layui-this" id="mypanel"><a href="javascript:;">我的面板</a></li>
|
||||
<li class="layui-nav-item" id="operate"><a href="javascript:;">运营管理</a></li>
|
||||
<?php if($user_info['role'] == 0 || $user_info['role'] == 1) : ?>
|
||||
<li class="layui-nav-item" id="configure"><a href="javascript:;">游戏配置</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<ul class="layui-nav right">
|
||||
<li class="layui-nav-item"><a href="javascript:;">{$admin}</a><dl class="layui-nav-child"><dd><a href="/login/logout">退出登录</a></dd></dl></li>
|
||||
<li class="layui-nav-item to-index"><a href="/">后台首页</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 顶部结束 -->
|
||||
<!-- 中部开始 -->
|
||||
<!-- 左侧菜单开始 -->
|
||||
<div class="left-nav">
|
||||
<div id="side-nav">
|
||||
<ul id="nav">
|
||||
<div id="mypanel_list">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">个人信息</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li class="actived" id="info_index"><a _href="/info/index"><i class="iconfont"></i><cite>个人信息</cite></a></li>
|
||||
<li id='info_pass_edit'><a _href="/info/pass_edit"><i class="iconfont"></i><cite>修改密码</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php if($user_info['role'] == 0) : ?>
|
||||
<!-- admin -->
|
||||
<div id="operate_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">代理管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li class="actived"><a _href="/agent/index"><i class="iconfont"></i><cite>代理管理</cite></a></li>
|
||||
<li><a _href="/agent/scores"><i class="iconfont"></i><cite>上下分查询</cite></a></li>
|
||||
<li><a _href="/report/user_recharge"><i class="iconfont"></i><cite>充值提现查询</cite></a></li>
|
||||
<li><a _href="/xima/xima_check"><i class="iconfont"></i><cite>洗码查询</cite></a></li>
|
||||
<li><a _href="/cs/cs_check"><i class="iconfont"></i><cite>占股查询</cite></a></li>
|
||||
<li><a _href="/agent/profit"><i class="iconfont"></i><cite>收益查询</cite></a></li>
|
||||
<li><a _href="/log/index"><i class="iconfont"></i><cite>操作日志</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">系统管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/memo/memo"><i class="iconfont"></i><cite>公告管理</cite></a></li>
|
||||
<li><a _href="/log/scan_admin"><i class="iconfont"></i><cite>扫描用户管理</cite></a></li>
|
||||
<li><a _href="/log/api_admin"><i class="iconfont"></i><cite>接口用户管理</cite></a></li>
|
||||
<li><a _href="/log/admin"><i class="iconfont"></i><cite>代理操作日志</cite></a></li>
|
||||
<li><a _href="/log/user_login"><i class="iconfont"></i><cite>用户登录日志</cite></a></li>
|
||||
<li><a _href="/admin/admin_print"><i class="iconfont"></i><cite>后台用户列表</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">游戏管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/table/edit_numberTab"><i class="iconfont"></i><cite>牌桌结果修改记录</cite></a></li>
|
||||
<!-- <li><a _href="/table/baccarat"><i class="iconfont"></i><cite>百家乐桌子账目</cite></a></li>-->
|
||||
<!-- <li><a _href="/table/dt"><i class="iconfont"></i><cite>龙虎斗桌子账目</cite></a></li>-->
|
||||
<!-- <li><a _href="/table/nn"><i class="iconfont"></i><cite>牛牛桌子账目</cite></a></li>-->
|
||||
<!-- <li><a _href="/player/baccarat_record"><i class="iconfont"></i><cite>百家乐游戏记录管理</cite></a></li>-->
|
||||
<!-- <li><a _href="/player/dt_record"><i class="iconfont"></i><cite>龙虎斗游戏记录管理</cite></a></li>-->
|
||||
<!-- <li><a _href="/player/nn_record"><i class="iconfont"></i><cite>牛牛游戏记录管理</cite></a></li>-->
|
||||
<!-- <li><a _href="/waybill/baccarat"><i class="iconfont"></i><cite>百家乐路单修改</cite></a></li>-->
|
||||
<!-- <li><a _href="/waybill/dt"><i class="iconfont"></i><cite>龙虎斗路单修改</cite></a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">充值管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/Recharge/index"><i class="iconfont"></i><cite>收款信息列表</cite></a></li>
|
||||
<li><a _href="/Recharge/recharge_record"><i class="iconfont"></i><cite>充值提现记录</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">网投管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/Tip/index"><i class="iconfont"></i><cite>打赏信息列表</cite></a></li>
|
||||
<li><a _href="/Tip/optimum"><i class="iconfont"></i><cite>今日最佳记录</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">客服管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/chat/index"><i class="iconfont"></i><cite>客服工作台</cite></a></li>
|
||||
<li><a _href="/chat/record"><i class="iconfont"></i><cite>聊天记录查询</cite></a></li>
|
||||
<li><a _href="/chat_quick_reply/index"><i class="iconfont"></i><cite>快捷回复管理</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<div id="configure_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">游戏配置</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li><a _href="/game/index"><i class="iconfont"></i><cite>吧台配置</cite></a></li>
|
||||
<li><a _href="/recharge/setting"><i class="iconfont"></i><cite>充值提现配置</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php elseif($user_info['role'] == 1) : ?>
|
||||
<!-- jiankong -->
|
||||
<div id="operate_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">代理管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li><a _href="/player/user_online"><i class="iconfont"></i><cite>在线玩家</cite></a></li>
|
||||
<li><a _href="/log/index"><i class="iconfont"></i><cite>操作日志</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">系统管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/memo/memo"><i class="iconfont"></i><cite>公告管理</cite></a></li>
|
||||
<li><a _href="/memo/activity"><i class="iconfont"></i><cite>活动管理</cite></a></li>
|
||||
<li><a _href="/log/scan_admin"><i class="iconfont"></i><cite>扫描用户管理</cite></a></li>
|
||||
<li><a _href="/log/admin"><i class="iconfont"></i><cite>代理操作日志</cite></a></li>
|
||||
<li><a _href="/log/user_login"><i class="iconfont"></i><cite>用户登录日志</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">游戏管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
<li><a _href="/player/baccarat_record"><i class="iconfont"></i><cite>百家乐游戏记录管理</cite></a></li>
|
||||
<li><a _href="/player/dt_record"><i class="iconfont"></i><cite>龙虎斗游戏记录管理</cite></a></li>
|
||||
<li><a _href="/player/nn_record"><i class="iconfont"></i><cite>牛牛游戏记录管理</cite></a></li>
|
||||
<li><a _href="/waybill/baccarat"><i class="iconfont"></i><cite>百家乐路单修改</cite></a></li>
|
||||
<li><a _href="/waybill/dt"><i class="iconfont"></i><cite>龙虎斗路单修改</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<div id="configure_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">游戏配置</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li><a _href="/game/index"><i class="iconfont"></i><cite>吧台配置</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php elseif($user_info['role'] == 2) : ?>
|
||||
<!-- dl -->
|
||||
<div id="operate_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">代理管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li class="actived"><a _href="/agent/index"><i class="iconfont"></i><cite>代理管理</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php elseif($user_info['role'] == 3) : ?>
|
||||
<!-- sf -->
|
||||
<div id="operate_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">代理管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li class="actived"><a _href="/agent/index"><i class="iconfont"></i><cite>代理管理</cite></a></li>
|
||||
<li><a _href="/agent/scores"><i class="iconfont"></i><cite>上下分查询</cite></a></li>
|
||||
<li><a _href="/xima/xima_check"><i class="iconfont"></i><cite>洗码查询</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php elseif($user_info['role'] == 4) : ?>
|
||||
<!-- sw -->
|
||||
<div id="operate_list" style="display: none;">
|
||||
<li class="open">
|
||||
<a href="javascript:;">
|
||||
<cite class="main-nav">代理管理</cite>
|
||||
<i class="iconfont nav_right"></i>
|
||||
</a>
|
||||
<ul class="sub-menu" style="display:block;">
|
||||
<li class="actived"><a _href="/agent/index"><i class="iconfont"></i><cite>代理管理</cite></a></li>
|
||||
<li><a _href="/agent/scores"><i class="iconfont"></i><cite>上下分查询</cite></a></li>
|
||||
<li class="actived"><a _href="/xima/index"><i class="iconfont"></i><cite>洗码管理</cite> </a></li>
|
||||
<li><a _href="/xima/xima_check"><i class="iconfont"></i><cite>洗码查询</cite></a></li>
|
||||
<li class="actived"><a _href="/cs/index"><i class="iconfont"></i><cite>占股管理</cite></a></li>
|
||||
<li><a _href="/cs/cs_check"><i class="iconfont"></i><cite>占股查询</cite></a></li>
|
||||
<li><a _href="/report/profit"><i class="iconfont"></i><cite>收益报表</cite></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="x-slide_left"></div> -->
|
||||
<!-- 左侧菜单结束 -->
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="agent-add-label" value="/agent/agent_add">
|
||||
<!-- 右侧主体开始 -->
|
||||
<div class="page-content">
|
||||
<div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
|
||||
<ul class="layui-tab-title">
|
||||
<li>个人信息</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<iframe src='/info/index' frameborder="0" scrolling="yes" class="x-iframe" id="x-iframe"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-content-bg"></div>
|
||||
<!-- 右侧主体结束 -->
|
||||
<!-- 中部结束 -->
|
||||
<!-- 底部开始 -->
|
||||
<div class="footer"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_cashout(){
|
||||
var query = new Object();
|
||||
$.ajax({
|
||||
url:"/index/check_cashout",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:query,
|
||||
success:function(data){
|
||||
if(data.code == 1){
|
||||
var tk_notice = document.getElementById('tk_notice');
|
||||
tk_notice.play();
|
||||
}else{
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function (){
|
||||
setInterval(()=>{
|
||||
check_cashout();
|
||||
},60000);
|
||||
})
|
||||
// 我的面板
|
||||
$('#mypanel').click(function(){
|
||||
// 展开侧边栏盒子
|
||||
$('#mypanel_list').show().siblings().hide();
|
||||
// 默认展开盒子内第一个大类
|
||||
$('#mypanel_list').find('.sub-menu').hide().eq(0).show();
|
||||
$('#mypanel_list').find('.nav_right').html('').eq(0).html('');
|
||||
// 左边导航栏默认第一个高亮显示
|
||||
$('#mypanel_list').find('.sub-menu').find('li').removeClass('actived').eq(0).addClass('actived');
|
||||
});
|
||||
// 运营管理
|
||||
$('#operate').click(function(){
|
||||
// 展开侧边栏盒子
|
||||
$('#operate_list').show().siblings().hide();
|
||||
// 默认展开盒子内第一个大类
|
||||
$('#operate_list').find('.sub-menu').hide().eq(0).show();
|
||||
$('#operate_list').find('.nav_right').html('').eq(0).html('');
|
||||
// 左边导航栏默认第一个高亮显示
|
||||
$('#operate_list').find('.sub-menu').find('li').removeClass('actived').eq(0).addClass('actived');
|
||||
|
||||
});
|
||||
// 游戏配置
|
||||
$('#configure').click(function(){
|
||||
// 展开侧边栏盒子
|
||||
$('#configure_list').show().siblings().hide();
|
||||
// 默认展开盒子内第一个大类
|
||||
$('#configure_list').find('.sub-menu').hide().eq(0).show();
|
||||
$('#configure_list').find('.nav_right').html('').eq(0).html('');
|
||||
// 左边导航栏默认第一个高亮显示
|
||||
$('#configure_list').find('.sub-menu').find('li').removeClass('actived').eq(0).addClass('actived');
|
||||
});
|
||||
// 系统设置
|
||||
$('#install').click(function(){
|
||||
// 展开侧边栏盒子
|
||||
$('#install_list').show().siblings().hide();
|
||||
// 默认展开盒子内第一个大类
|
||||
$('#install_list').find('.sub-menu').hide().eq(0).show();
|
||||
$('#install_list').find('.nav_right').html('').eq(0).html('');
|
||||
// 左边导航栏默认第一个高亮显示
|
||||
$('#install_list').find('.sub-menu').find('li').removeClass('actived').eq(0).addClass('actived');
|
||||
});
|
||||
|
||||
// 点击后左侧导航栏高亮显示
|
||||
$('.sub-menu li').click(function(){
|
||||
$('.sub-menu li').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
});
|
||||
|
||||
// 点击顶部导航栏显示页面
|
||||
$('.container li').click(function(){
|
||||
var id = $(this).attr('id');
|
||||
$('#'+id+'_list').find('.sub-menu').find('li').eq(0).trigger('click');
|
||||
});
|
||||
|
||||
// iframe页面触发父页面的跳转
|
||||
$('#agent-add-label').click(function(){
|
||||
alert(1111)
|
||||
var url = $(this).val();
|
||||
console.log($('.x-frame'))
|
||||
$('#x-iframe').location.href = url;
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
57
application/admin/view/index/relation.html
Executable file
57
application/admin/view/index/relation.html
Executable file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>后台管理系统</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<link rel="stylesheet" href="/static/agent/css/font.css">
|
||||
<link rel="stylesheet" href="/static/agent/css/xadmin.css">
|
||||
<script type="text/javascript" src="/static/agent/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/static/agent/lib/layui/layui.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="/static/agent/js/xadmin.js"></script>
|
||||
|
||||
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
.x-body{padding-top:20px;width:96%;margin:10px 2%;}
|
||||
.iconfont{color:#5FB878;position:relative;top:-25px;left:-10px;}
|
||||
.username{position:relative;top:-50px;left:20px;}
|
||||
.line-ul{padding-top:20px;}
|
||||
.line-li{border-left:1px solid #ccc;margin-top:18px;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<fieldset class="layui-elem-field">
|
||||
<legend>关系结构</legend>
|
||||
<div class="layui-field-box">
|
||||
<table class="layui-table">
|
||||
<tbody>
|
||||
<ul class="line-ul">
|
||||
{foreach name="$relation" item="vo"}
|
||||
<li class="line-li">
|
||||
<i class="icon iconfont">O</i>
|
||||
<div class="username">
|
||||
<b>{$vo.username}</b>
|
||||
<span>({$vo.nickname})</span>
|
||||
<span style="color:{$vo.color}">({$vo.agent})</span>
|
||||
<div>创建日期:{$vo.reg_time}</div>
|
||||
</div>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
85
application/admin/view/info/index.html
Normal file
85
application/admin/view/info/index.html
Normal file
@ -0,0 +1,85 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css"> textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; } .change_box a{font-size: 14px;padding: 10.5px 10px;} .change_box .person_info{border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; } .change_box .person_info:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; } .x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; } .control-group{overflow: hidden; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dotted #dddddd; } .control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; } .controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; } .controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; } .controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; } .bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; } .info_submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; } </style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="person_info">个人信息</a>
|
||||
<a href="javascript:;" class="pass_edit">修改密码</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from" class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">上次登录:</label>
|
||||
<div class="controls" style="padding-top: 5px;">
|
||||
<label class="lbl">IP: {$last_login_info['last_login_ip']} 时间:{$last_login_info['last_login_time']}</label>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">娱乐场名称:</label>
|
||||
<div class="controls">
|
||||
<input id="casino_name" name="casino_name" type="text" value="{$system_info.casino_name}" maxlength="50">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">ws链接:</label>
|
||||
<div class="controls">
|
||||
<input id="ws_url" name="ws_url" type="text" value="{$system_info.ws_url}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">PC大堂视频连接:</label>
|
||||
<div class="controls">
|
||||
<input id="pc_video" name="pc_video" type="text" value="{$system_info.pc_video}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">WAP大堂视频连接:</label>
|
||||
<div class="controls">
|
||||
<input id="wap_video" name="wap_video" type="text" value="{$system_info.wap_video}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='info_submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
$('.info_submit').click(function(){
|
||||
var casino_name = $('#casino_name').val();
|
||||
var ws_url = $('#ws_url').val();
|
||||
var pc_video = $('#pc_video').val();
|
||||
var wap_video = $('#wap_video').val();
|
||||
if(casino_name == '' || ws_url == '' || pc_video == '' || wap_video ==''){
|
||||
layer.alert('请完整填写资料!');
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url:"/info/update_info",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:{casino_name:casino_name,ws_url:ws_url,pc_video:pc_video,wap_video:wap_video},
|
||||
success:function(data){
|
||||
layer.alert(data.code,function(){
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.person_info').click(function(){
|
||||
$('#info_index',window.parent.document).trigger('click');
|
||||
});
|
||||
$('.pass_edit').click(function(){
|
||||
$('#info_pass_edit',window.parent.document).trigger('click');
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
100
application/admin/view/info/pass_edit.html
Normal file
100
application/admin/view/info/pass_edit.html
Normal file
@ -0,0 +1,100 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css"> textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; } .change_box a{font-size: 14px;padding: 10.5px 10px;} .change_box .pass_edit{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; } .change_box .pass_edit:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; } .x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; } .control-group{overflow: hidden; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dotted #dddddd; } .control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; } .controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; } .controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; } .controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; } .bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; } .pass_submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; } </style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="person_info">个人信息</a>
|
||||
<a href="javascript:;" class="pass_edit">修改密码</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">旧密码:</label>
|
||||
<div class="controls">
|
||||
<input id="oldPassword" name="oldPassword" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">新密码:</label>
|
||||
<div class="controls">
|
||||
<input id="newPassword" name="newPassword" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认新密码:</label>
|
||||
<div class="controls">
|
||||
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value maxlength="50" minlength="3" class="required" equalto="#newPassword"><span class="help-inline">
|
||||
<font color="red">*</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='pass_submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
$('.pass_submit').click(function(){
|
||||
var oldPassword = $('#oldPassword').val();
|
||||
var newPassword = $('#newPassword').val();
|
||||
var confirmNewPassword = $('#confirmNewPassword').val();
|
||||
if(oldPassword == '' || oldPassword == null){
|
||||
layer.alert('请填写旧密码!');
|
||||
return false;
|
||||
}
|
||||
if(newPassword == '' || newPassword == null){
|
||||
layer.alert('请填写新密码!');
|
||||
return false;
|
||||
}
|
||||
if(newPassword.length < 6 || newPassword.length >20){
|
||||
layer.alert('新密码长度必须是6到20个字符');
|
||||
return false;
|
||||
}
|
||||
if(confirmNewPassword == '' || confirmNewPassword == null){
|
||||
layer.alert('请再次填写新密码!');
|
||||
return false;
|
||||
}
|
||||
if(newPassword != confirmNewPassword){
|
||||
layer.alert('两次输入的密码不一致!');
|
||||
return false;
|
||||
}
|
||||
var id = {$user_info['id']};
|
||||
$.ajax({
|
||||
url:"/info/update_password",
|
||||
type:"POST",
|
||||
dataType:"JSON",
|
||||
data:{id:id,oldPassword:oldPassword,newPassword:newPassword,confirmNewPassword:confirmNewPassword},
|
||||
success:function(data){
|
||||
if(data.status == 1){
|
||||
layer.alert(data.code);
|
||||
}else{
|
||||
layer.alert(data.code);
|
||||
$('#oldPassword').val('');
|
||||
$('#newPassword').val('');
|
||||
$('#confirmNewPassword').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.person_info').click(function(){
|
||||
$('#info_index',window.parent.document).trigger('click');
|
||||
});
|
||||
$('.pass_edit').click(function(){
|
||||
$('#info_pass_edit',window.parent.document).trigger('click');
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
145
application/admin/view/log/admin.html
Normal file
145
application/admin/view/log/admin.html
Normal file
@ -0,0 +1,145 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">操作日志列表</a>
|
||||
<!--<a href="javascript:;" class="list-two" data-id="2">添加代理</a>-->
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/log/admin" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<input type="text" name="username" id="username" placeholder="请输入操作人" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>操作人</th>
|
||||
<th>操作类型</th>
|
||||
<th>操作描述</th>
|
||||
<th>操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.space_admin}</td>
|
||||
<td>{$vo.control}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td>{$vo.control_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$log_list->render()}
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/admin';
|
||||
// if(id == "2") location.href = '/agent/agent_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'操作日志列表打印',
|
||||
content: '/log/admin_print?startDate='+startDate+'&endDate='+endDate+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/log/admin?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
30
application/admin/view/log/admin_print.html
Normal file
30
application/admin/view/log/admin_print.html
Normal file
@ -0,0 +1,30 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">操作日志列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">编号</th>
|
||||
<th style="text-align: center;">操作人</th>
|
||||
<th style="text-align: center;">操作类型</th>
|
||||
<th style="text-align: center;">操作描述</th>
|
||||
<th style="text-align: center;">操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.space_admin}</td>
|
||||
<td>{$vo.control}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td>{$vo.control_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
148
application/admin/view/log/api_admin.html
Normal file
148
application/admin/view/log/api_admin.html
Normal file
@ -0,0 +1,148 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">用户添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>appid</th>
|
||||
<th>秘钥</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="admin_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.appid}</td>
|
||||
<td>{$vo.appsecret}</td>
|
||||
<td><?php if($vo['status'] == 1){echo '<span style="color:#43A72D">生效</span>';}else{echo '<span style="color:#f00">禁用</span>';} ?></td>
|
||||
<td class="td-manage">
|
||||
<a href="/log/api_admin_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="change_status(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ADB6FF;">状态</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$admin_list->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/api_admin';
|
||||
if(id == "2") location.href = '/log/api_admin_add';
|
||||
});
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/log/api_admin_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
function change_status(obj, id) {
|
||||
layer.confirm('确认要更改状态吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('更改用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/log/api_admin_status',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
143
application/admin/view/log/api_admin_add.html
Normal file
143
application/admin/view/log/api_admin_add.html
Normal file
@ -0,0 +1,143 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">appid:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">秘钥:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认秘钥:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 与秘钥保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">名称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_name" name="L_name" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/api_admin';
|
||||
if(id == "2") location.href = '/log/api_admin_add';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.appid = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.name = $('#L_name').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.appid.length == 0){
|
||||
layer.alert("请填写APPID");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length < 6){
|
||||
layer.alert("请填写超过6个字符串的秘钥");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次秘钥不一致!");
|
||||
return false;
|
||||
}
|
||||
if(query.name.length <= 0){
|
||||
layer.alert("请填写名称!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/log/do_api_admin_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/log/api_admin";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
137
application/admin/view/log/api_admin_edit.html
Normal file
137
application/admin/view/log/api_admin_edit.html
Normal file
@ -0,0 +1,137 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">appid:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$admin.appid}" readonly maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">秘钥:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="text" value="{$admin.appsecret}" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="text" value="{$admin.appsecret}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与秘钥保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">名称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_name" name="L_name" type="text" value="{$admin.name}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="id" value="{$admin.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/api_admin';
|
||||
if(id == "2") location.href = '/log/api_admin_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function () {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.id = $('#id').val();
|
||||
query.appid = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.name = $('#L_name').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/log/do_api_admin_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/log/api_admin';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
145
application/admin/view/log/index.html
Normal file
145
application/admin/view/log/index.html
Normal file
@ -0,0 +1,145 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">操作日志列表</a>
|
||||
<!--<a href="javascript:;" class="list-two" data-id="2">添加代理</a>-->
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/log/index" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<input type="text" name="username" id="username" placeholder="请输入操作人" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出 excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>操作人</th>
|
||||
<th>操作类型</th>
|
||||
<th>操作描述</th>
|
||||
<th>操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.control}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td>{$vo.control_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$log_list->render()}
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/index';
|
||||
// if(id == "2") location.href = '/agent/agent_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/log/index?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'操作日志列表打印',
|
||||
content: '/log/user_print?startDate='+startDate+'&endDate='+endDate+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
176
application/admin/view/log/scan_admin.html
Normal file
176
application/admin/view/log/scan_admin.html
Normal file
@ -0,0 +1,176 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">用户添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>appid</th>
|
||||
<th>名称</th>
|
||||
<th>备注</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="admin_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.appid}</td>
|
||||
<td>{$vo.name}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td class="td-manage">
|
||||
<a href="/log/scan_admin_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$admin_list->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/scan_admin';
|
||||
if(id == "2") location.href = '/log/scan_admin_add';
|
||||
});
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.scan_admin_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/log/scan_admin_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var status = qs["status"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(status == undefined){
|
||||
status = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'用户列表打印',
|
||||
content: '/log/admin_print?startDate='+startDate+'&endDate='+endDate+'&status='+status+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var status = $('#status').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/log/index?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&status="+status+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
154
application/admin/view/log/scan_admin_add.html
Normal file
154
application/admin/view/log/scan_admin_add.html
Normal file
@ -0,0 +1,154 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">appid:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">名称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_name" name="L_name" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remake" name="L_remake" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/scan_admin';
|
||||
if(id == "2") location.href = '/log/scan_admin_add';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.appid = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.name = $('#L_name').val();
|
||||
query.remake = $('#L_remake').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.appid.length == 0){
|
||||
layer.alert("请填写账号!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length <= 0){
|
||||
layer.alert("请填写密码!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length > 0 && query.pass.length < 6){
|
||||
layer.alert("密码长度为6到16个字符!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
if(query.name.length <= 0){
|
||||
layer.alert("请填写名称!");
|
||||
return false;
|
||||
}
|
||||
// console.log(query);return false;
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/log/do_scan_admin_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/log/scan_admin";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
144
application/admin/view/log/scan_admin_edit.html
Normal file
144
application/admin/view/log/scan_admin_edit.html
Normal file
@ -0,0 +1,144 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">用户列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">用户修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">appid:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$admin.appid}" readonly maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">名称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_name" name="L_name" type="text" value="{$admin.name}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remake" name="L_remake" type="text" maxlength="50" minlength="3" class="required">{$admin.remake}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="scan_admin_id" value="{$admin.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/scan_admin';
|
||||
if(id == "2") location.href = '/log/scan_admin_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function () {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.scan_admin_id = $('#scan_admin_id').val();
|
||||
query.appid = $('#L_username').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.name = $('#L_name').val();
|
||||
query.remake = $('#L_remake').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/log/do_scan_admin_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/log/scan_admin';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
162
application/admin/view/log/user_login.html
Normal file
162
application/admin/view/log/user_login.html
Normal file
@ -0,0 +1,162 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">用户登录日志列表</a>
|
||||
<!--<a href="javascript:;" class="list-two" data-id="2">添加代理</a>-->
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/log/user_login" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<input type="text" name="username" id="username" placeholder="请输入账号" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="remark" id="remark">
|
||||
<option value="" selected>请选择操作类型</option>
|
||||
<option value="登录" <?php if(isset($get['remark']) && $get['remark'] == '登录') {echo 'selected';} ?>>登录</option>
|
||||
<option value="退出登录" <?php if(isset($get['remark']) && $get['remark'] == '退出登录') {echo 'selected';} ?>>退出登录</option>
|
||||
<option value="强制退出登录" <?php if(isset($get['remark']) && $get['remark'] == '强制退出登录') {echo 'selected';} ?>>强制退出登录</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>姓名</th>
|
||||
<th>IP</th>
|
||||
<th>IP所属国家/地区</th>
|
||||
<th>登录客户端</th>
|
||||
<th>操作类型</th>
|
||||
<th>操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.ip}</td>
|
||||
<td>{$vo.ip_location}</td>
|
||||
<td>{$vo.client}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$log_list->render()}
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/log/user_login';
|
||||
// if(id == "2") location.href = '/agent/agent_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var username = qs["username"];
|
||||
var remark = qs["remark"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
if(remark == undefined){
|
||||
remark = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'用户登录日志列表打印',
|
||||
content: '/log/user_login_print?startDate='+startDate+'&endDate='+endDate+'&username='+username+'&remark='+remark,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var username = $('#username').val();
|
||||
var remark = $('#remark').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/log/user_login?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&username="+username+"&remark="+remark;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
34
application/admin/view/log/user_login_print.html
Normal file
34
application/admin/view/log/user_login_print.html
Normal file
@ -0,0 +1,34 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">用户登录列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">账号</th>
|
||||
<th style="text-align: center;">姓名</th>
|
||||
<th style="text-align: center;">IP</th>
|
||||
<th style="text-align: center;">IP所属国家/地区</th>
|
||||
<th style="text-align: center;">登录客户端</th>
|
||||
<th style="text-align: center;">操作类型</th>
|
||||
<th style="text-align: center;">操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.ip}</td>
|
||||
<td>{$vo.ip_location}</td>
|
||||
<td>{$vo.client}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
30
application/admin/view/log/user_print.html
Normal file
30
application/admin/view/log/user_print.html
Normal file
@ -0,0 +1,30 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">操作日志列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">编号</th>
|
||||
<th style="text-align: center;">操作人</th>
|
||||
<th style="text-align: center;">操作类型</th>
|
||||
<th style="text-align: center;">操作描述</th>
|
||||
<th style="text-align: center;">操作时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="log_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.control}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td>{$vo.control_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
80
application/admin/view/login/index.html
Normal file
80
application/admin/view/login/index.html
Normal file
@ -0,0 +1,80 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>后台管理登录</title>
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<link rel="stylesheet" href="/static/admin/css/font.css">
|
||||
<link rel="stylesheet" href="/static/admin/css/xadmin.css">
|
||||
<script type="text/javascript" src="/static/admin/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="/static/admin/js/xadmin.js"></script>
|
||||
|
||||
</head>
|
||||
<body class="login-bg">
|
||||
<div class="login">
|
||||
<div class="message">后台管理登录</div>
|
||||
<div id="darkbannerwrap"></div>
|
||||
|
||||
<form class="layui-form">
|
||||
<input name="admin" placeholder="用户名" type="text" lay-verify="required" class="layui-input username" >
|
||||
<hr class="hr15">
|
||||
<input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input password">
|
||||
<hr class="hr15">
|
||||
<input name="code" class="code" type="text" lay-verify="required" placeholder="验证码" style="width:200px;">
|
||||
<img id="validateCode" src="/login/validateCode" onclick="this.src=this.src+'?'">
|
||||
<hr class="hr15">
|
||||
<input value="登录" class="submit" type="button" lay-submit lay-filter="login" style="width:100%;" >
|
||||
<hr class="hr20" >
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
// 登录
|
||||
$('.submit').click(function(){
|
||||
var query = new Object();
|
||||
query.username = $('.username').val();
|
||||
query.password = $('.password').val();
|
||||
query.code = $('.code').val();
|
||||
|
||||
// 验证
|
||||
if(query.username.length <= 0){
|
||||
layer.msg('用户名不能为空!');
|
||||
return false;
|
||||
}
|
||||
if(query.password.length <= 0){
|
||||
layer.msg('密码不能为空!');
|
||||
return false;
|
||||
}
|
||||
if(query.code.length <= 0){
|
||||
layer.msg('验证码不能为空!');
|
||||
return false;
|
||||
}
|
||||
// 发送后台处理登录
|
||||
$.ajax({
|
||||
url:'/login/do_login',
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
success:function(data){
|
||||
if(data.code == 1){
|
||||
layer.msg(data.msg,{time:1500},function(){
|
||||
location.href = '/';
|
||||
});
|
||||
}else if(data.code == 0){
|
||||
layer.msg(data.msg);
|
||||
$('#validateCode').trigger('click');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// 回车键登录
|
||||
$(document).keydown(function(e){
|
||||
if(e.keyCode == 13) $('.submit').trigger('click');
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
256
application/admin/view/memo/activity.html
Normal file
256
application/admin/view/memo/activity.html
Normal file
@ -0,0 +1,256 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">活动列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">活动添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/memo/activity" method="get">
|
||||
<input type="text" name="title" id="title" placeholder="标题" autocomplete="off" class="layui-input" value="<?php if(isset($get['title'])) {echo $get['title'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="status" id="status">
|
||||
<option value="-1" selected>请选择状态</option>
|
||||
<option value="1" <?php if(isset($get['status']) && $get['status'] == 1) {echo 'selected';} ?>>正常</option>
|
||||
<option value="2" <?php if(isset($get['status']) && $get['status'] == 2) {echo 'selected';} ?>>锁定</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>桌子名称</th>
|
||||
<th>标题</th>
|
||||
<th>url链接</th>
|
||||
<th>内容</th>
|
||||
<th>备注</th>
|
||||
<th>显示位置</th>
|
||||
<th>创建时间</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="memo_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.title}</td>
|
||||
<td>{$vo.url}</td>
|
||||
<td>{$vo.content}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.position}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="td-manage">
|
||||
{if condition="$vo.status == 1"}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="锁定">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">锁定</span>
|
||||
</a>
|
||||
{else}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="解锁">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">解锁</span>
|
||||
</a>
|
||||
{/if}
|
||||
<a href="/memo/activity_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$memo_list->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/activity';
|
||||
if(id == "2") location.href = '/memo/activity_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/*锁定/解锁*/
|
||||
function member_stop(obj, id) {
|
||||
layer.confirm('确认要' + $(obj).attr('title') + '吗?', function (index) {
|
||||
if ($(obj).attr('title') == '锁定') {
|
||||
// 拼装数据发送后台 锁定 会员
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 2;
|
||||
query.status = 0;
|
||||
var result = ajax('/memo/change_status', query);
|
||||
} else {
|
||||
// 拼装数据发送后台 解锁 会员
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 2;
|
||||
query.status = 1;
|
||||
var result = ajax('/memo/change_status', query);
|
||||
}
|
||||
|
||||
// 判断结果 弹出提示
|
||||
if (result.code == 1) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1500});
|
||||
setInterval(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1500});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 2;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/memo/delete',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var title = qs["title"];
|
||||
var status = qs["status"];
|
||||
if(title == undefined){
|
||||
title = '';
|
||||
}
|
||||
if(status == undefined){
|
||||
status = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'活动列表打印',
|
||||
content: '/memo/activity_print?title='+title+'&status='+status,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var title = $('#title').val();
|
||||
var status = $('#status').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/memo/activity?export=1&&title="+title+"&&status="+status;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
180
application/admin/view/memo/activity_add.html
Normal file
180
application/admin/view/memo/activity_add.html
Normal file
@ -0,0 +1,180 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff;}
|
||||
textarea{padding:6px}
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">活动列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">活动添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择桌子:</label>
|
||||
<div class="controls">
|
||||
<select id="L_tablename" name="L_tablename" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<option value="-1" selected>请选择桌子</option>
|
||||
<option value="all" >所有桌子</option>
|
||||
<option value="all_baccarat" >百家乐桌台</option>
|
||||
<option value="all_dt" >龙虎桌台</option>
|
||||
{foreach name="$table_list" item="vo"}
|
||||
<option value="{$vo.id}" <?php if(isset($get['table_id']) && $get['table_id'] == $vo['id']) {echo 'selected';} ?>>{$vo.table_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">活动标题:</label>
|
||||
<div class="controls">
|
||||
<input id="L_title" name="L_title" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">链接地址:</label>
|
||||
<div class="controls">
|
||||
<input id="L_url" name="L_url" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">活动内容:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_content" name="L_content" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remark" name="L_remark" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择活动位置:</label>
|
||||
<div class="controls">
|
||||
<select id="L_position" name="L_position" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<option value="-1" selected>请选择活动位置</option>
|
||||
<option value="1">投注页面</option>
|
||||
<option value="2">现场页面</option>
|
||||
<option value="3">所有页面</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/activity';
|
||||
if(id == "2") location.href = '/memo/activity_add';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.table_id = $('#L_tablename').val();
|
||||
query.title = $('#L_title').val();
|
||||
query.url = $('#L_url').val();
|
||||
query.content = $('#L_content').val();
|
||||
query.remark = $('#L_remark').val();
|
||||
query.position = $('#L_position').val();
|
||||
query.type = 2;
|
||||
|
||||
// 验证数据
|
||||
if(query.table_id == -1){
|
||||
layer.alert("请选择桌子!");
|
||||
return false;
|
||||
}
|
||||
if(query.title.length == 0){
|
||||
layer.alert("请填写活动标题!");
|
||||
return false;
|
||||
}
|
||||
if(query.url.length == 0){
|
||||
layer.alert("请填写活动链接!");
|
||||
return false;
|
||||
}
|
||||
if(query.content.length <= 0){
|
||||
layer.alert("请填写活动内容!");
|
||||
return false;
|
||||
}
|
||||
if(query.position == -1){
|
||||
layer.alert("请选择活动位置!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/memo/do_memo_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/memo/activity";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
134
application/admin/view/memo/activity_edit.html
Normal file
134
application/admin/view/memo/activity_edit.html
Normal file
@ -0,0 +1,134 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff;}
|
||||
textarea{padding:6px}
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">活动列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">活动修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">活动标题:</label>
|
||||
<div class="controls">
|
||||
<input id="L_title" name="L_title" type="text" value="{$memo.title}" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">链接地址:</label>
|
||||
<div class="controls">
|
||||
<input id="L_url" name="L_url" type="text" value="{$memo.url}" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">活动内容:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_content" name="L_content" type="text" value maxlength="50" minlength="3" class="required">{$memo.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remark" name="L_remark" type="text" value maxlength="50" minlength="3" class="required">{$memo.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="memo_id" value="{$memo.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/activity';
|
||||
if(id == "2") location.href = '/memo/activity_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.id = $('#memo_id').val();
|
||||
query.title = $('#L_title').val();
|
||||
query.url = $('#L_url').val();
|
||||
query.content = $('#L_content').val();
|
||||
query.remark = $('#L_remark').val();
|
||||
query.type = 2;
|
||||
|
||||
// 验证数据
|
||||
if(query.title.length == 0){
|
||||
layer.alert("请填写活动标题!");
|
||||
return false;
|
||||
}
|
||||
if(query.content.length <= 0){
|
||||
layer.alert("请填写活动内容!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/memo/do_memo_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/memo/activity";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
42
application/admin/view/memo/activity_print.html
Normal file
42
application/admin/view/memo/activity_print.html
Normal file
@ -0,0 +1,42 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">活动列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">桌子名称</th>
|
||||
<th style="text-align: center;">标题</th>
|
||||
<th style="text-align: center;">url链接</th>
|
||||
<th style="text-align: center;">内容</th>
|
||||
<th style="text-align: center;">备注</th>
|
||||
<th style="text-align: center;">显示位置</th>
|
||||
<th style="text-align: center;">创建时间</th>
|
||||
<th style="text-align: center;">状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="memo_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.title}</td>
|
||||
<td>{$vo.url}</td>
|
||||
<td>{$vo.content}</td>
|
||||
<td>{$vo.position}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td>正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td>锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
267
application/admin/view/memo/memo.html
Normal file
267
application/admin/view/memo/memo.html
Normal file
@ -0,0 +1,267 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">公告列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">公告添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<!--
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/memo/memo" method="get">
|
||||
<input type="text" name="title" id="title" placeholder="标题" autocomplete="off" class="layui-input" value="<?php if(isset($get['title'])) {echo $get['title'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="status" id="status">
|
||||
<option value="-1" selected>请选择状态</option>
|
||||
<option value="1" <?php if(isset($get['status']) && $get['status'] == 1) {echo 'selected';} ?>>正常</option>
|
||||
<option value="2" <?php if(isset($get['status']) && $get['status'] == 2) {echo 'selected';} ?>>锁定</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<span class="layui-btn" id="print">打印</span>
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<!--<th>桌子名称</th>-->
|
||||
<th>标题</th>
|
||||
<!--
|
||||
<th>url链接</th>
|
||||
<th>内容</th>
|
||||
<th>备注</th>
|
||||
<th>显示位置</th>
|
||||
-->
|
||||
<th>创建时间</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="memo_list" item="vo"}
|
||||
<tr>
|
||||
<!--
|
||||
<td>{$vo.table_name}</td>
|
||||
-->
|
||||
<td>{$vo.title}</td>
|
||||
<!--
|
||||
<td>{$vo.url}</td>
|
||||
<td>{$vo.content}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.position}</td>
|
||||
-->
|
||||
<td>{$vo.create_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="td-manage">
|
||||
<!--
|
||||
{if condition="$vo.status == 1"}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="锁定">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">锁定</span>
|
||||
</a>
|
||||
{else}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="解锁">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">解锁</span>
|
||||
</a>
|
||||
{/if}
|
||||
-->
|
||||
<a href="/memo/memo_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$memo_list->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/memo';
|
||||
if(id == "2") location.href = '/memo/memo_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/*锁定/解锁*/
|
||||
function member_stop(obj, id) {
|
||||
layer.confirm('确认要' + $(obj).attr('title') + '吗?', function (index) {
|
||||
if ($(obj).attr('title') == '锁定') {
|
||||
// 拼装数据发送后台 锁定 会员
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 1;
|
||||
query.status = 0;
|
||||
var result = ajax('/memo/change_status', query);
|
||||
} else {
|
||||
// 拼装数据发送后台 解锁 会员
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 1;
|
||||
query.status = 1;
|
||||
var result = ajax('/memo/change_status', query);
|
||||
}
|
||||
|
||||
// 判断结果 弹出提示
|
||||
if (result.code == 1) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1500});
|
||||
setInterval(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1500});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.id = id;
|
||||
query.type = 1;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/memo/delete',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var title = qs["title"];
|
||||
var status = qs["status"];
|
||||
if(title == undefined){
|
||||
title = '';
|
||||
}
|
||||
if(status == undefined){
|
||||
status = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'公告列表打印',
|
||||
content: '/memo/memo_print?title='+title+'&status='+status,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var title = $('#title').val();
|
||||
var status = $('#status').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/memo/memo?export=1&&title="+title+"&&status="+status;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
188
application/admin/view/memo/memo_add.html
Normal file
188
application/admin/view/memo/memo_add.html
Normal file
@ -0,0 +1,188 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff;}
|
||||
textarea{padding:6px}
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">公告列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">公告添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择桌子:</label>
|
||||
<div class="controls">
|
||||
<select id="L_tablename" name="L_tablename" type="text" class="required">
|
||||
<option value="0" selected>请选择桌子</option>
|
||||
<option value="all" >所有桌子</option>
|
||||
<option value="all_baccarat" >百家乐桌台</option>
|
||||
<option value="all_dt" >龙虎桌台</option>
|
||||
<option value="all" >所有桌子</option>
|
||||
{foreach name="$table_list" item="vo"}
|
||||
<option value="{$vo.id}" <?php if(isset($get['table_id']) && $get['table_id'] == $vo['id']) {echo 'selected';} ?>>{$vo.table_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="control-group">
|
||||
<label class="control-label">公告标题:</label>
|
||||
<div class="controls">
|
||||
<input id="L_title" name="L_title" type="text" value maxlength="255" class="required" style="width:500px;">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">链接地址:</label>
|
||||
<div class="controls">
|
||||
<input id="L_url" name="L_url" type="text" value maxlength="250" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">公告内容:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_content" name="L_content" type="text" value maxlength="250" class="required"></textarea>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remark" name="L_remark" type="text" value maxlength="250" class="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择公告位置:</label>
|
||||
<div class="controls">
|
||||
<select id="L_position" name="L_position" type="text" class="required">
|
||||
<option value="-1" selected>请选择公告位置</option>
|
||||
<option value="1">投注页面</option>
|
||||
<option value="2">现场页面</option>
|
||||
<option value="3">所有页面</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/memo';
|
||||
if(id == "2") location.href = '/memo/memo_add';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.title = $('#L_title').val();
|
||||
/*
|
||||
query.table_id = $('#L_tablename').val();
|
||||
query.url = $('#L_url').val();
|
||||
query.content = $('#L_content').val();
|
||||
query.remark = $('#L_remark').val();
|
||||
query.position = $('#L_position').val();
|
||||
*/
|
||||
query.type = 1;
|
||||
if(query.title.length == 0){
|
||||
layer.alert("请填写标题!");
|
||||
return false;
|
||||
}
|
||||
// 验证数据
|
||||
/*
|
||||
if(query.table_id == -1){
|
||||
layer.alert("请选择桌子!");
|
||||
return false;
|
||||
}
|
||||
if(query.url.length == 0){
|
||||
layer.alert("请填写公告链接!");
|
||||
return false;
|
||||
}
|
||||
if(query.content.length == 0){
|
||||
layer.alert("请填写内容!");
|
||||
return false;
|
||||
}
|
||||
if(query.position == -1){
|
||||
layer.alert("请选择公告位置!");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/memo/do_memo_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/memo/memo";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
177
application/admin/view/memo/memo_edit.html
Normal file
177
application/admin/view/memo/memo_edit.html
Normal file
@ -0,0 +1,177 @@
|
||||
{include file="public/header"}
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff;}
|
||||
textarea{padding:6px}
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">公告列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">公告修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择桌子:</label>
|
||||
<div class="controls">
|
||||
<select id="L_tablename" name="L_tablename" type="text" class="required" disabled>
|
||||
<option value="{$table.id}" selected>{$table.table_name}</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="control-group">
|
||||
<label class="control-label">公告标题:</label>
|
||||
<div class="controls">
|
||||
<input id="L_title" name="L_title" type="text" value="{$memo.title}" maxlength="250" class="required" style="width:500px;">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="control-group">
|
||||
<label class="control-label">链接地址:</label>
|
||||
<div class="controls">
|
||||
<input id="L_url" name="L_url" type="text" value="{$memo.url}" maxlength="250" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">公告内容:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_content" name="L_content" type="text" value maxlength="250" class="required">{$memo.content}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注信息:</label>
|
||||
<div class="controls">
|
||||
<textarea id="L_remark" name="L_remark" type="text" value maxlength="250" class="required">{$memo.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">请选择公告位置:</label>
|
||||
<div class="controls">
|
||||
<select id="L_position" name="L_position" type="text" class="required">
|
||||
<option value="-1" selected>请选择公告位置</option>
|
||||
<option value="1" <?php if($memo['position'] == 1) echo 'selected="selected"'; ?>>投注页面</option>
|
||||
<option value="2" <?php if($memo['position'] == 2) echo 'selected="selected"'; ?>>现场页面</option>
|
||||
<option value="3" <?php if($memo['position'] == 3) echo 'selected="selected"'; ?>>所有页面</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="memo_id" value="{$memo.id}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/memo/memo';
|
||||
if(id == "2") location.href = '/memo/memo_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function (data) {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.id = $('#memo_id').val();
|
||||
query.title = $('#L_title').val();
|
||||
/*
|
||||
query.url = $('#L_url').val();
|
||||
query.content = $('#L_content').val();
|
||||
query.remark = $('#L_remark').val();
|
||||
query.position = $('#L_position').val();
|
||||
*/
|
||||
query.type = 1;
|
||||
|
||||
// 验证数据
|
||||
if(query.title.length == 0){
|
||||
layer.alert("请填写标题!");
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
if(query.url.length <= 0){
|
||||
layer.alert("请填写链接地址!");
|
||||
return false;
|
||||
}
|
||||
if(query.content.length <= 0){
|
||||
layer.alert("请填写内容!");
|
||||
return false;
|
||||
}
|
||||
if(query.position == -1){
|
||||
layer.alert("请选择公告位置!");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/memo/do_memo_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/memo/memo";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
42
application/admin/view/memo/memo_print.html
Normal file
42
application/admin/view/memo/memo_print.html
Normal file
@ -0,0 +1,42 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">公告列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">桌子名称</th>
|
||||
<th style="text-align: center;">标题</th>
|
||||
<th style="text-align: center;">url链接</th>
|
||||
<th style="text-align: center;">内容</th>
|
||||
<th style="text-align: center;">备注</th>
|
||||
<th style="text-align: center;">显示位置</th>
|
||||
<th style="text-align: center;">创建时间</th>
|
||||
<th style="text-align: center;">状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="memo_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.title}</td>
|
||||
<td>{$vo.url}</td>
|
||||
<td>{$vo.content}</td>
|
||||
<td>{$vo.position}</td>
|
||||
<td>{$vo.remark}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td>正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td>锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
180
application/admin/view/player/agent_delete.html
Normal file
180
application/admin/view/player/agent_delete.html
Normal file
@ -0,0 +1,180 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="javascript:;">首页</a>
|
||||
<a href="javascript:;">代理管理</a>
|
||||
<a><cite>已删除代理</cite></a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so" action="/agent/agent_delete" method="get">
|
||||
<input class="layui-input" placeholder="开始日" name="start" id="start" value="<?php if(isset($get['start'])) {echo $get['start'];} ?>">
|
||||
<input class="layui-input" placeholder="截止日" name="end" id="end" value="<?php if(isset($get['end'])) {echo $get['end'];} ?>">
|
||||
<input type="text" name="nickname" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['nickname'])) {echo $get['nickname'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
<xblock>
|
||||
<button class="layui-btn layui-btn-danger" onclick="recoverAll()"><i class="layui-icon"></i>批量恢复</button>
|
||||
<!--<button class="layui-btn" onclick="x_admin_show('添加会员','/member/member_add',800,600)"><i-->
|
||||
<!--class="layui-icon"></i>添加-->
|
||||
<!--</button>-->
|
||||
<!--<span class="x-right" style="line-height:40px">共有数据:{$user_del_sum} 条</span>-->
|
||||
</xblock>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">
|
||||
</i></div>
|
||||
</th>
|
||||
<th>ID</th>
|
||||
<th>账号</th>
|
||||
<th>用户名</th>
|
||||
<th>上级代理</th>
|
||||
<th>最近上分</th>
|
||||
<th>商户余额</th>
|
||||
<th>洗码率(%)</th>
|
||||
<th>占成(%)</th>
|
||||
<th>创建日期</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="user_del_list" item="vo"}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-unselect layui-form-checkbox delete-id" lay-skin="primary" user-id='{$vo.id}'><i class="layui-icon"></i></div>
|
||||
</td>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}({$vo.agent_parent_nickname})</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.agent_cs}</td>
|
||||
<td>{$vo.reg_time}</td>
|
||||
<td class="td-manage">
|
||||
<a onclick="agent_recover(this,'{$vo.id}')" href="javascript:;">
|
||||
恢复
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$user_del_list->render()}
|
||||
<!--<div class="page">-->
|
||||
<!--<div>-->
|
||||
<!--<a class="prev" href=""><<</a>-->
|
||||
<!--<a class="num" href="">1</a>-->
|
||||
<!--<span class="current">2</span>-->
|
||||
<!--<a class="num" href="">3</a>-->
|
||||
<!--<a class="num" href="">489</a>-->
|
||||
<!--<a class="next" href="">>></a>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
</div>
|
||||
<script>
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*用户-删除*/
|
||||
function agent_recover(obj, id) {
|
||||
layer.confirm('确认要恢复吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('恢复用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/agent/agent_recover',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* 删除多个会员 */
|
||||
function recoverAll() {
|
||||
layer.confirm('确认要恢复吗?', function () {
|
||||
var user_ids = new Array;
|
||||
$('.delete-id').each(function(){
|
||||
if($(this).hasClass('layui-form-checked')){
|
||||
user_ids.push($(this).attr('user-id'));
|
||||
}
|
||||
});
|
||||
|
||||
// 发送数据给后台进行删除
|
||||
var query = new Object;
|
||||
query.user_ids = JSON.stringify(user_ids);
|
||||
var result = ajax('/agent/agent_recover_more',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1,time:1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
185
application/admin/view/player/baccarat_record.html
Normal file
185
application/admin/view/player/baccarat_record.html
Normal file
@ -0,0 +1,185 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.x-body .layui-form .layui-input-block{display:inline-block; width:150px; margin-left:0; }
|
||||
.x-so input.layui-input{width: 150px;}.layui-input{border: 1px solid #ccc;}
|
||||
.x-so{ margin-bottom:0;background:#f5f5f5;padding:15px 0; border-radius:10px;}
|
||||
.x-body .layui-row{margin-top:-25px;}
|
||||
</style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="baccarat_list actived" data-id="1">百家乐游戏记录</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/baccarat_record" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) echo $get['startDate']; ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) echo $get['endDate']; ?>">
|
||||
<div class="layui-input-block" id="search_table_name">
|
||||
<select name="table_id" lay-filter="table_name" lay-search>
|
||||
<option value="" selected>桌台</option>
|
||||
{volist name="table_list" id="vo"}
|
||||
<option value="{$vo.id}" <?php if( isset($get['table_id']) && $get['table_id'] == $vo['id']) echo 'selected="selected"'; ?> >{$vo.table_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<input class="layui-input" placeholder="账号" name="username" value="<?php if(isset($get['username'])) echo $get['username']; ?>" lay-key="">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>玩家账号</th>
|
||||
<th>代理</th>
|
||||
<th>游戏桌台</th>
|
||||
<th>局号</th>
|
||||
<th>结果</th>
|
||||
<th>庄下注额</th>
|
||||
<th>闲下注额</th>
|
||||
<th>和下注额</th>
|
||||
<th>庄对下注额</th>
|
||||
<th>闲对下注额</th>
|
||||
<th>输赢</th>
|
||||
<th>可洗码值</th>
|
||||
<th>下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $isData eq true}
|
||||
{foreach name="baccarat_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{$vo.agent_parent_username}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}{$vo.pair}</td>
|
||||
<td>{$vo.banker_amount}</td>
|
||||
<td>{$vo.player_amount}</td>
|
||||
<td>{$vo.tie_amount}</td>
|
||||
<td>{$vo.banker_pair_amount}</td>
|
||||
<td>{$vo.player_pair_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{if $vo.maliang neq ''}{$vo.maliang}{else}0.00{/if}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="13" style="text-align: center;">当日暂无数据</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
{$baccarat_list->render()}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/baccarat_record';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
// 打印数据
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var table_id = qs["table_id"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '百家乐游戏记录打印',
|
||||
content: '/player/baccarat_record_print?startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var table_id = $('#table_id').val();
|
||||
var username = $('#username').val();
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = '/player/baccarat_record?export=1&startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
46
application/admin/view/player/baccarat_record_print.html
Normal file
46
application/admin/view/player/baccarat_record_print.html
Normal file
@ -0,0 +1,46 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">百家乐游戏记录</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">玩家账号</th>
|
||||
<th style="text-align: center;">代理</th>
|
||||
<th style="text-align: center;">游戏桌台</th>
|
||||
<th style="text-align: center;">局号</th>
|
||||
<th style="text-align: center;">结果</th>
|
||||
<th style="text-align: center;">庄下注额</th>
|
||||
<th style="text-align: center;">闲下注额</th>
|
||||
<th style="text-align: center;">和下注额</th>
|
||||
<th style="text-align: center;">庄对下注额</th>
|
||||
<th style="text-align: center;">闲对下注额</th>
|
||||
<th style="text-align: center;">输赢</th>
|
||||
<th style="text-align: center;">可洗码值</th>
|
||||
<th style="text-align: center;">下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="baccarat_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{$vo.agent_parent_username}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}{$vo.pair}</td>
|
||||
<td>{$vo.banker_amount}</td>
|
||||
<td>{$vo.player_amount}</td>
|
||||
<td>{$vo.tie_amount}</td>
|
||||
<td>{$vo.banker_pair_amount}</td>
|
||||
<td>{$vo.player_pair_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.maliang}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
182
application/admin/view/player/dt_record.html
Normal file
182
application/admin/view/player/dt_record.html
Normal file
@ -0,0 +1,182 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.x-body .layui-form .layui-input-block{display:inline-block; width:150px; margin-left:0; }
|
||||
.x-so input.layui-input{width: 150px;}
|
||||
.layui-input{border: 1px solid #ccc;}
|
||||
.x-so{ margin-bottom:0;background:#f5f5f5;padding:15px 0; border-radius:10px;}
|
||||
.x-body .layui-row{margin-top:-25px;}
|
||||
</style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="dt_list actived" data-id="1">龙虎斗游戏记录</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/dt_record" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) echo $get['startDate']; ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) echo $get['endDate']; ?>">
|
||||
<div class="layui-input-block" id="search_table_name">
|
||||
<select name="table_id" lay-search>
|
||||
<option value="" selected>桌台</option>
|
||||
{volist name="table_list" id="vo"}
|
||||
<option value="{$vo.id}" <?php if( isset($get['table_id']) && $get['table_id'] == $vo['id']) echo 'selected="selected"'; ?> >{$vo.table_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<input class="layui-input" placeholder="账号" name="username" id="username" value="<?php if(isset($get['username'])) echo $get['username']; ?>" lay-key="">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>玩家账号</th>
|
||||
<th>代理</th>
|
||||
<th>游戏桌台</th>
|
||||
<th>局号</th>
|
||||
<th>结果</th>
|
||||
<th>龙下注额</th>
|
||||
<th>虎下注额</th>
|
||||
<th>和下注额</th>
|
||||
<th>输赢</th>
|
||||
<th>下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $isData eq true}
|
||||
{foreach name="dt_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{if $vo.agent_parent_username neq ''}{$vo.agent_parent_username}{/if}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}</td>
|
||||
<td>{$vo.banker_amount}</td>
|
||||
<td>{$vo.player_amount}</td>
|
||||
<td>{$vo.tie_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="11" style="text-align: center;">当日暂无数据</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
{$dt_list->render()}
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/dt_record';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
// 打印数据
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var table_id = qs["table_id"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '龙虎斗游戏记录打印',
|
||||
content: '/player/dt_record_print?startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
// 获取参数
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var table_id = $('#table_name').val();
|
||||
var username = $('#username').val();
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = '/player/dt_record?export=1&startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
40
application/admin/view/player/dt_record_print.html
Normal file
40
application/admin/view/player/dt_record_print.html
Normal file
@ -0,0 +1,40 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">龙虎斗游戏记录</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">玩家账号</th>
|
||||
<th style="text-align: center;">代理</th>
|
||||
<th style="text-align: center;">游戏桌台</th>
|
||||
<th style="text-align: center;">局号</th>
|
||||
<th style="text-align: center;">结果</th>
|
||||
<th style="text-align: center;">龙下注额</th>
|
||||
<th style="text-align: center;">虎下注额</th>
|
||||
<th style="text-align: center;">和下注额</th>
|
||||
<th style="text-align: center;">输赢</th>
|
||||
<th style="text-align: center;">下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="dt_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{if $vo.agent_parent_username neq ''}{$vo.agent_parent_username}{/if}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}</td>
|
||||
<td>{$vo.banker_amount}</td>
|
||||
<td>{$vo.player_amount}</td>
|
||||
<td>{$vo.tie_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
363
application/admin/view/player/index.html
Executable file
363
application/admin/view/player/index.html
Executable file
@ -0,0 +1,363 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:40%; border-left:none; text-align:right;}
|
||||
.alert-main td{border-right:none; }
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">玩家列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">玩家添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/index" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="status" id="status">
|
||||
<option value="-1" >请选择玩家状态</option>
|
||||
<option value="1" <?php if(isset($get['status']) && $get['status'] == 1) {echo 'selected';} ?>>正常</option>
|
||||
<option value="2" <?php if(isset($get['status']) && $get['status'] == 2) {echo 'selected';} ?>>锁定</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<input type="text" name="agent_parent" id="agent_parent" placeholder="请输入上级代理" autocomplete="off" class="layui-input" value="<?php if(isset($get['agent_parent'])) {echo $get['agent_parent'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>联系人</th>
|
||||
<th>手机</th>
|
||||
<th>邮箱</th>
|
||||
<th>上级代理</th>
|
||||
<th>投注方式</th>
|
||||
<th>最近上分</th>
|
||||
<th>商户余额</th>
|
||||
<th>百家乐码率(%)</th>
|
||||
<th>龙虎码率(%)</th>
|
||||
<th>总下注</th>
|
||||
<th>总赢</th>
|
||||
<th>码量</th>
|
||||
<th>日赢上限</th>
|
||||
<th>赔率</th>
|
||||
<th>创建日期</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.mobile}</td>
|
||||
<td>{$vo.email}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>{$vo.bet_type}</td>
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.agent_ximalv_dt}</td>
|
||||
<td>{$vo.all_bet_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.maliang}</td>
|
||||
<td>{$vo.win_limit}</td>
|
||||
<th>
|
||||
<a href="javascript:;" onclick="showPrice(this)" price-username="{$vo.username}" price-banker="{$vo.price_banker}" price-player="{$vo.price_player}" price-tie-baccarat="{$vo.price_tie_baccarat}" price-pair="{$vo.price_pair}" price-dragon="{$vo.price_dragon}" price-tiger="{$vo.price_tiger}" price-tie-dt="{$vo.price_tie_dt}" price-n7-n9="{$vo.price_n7_n9}" price-nn="{$vo.price_nn}" price-5n="{$vo.price_5n}" price-bomb="{$vo.price_bomb}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" >查看</span>
|
||||
</a>
|
||||
</th>
|
||||
<td style="width:80px;">{$vo.reg_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">正常</span>
|
||||
</td>
|
||||
{else}
|
||||
<td class="td-status">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">锁定中</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="td-manage">
|
||||
{if condition="$vo.status == 1"}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="锁定">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">锁定</span>
|
||||
</a>
|
||||
{else}
|
||||
<a onclick="member_stop(this,'{$vo.id}')" href="javascript:;" title="解锁">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">解锁</span>
|
||||
</a>
|
||||
{/if}
|
||||
<a href="/player/player_edit?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">修改</span>
|
||||
</a>
|
||||
<a onclick="member_del(this,'{$vo.id}')" href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#ff5050;">删除</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$agent_list->render()}
|
||||
</div>
|
||||
<div class="alert" id="alert_price">
|
||||
<div class="alert-title" id="show_price_username"></div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th>押庄赔率:</th><td id="show_price_banker"></td></tr>
|
||||
<tr><th>押闲赔率:</th><td id="show_price_player"></td></tr>
|
||||
<tr><th>押和赔率(百家乐):</th><td id="show_price_tie_baccarat"></td></tr>
|
||||
<tr><th>押对子赔率:</th><td id="show_price_pair"></td></tr>
|
||||
<tr><th>押龙赔率:</th><td id="show_price_dragon"></td></tr>
|
||||
<tr><th>押虎赔率:</th><td id="show_price_tiger"></td></tr>
|
||||
<tr><th>押和赔率(龙虎斗):</th><td id="show_price_tie_dt"></td></tr>
|
||||
<tr><th>押牛7-牛9赔率:</th><td id="show_price_n7_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率:</th><td id="show_price_nn"></td></tr>
|
||||
<tr><th>押五公赔率:</th><td id="show_price_5n"></td></tr>
|
||||
<tr><th>押四条赔率:</th><td id="show_price_bomb"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hiddenForm('alert_price')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/*用户-锁定/解锁*/
|
||||
function member_stop(obj, id) {
|
||||
layer.confirm('确认要' + $(obj).attr('title') + '吗?', function (index) {
|
||||
if ($(obj).attr('title') == '锁定') {
|
||||
// 拼装数据发送后台 锁定 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 0;
|
||||
var result = ajax('/player/change_status', query);
|
||||
} else {
|
||||
// 拼装数据发送后台 解锁 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 1;
|
||||
var result = ajax('/player/change_status', query);
|
||||
}
|
||||
|
||||
// 判断结果 弹出提示
|
||||
if (result.code == 1) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1500});
|
||||
setInterval(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1500});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/player/player_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var status = qs["status"];
|
||||
var username = qs["username"];
|
||||
var agent_parent = qs["agent_parent"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(status == undefined){
|
||||
status = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
if(agent_parent == undefined){
|
||||
agent_parent = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'玩家列表打印',
|
||||
content: '/player/player_print?startDate='+startDate+'&endDate='+endDate+'&status='+status+'&username='+username+'&agent_parent='+agent_parent,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var status = $('#status').val();
|
||||
var agent_parent = $('#agent_parent').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/player/index?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&status="+status+"&&agent_parent="+agent_parent+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
|
||||
// 显示用户的赔率
|
||||
function showPrice(obj){
|
||||
// 获取赔率数据
|
||||
var price_username = $(obj).attr('price-username');
|
||||
var price_banker = $(obj).attr('price-banker');
|
||||
var price_player = $(obj).attr('price-player');
|
||||
var price_tie_baccarat = $(obj).attr('price-tie-baccarat');
|
||||
var price_pair = $(obj).attr('price-pair');
|
||||
var price_dragon = $(obj).attr('price-dragon');
|
||||
var price_tiger = $(obj).attr('price-tiger');
|
||||
var price_tie_dt = $(obj).attr('price-tie-dt');
|
||||
var price_n7_n9 = $(obj).attr('price-n7-n9');
|
||||
var price_nn = $(obj).attr('price-nn');
|
||||
var price_5n = $(obj).attr('price-5n');
|
||||
var price_bomb = $(obj).attr('price-bomb');
|
||||
|
||||
// 显示赔率数据
|
||||
$('#show_price_username').html(price_username+" 的赔率");
|
||||
$('#show_price_banker').html(price_banker);
|
||||
$('#show_price_player').html(price_player);
|
||||
$('#show_price_tie_baccarat').html(price_tie_baccarat);
|
||||
$('#show_price_pair').html(price_pair);
|
||||
$('#show_price_dragon').html(price_dragon);
|
||||
$('#show_price_tiger').html(price_tiger);
|
||||
$('#show_price_tie_dt').html(price_tie_dt);
|
||||
$('#show_price_n7_n9').html(price_n7_n9);
|
||||
$('#show_price_nn').html(price_nn);
|
||||
$('#show_price_5n').html(price_5n);
|
||||
$('#show_price_bomb').html(price_bomb);
|
||||
|
||||
$('#alert_price').show();
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#' + id).hide();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
268
application/admin/view/player/nn_record.html
Normal file
268
application/admin/view/player/nn_record.html
Normal file
@ -0,0 +1,268 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<style type="text/css">
|
||||
textarea, input[type="text"], input[type="password"],.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.x-body .layui-form .layui-input-block{display:inline-block; width:150px; margin-left:0; }
|
||||
.x-so input.layui-input{width: 150px;}
|
||||
.layui-input{border: 1px solid #ccc;}
|
||||
.x-so{ margin-bottom:0;background:#f5f5f5;padding:15px 0; border-radius:10px;}
|
||||
.x-body .layui-row{margin-top:-25px;}
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:25%; border-left:none; text-align:right;}
|
||||
.alert-main td{width:25%;}
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="dt_list actived" data-id="1">牛牛游戏记录</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/nn_record" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) echo $get['startDate']; ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) echo $get['endDate']; ?>">
|
||||
<div class="layui-input-block" id="search_table_name">
|
||||
<select name="table_id" lay-search>
|
||||
<option value="" selected>桌台</option>
|
||||
{volist name="table_list" id="vo"}
|
||||
<option value="{$vo.id}" <?php if( isset($get['table_id']) && $get['table_id'] == $vo['id']) echo 'selected="selected"'; ?> >{$vo.table_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<input class="layui-input" placeholder="账号" name="username" id="username" value="<?php if(isset($get['username'])) echo $get['username']; ?>" lay-key="">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<!-- <span class="layui-btn" id="print">打印</span> -->
|
||||
</form>
|
||||
</div>
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>玩家账号</th>
|
||||
<th>代理</th>
|
||||
<th>游戏桌台</th>
|
||||
<th>局号</th>
|
||||
<th>结果</th>
|
||||
<th>下注详情</th>
|
||||
<th>总下注额</th>
|
||||
<th>输赢</th>
|
||||
<th>下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $isData eq true}
|
||||
{foreach name="nn_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{if $vo.agent_parent_username neq ''}{$vo.agent_parent_username}{/if}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}</td>
|
||||
<td>
|
||||
<a href="javascript:;" onclick="showBet(this)" amount_player_1="{$vo.amount_player_1}" amount_player_1_times="{$vo.amount_player_1_times}" amount_player_1_banker="{$vo.amount_player_1_banker}" amount_player_1_banker_times="{$vo.amount_player_1_banker_times}" amount_player_2="{$vo.amount_player_2}" amount_player_2_times="{$vo.amount_player_2_times}" amount_player_2_banker="{$vo.amount_player_2_banker}" amount_player_2_banker_times="{$vo.amount_player_2_banker_times}" amount_player_3="{$vo.amount_player_3}" amount_player_3_times="{$vo.amount_player_3_times}" amount_player_3_banker="{$vo.amount_player_3_banker}" amount_player_3_banker_times="{$vo.amount_player_3_banker_times}">
|
||||
<span class="layui-btn layui-btn-mini" style="background:#009688;" >查看</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>{$vo.amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="11" style="text-align: center;">当日暂无数据</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert" id="bet_info">
|
||||
<div class="alert-title">下注详情</div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr>
|
||||
<th>闲一平倍:</th>
|
||||
<td id="amount_player_1"></td>
|
||||
<th>闲一翻倍:</th>
|
||||
<td id="amount_player_1_times"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>闲一庄平倍:</th>
|
||||
<td id="amount_player_1_banker"></td>
|
||||
<th>闲一庄翻倍:</th>
|
||||
<td id="amount_player_1_banker_times"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>闲二平倍:</th>
|
||||
<td id="amount_player_2"></td>
|
||||
<th>闲二翻倍:</th>
|
||||
<td id="amount_player_2_times"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>闲二庄平倍:</th>
|
||||
<td id="amount_player_2_banker"></td>
|
||||
<th>闲二庄翻倍:</th>
|
||||
<td id="amount_player_2_banker_times"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>闲三平倍:</th>
|
||||
<td id="amount_player_3"></td>
|
||||
<th>闲三翻倍:</th>
|
||||
<td id="amount_player_3_times"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>闲三庄平倍:</th>
|
||||
<td id="amount_player_3_banker"></td>
|
||||
<th>闲三庄翻倍:</th>
|
||||
<td id="amount_player_3_banker_times"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hiddenForm('bet_info')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/dn_record';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
// 打印数据
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var table_id = qs["table_id"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '牛牛游戏记录打印',
|
||||
content: '/player/nn_record_print?startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var table_id = $('#table_id').val();
|
||||
var username = $('#username').val();
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(table_id == undefined){
|
||||
table_id = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = '/player/nn_record?export=1&startDate='+startDate+'&endDate='+endDate+'&table_id='+table_id+'&username='+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
// 显示用户的下注详情
|
||||
function showBet(obj){
|
||||
// 获取赔率数据
|
||||
var amount_player_1 = $(obj).attr('amount_player_1');
|
||||
var amount_player_1_times = $(obj).attr('amount_player_1_times');
|
||||
var amount_player_1_banker = $(obj).attr('amount_player_1_banker');
|
||||
var amount_player_1_banker_times = $(obj).attr('amount_player_1_banker_times');
|
||||
|
||||
var amount_player_2 = $(obj).attr('amount_player_2');
|
||||
var amount_player_2_times = $(obj).attr('amount_player_2_times');
|
||||
var amount_player_2_banker = $(obj).attr('amount_player_2_banker');
|
||||
var amount_player_2_banker_times = $(obj).attr('amount_player_2_banker_times');
|
||||
|
||||
var amount_player_3 = $(obj).attr('amount_player_3');
|
||||
var amount_player_3_times = $(obj).attr('amount_player_3_times');
|
||||
var amount_player_3_banker = $(obj).attr('amount_player_3_banker');
|
||||
var amount_player_3_banker_times = $(obj).attr('amount_player_3_banker_times');
|
||||
|
||||
$('#amount_player_1').html(amount_player_1);
|
||||
$('#amount_player_1_times').html(amount_player_1_times);
|
||||
$('#amount_player_1_banker').html(amount_player_1_banker);
|
||||
$('#amount_player_1_banker_times').html(amount_player_1_banker_times);
|
||||
$('#amount_player_2').html(amount_player_2);
|
||||
$('#amount_player_2_times').html(amount_player_2_times);
|
||||
$('#amount_player_2_banker').html(amount_player_2_banker);
|
||||
$('#amount_player_2_banker_times').html(amount_player_2_banker_times);
|
||||
$('#amount_player_3').html(amount_player_3);
|
||||
$('#amount_player_3_times').html(amount_player_3_times);
|
||||
$('#amount_player_3_banker').html(amount_player_3_banker);
|
||||
$('#amount_player_3_banker_times').html(amount_player_3_banker_times);
|
||||
$('#bet_info').show();
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#' + id).hide();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
36
application/admin/view/player/nn_record_print.html
Normal file
36
application/admin/view/player/nn_record_print.html
Normal file
@ -0,0 +1,36 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">牛牛游戏记录</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">玩家账号</th>
|
||||
<th style="text-align: center;">代理</th>
|
||||
<th style="text-align: center;">游戏桌台</th>
|
||||
<th style="text-align: center;">局号</th>
|
||||
<th style="text-align: center;">结果</th>
|
||||
<th style="text-align: center;">总下注额</th>
|
||||
<th style="text-align: center;">输赢</th>
|
||||
<th style="text-align: center;">下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="nn_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.user_nickname}</td>
|
||||
<td>{if $vo.agent_parent_username neq ''}{$vo.agent_parent_username}{/if}</td>
|
||||
<td>{$vo.table_name}</td>
|
||||
<td>{$vo.record_num}</td>
|
||||
<td>{$vo.result}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
411
application/admin/view/player/player-add.html
Executable file
411
application/admin/view/player/player-add.html
Executable file
@ -0,0 +1,411 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">玩家列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">玩家添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">上级代理:</label>
|
||||
<div class="controls">
|
||||
<select name="parent_agent" id="parent_agent">
|
||||
<option value="0">无</option>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<option value="{$vo.id}">{$vo.username}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 将会成为您唯一的登入名</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" value maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 6到16个字符</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 与密码保持一致</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占成(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value="0" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 无上级代理最高不能超过100% </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" value maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1">网络投注</option>
|
||||
<option value="2">电话投注</option>
|
||||
<option value="3">所有投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="0.95" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="1" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="0.97" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="2" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="3" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="5" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="4.85" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="0" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_add';
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
|
||||
$('.submit').click( function(){
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.parent_agent_id = $('#parent_agent').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.username.length == 0){
|
||||
layer.alert("请填写账号!");
|
||||
return false;
|
||||
}
|
||||
if(query.nickname.length == 0){
|
||||
layer.alert("请填写昵称!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length <= 0){
|
||||
layer.alert("请填写密码!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass.length > 0 && query.pass.length < 6){
|
||||
layer.alert("密码长度为6到16个字符!");
|
||||
return false;
|
||||
}
|
||||
if(query.pass != query.repass){
|
||||
layer.alert("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv >= 100){
|
||||
layer.alert("洗码率最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.ximalv_dt >= 100){
|
||||
layer.alert("洗码率最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.cs > 100){
|
||||
layer.alert("占成最高不能超过100%!");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_pair <= 0){
|
||||
layer.alert("押对子赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/player/do_player_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/player/index";
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
389
application/admin/view/player/player-edit.html
Executable file
389
application/admin/view/player/player-edit.html
Executable file
@ -0,0 +1,389 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">代理列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">玩家修改</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">上级代理:</label>
|
||||
<div class="controls">
|
||||
<input id="L_parent_agent" name="L_parent_agent" type="text" value="{$parent_agent.username}" maxlength="50" minlength="3" class="required" readonly>
|
||||
<span class="help-inline">
|
||||
<font color="red"> </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls">
|
||||
<input id="L_username" name="L_username" type="text" value="{$player.username}" readonly maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">昵称:</label>
|
||||
<div class="controls">
|
||||
<input id="L_nickname" name="L_nickname" type="text" value="{$player.nickname}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_pass" name="L_pass" type="password" maxlength="50" minlength="3" class="required">
|
||||
<span class="help-inline">
|
||||
<font color="red"> * 不填密码默认不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">确认密码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_repass" name="L_repass" type="password" value maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 不填密码默认不修改</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">手机号码:</label>
|
||||
<div class="controls">
|
||||
<input id="L_mobile" name="L_mobile" type="text" value="{$player.mobile}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">邮箱:</label>
|
||||
<div class="controls">
|
||||
<input id="L_email" name="L_email" type="text" value="{$player.email}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">百家乐码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv" name="L_ximalv" type="text" value="{$player.agent_ximalv}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">龙虎码率(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="{$player.agent_ximalv_dt}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv_dt}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">占成(%):</label>
|
||||
<div class="controls">
|
||||
<input id="L_cs" name="L_cs" type="text" value="{$player.agent_cs}" maxlength="50" minlength="3" class="required"><span class="help-inline">
|
||||
<font color="red"> * 洗码率不能超过{$parent_agent.agent_cs}%</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最低限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_low" name="limit_low" type="text" maxlength="10" class="required" value="{$player.limit_low}"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">最高限红:</label>
|
||||
<div class="controls">
|
||||
<input id="limit_high" name="limit_high" type="text" maxlength="10" class="required" value="{$player.limit_high}"><span class="help-inline">
|
||||
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">投注方式:</label>
|
||||
<div class="controls">
|
||||
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
|
||||
<option value="0">请选择投注方式</option>
|
||||
<option value="1" <?php if($player['bet_type'] == 1) {echo 'selected';} ?>>网络投注</option>
|
||||
<option value="2" <?php if($player['bet_type'] == 2) {echo 'selected';} ?>>电话投注</option>
|
||||
<option value="3" <?php if($player['bet_type'] == 3) {echo 'selected';} ?>>所有投注</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<font color="red"> *</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押庄赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_banker" name="price_banker" type="text" value="{$player.price_banker}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押闲赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_player" name="price_player" type="text" value="{$player.price_player}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_baccarat" name="price_tie_baccarat" type="text" value="{$player.price_tie_baccarat}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押对子赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_pair" name="price_pair" type="text" value="8" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 百家乐 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押龙赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_dragon" name="price_dragon" type="text" value="{$player.price_dragon}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押虎赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tiger" name="price_tiger" type="text" value="{$player.price_tiger}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押和赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_tie_dt" name="price_tie_dt" type="text" value="{$player.price_tie_dt}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 龙虎斗 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛7-牛9赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_n7_n9" name="price_n7_n9" type="text" value="{$player.price_n7_n9}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押牛牛赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_nn" name="price_nn" type="text" value="{$player.price_nn}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押五公赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_5n" name="price_5n" type="text" value="{$player.price_5n}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">押四条赔率:</label>
|
||||
<div class="controls">
|
||||
<input id="price_bomb" name="price_bomb" type="text" value="{$player.price_bomb}" maxlength="10" class="required"><span class="help-inline">
|
||||
<font color="red"> * 牛牛 </font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">日赢上限:</label>
|
||||
<div class="controls">
|
||||
<input id="win_limit" name="win_limit" type="text" value="{$player.win_limit}" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
|
||||
<font color="red"> * 默认0则为没有限制</font>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="player-id" value="{$player.id}">
|
||||
<input type="hidden" id="parent-ximalv" value="{$parent_agent.agent_ximalv}">
|
||||
<input type="hidden" id="parent-ximalv-dt" value="{$parent_agent.agent_ximalv_dt}">
|
||||
<input type="hidden" id="parent-cs" value="{$parent_agent.agent_cs}">
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/player/index';
|
||||
if(id == "2") location.href = '/player/player_edit';
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function () {
|
||||
|
||||
// 获取和拼装添加代理的数据
|
||||
var limit_checkout = new Array();
|
||||
var query = new Object();
|
||||
query.player_id = $('#player-id').val();
|
||||
query.username = $('#L_username').val();
|
||||
query.nickname = $('#L_nickname').val();
|
||||
query.pass = $('#L_pass').val();
|
||||
query.repass = $('#L_repass').val();
|
||||
query.mobile = $('#L_mobile').val();
|
||||
query.email = $('#L_email').val();
|
||||
query.ximalv = $('#L_ximalv').val();
|
||||
query.ximalv_dt = $('#L_ximalv_dt').val();
|
||||
query.cs = $('#L_cs').val();
|
||||
query.bet_type = $('#L_bet_type').val();
|
||||
var parent_ximalv = $('#parent-ximalv').val();
|
||||
var parent_ximalv_dt = $('#parent-ximalv-dt').val();
|
||||
var parent_cs = $('#parent-cs').val();
|
||||
query.limit_low = $('#limit_low').val();
|
||||
query.limit_high = $('#limit_high').val();
|
||||
query.price_banker = $('#price_banker').val();
|
||||
query.price_player = $('#price_player').val();
|
||||
query.price_tie_baccarat = $('#price_tie_baccarat').val();
|
||||
query.price_pair = $('#price_pair').val();
|
||||
query.price_dragon = $('#price_dragon').val();
|
||||
query.price_tiger = $('#price_tiger').val();
|
||||
query.price_tie_dt = $('#price_tie_dt').val();
|
||||
query.price_n7_n9 = $('#price_n7_n9').val();
|
||||
query.price_nn = $('#price_nn').val();
|
||||
query.price_5n = $('#price_5n').val();
|
||||
query.price_bomb = $('#price_bomb').val();
|
||||
query.win_limit = $('#win_limit').val();
|
||||
|
||||
// 验证数据
|
||||
if(query.pass.length > 0){
|
||||
if(query.pass.length >= 6){
|
||||
if(query.pass != query.repass){
|
||||
layer.msg("两次密码不一致!");
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
layer.msg("密码不能少于6位字符!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(parseFloat(query.ximalv) > parseFloat(parent_ximalv) || parseFloat(query.ximalv_dt) > parseFloat(parent_ximalv_dt)){
|
||||
layer.msg("码率不能超过父级码率");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.cs) > parseFloat(parent_cs)){
|
||||
layer.msg("占成不能超过父级占成");
|
||||
return false;
|
||||
}
|
||||
if(query.bet_type <= 0){
|
||||
layer.alert("请选择投注方式");
|
||||
return false;
|
||||
}
|
||||
if(query.price_banker <= 0){
|
||||
layer.alert("押庄赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_player <= 0){
|
||||
layer.alert("押闲赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_baccarat <= 0){
|
||||
layer.alert("押和(百家乐)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_dragon <= 0){
|
||||
layer.alert("押龙赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tiger <= 0){
|
||||
layer.alert("押虎赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_tie_dt <= 0){
|
||||
layer.alert("押和(龙虎斗)赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_n7_n9 <= 0){
|
||||
layer.alert("押牛7-牛9赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_nn <= 0){
|
||||
layer.alert("押牛牛赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_5n <= 0){
|
||||
layer.alert("押五公赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.price_bomb <= 0){
|
||||
layer.alert("押四条赔率必须大于0");
|
||||
return false;
|
||||
}
|
||||
if(query.win_limit.length <= 0){
|
||||
layer.alert("日赢上限不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/player/do_player_edit',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = '/player/index';
|
||||
});
|
||||
}else{
|
||||
layer.msg(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
56
application/admin/view/player/player_print.html
Normal file
56
application/admin/view/player/player_print.html
Normal file
@ -0,0 +1,56 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">玩家列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">用户名</th>
|
||||
<th style="text-align: center;">联系人</th>
|
||||
<th style="text-align: center;">手机</th>
|
||||
<th style="text-align: center;">邮箱</th>
|
||||
<th style="text-align: center;">上级代理</th>
|
||||
<th style="text-align: center;">代理类型</th>
|
||||
<th style="text-align: center;">最近上分</th>
|
||||
<th style="text-align: center;">商户余额</th>
|
||||
<th style="text-align: center;">洗码率(%)</th>
|
||||
<th style="text-align: center;">总下注</th>
|
||||
<th style="text-align: center;">总赢</th>
|
||||
<th style="text-align: center;">码量</th>
|
||||
<th style="text-align: center;">创建日期</th>
|
||||
<th style="text-align: center;">状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="agent_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.nickname}</td>
|
||||
<td>{$vo.mobile}</td>
|
||||
<td>{$vo.email}</td>
|
||||
{if condition="$vo.agent_parent_id > 0"}
|
||||
<td>{$vo.agent_parent_username}({$vo.agent_parent_nickname})</td>
|
||||
{else}
|
||||
<td>无</td>
|
||||
{/if}
|
||||
<td>玩家</td>
|
||||
<td>{$vo.last_recharge}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>{$vo.agent_ximalv}</td>
|
||||
<td>{$vo.all_bet_amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.maliang}</td>
|
||||
<td style="width:80px;">{$vo.reg_time}</td>
|
||||
{if condition="$vo.status == 1"}
|
||||
<td>正常</td>
|
||||
{else}
|
||||
<td>锁定中</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
254
application/admin/view/player/scores.html
Normal file
254
application/admin/view/player/scores.html
Normal file
@ -0,0 +1,254 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:12px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">玩家上下分记录列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">玩家上下分记录添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/scores" method="get">
|
||||
<input class="layui-input" placeholder="开始时间" name="startDate" id="start" value="<?php if(isset($get['startDate'])) {echo $get['startDate'];} ?>">
|
||||
<input class="layui-input" placeholder="结束时间" name="endDate" id="end" value="<?php if(isset($get['endDate'])) {echo $get['endDate'];} ?>">
|
||||
<div class="layui-input-block" >
|
||||
<select name="mode" id="mode">
|
||||
<option value="-1" selected>请选择操作类型</option>
|
||||
<option value="1" <?php if(isset($get['mode']) && $get['mode'] == 1) {echo 'selected';} ?>>上分</option>
|
||||
<option value="2" <?php if(isset($get['mode']) && $get['mode'] == 2) {echo 'selected';} ?>>下分</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
<span class="layui-btn" id="export">导出excel</span>
|
||||
<span class="layui-btn" id="print">打印</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>联系人</th>
|
||||
<th>代理类型</th>
|
||||
<th>操作类型</th>
|
||||
<th>操作金额</th>
|
||||
<th>操作人</th>
|
||||
<th>余额</th>
|
||||
<th>创建日期</th>
|
||||
<th>备注</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="scoresList" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username_for}</td>
|
||||
<td>{$vo.nickname_for}</td>
|
||||
<td>{$vo.user_agent_level}</td>
|
||||
{if condition="$vo.mode == 1"}
|
||||
<td style="color:#ff5050;">{$vo.mode_msg}</td>
|
||||
<td style="color:#ff5050;">{$vo.amount}</td>
|
||||
{else}
|
||||
<td style="color:#009688;">{$vo.mode_msg}</td>
|
||||
<td style="color:#009688;">{$vo.amount}</td>
|
||||
{/if}
|
||||
<td>{$vo.admin_user_name}</td>
|
||||
<td>{$vo.new_money}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
<td class="td-manage">
|
||||
<a href="/player/scores_add_show?id={$vo.id}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini">查看</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$scoresList->render()}
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == 1) location.href = '/player/scores';
|
||||
if(id == 2) location.href = '/player/scores_add';
|
||||
});
|
||||
// 时间选择器
|
||||
layui.use('laydate', function () {
|
||||
var laydate = layui.laydate;
|
||||
|
||||
// 开始时间
|
||||
laydate.render({
|
||||
elem: '#start',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 结束时间
|
||||
laydate.render({
|
||||
elem: '#end',
|
||||
type: 'datetime'
|
||||
});
|
||||
});
|
||||
|
||||
/*用户-锁定/解锁*/
|
||||
function member_stop(obj, id) {
|
||||
layer.confirm('确认要' + $(obj).attr('title') + '吗?', function (index) {
|
||||
if ($(obj).attr('title') == '锁定') {
|
||||
// 拼装数据发送后台 锁定 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 0;
|
||||
var result = ajax('/member/change_status', query);
|
||||
} else {
|
||||
// 拼装数据发送后台 解锁 会员
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
query.status = 1;
|
||||
var result = ajax('/agent/change_status', query);
|
||||
}
|
||||
|
||||
// 判断结果 弹出提示
|
||||
if (result.code == 1) {
|
||||
layer.msg(result.msg, {icon: 1, time: 1500});
|
||||
setInterval(function () {
|
||||
location.reload();
|
||||
}, 1500);
|
||||
} else {
|
||||
layer.msg(result.msg, {icon: 2, time: 1500});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/*用户-删除*/
|
||||
function member_del(obj, id) {
|
||||
layer.confirm('确认要删除吗?',function () {
|
||||
// 数据验证
|
||||
if(id <= 0){
|
||||
layer.msg('删除用户出错!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 拼装数据
|
||||
var query = new Object;
|
||||
query.user_id = id;
|
||||
|
||||
// 发送数据到后台删除会员
|
||||
var result = ajax('/agent/agent_del',query);
|
||||
if(result.code == 1){
|
||||
layer.msg(result.msg, {icon: 1, time: 1000},function(){
|
||||
location.reload();
|
||||
});
|
||||
}else if(result.code == 0){
|
||||
layer.msg(result.msg, {icon: 2, time: 1000});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
$('#print').click(function(){
|
||||
var qs = getQueryString();
|
||||
var startDate = qs["startDate"];
|
||||
var endDate = qs["endDate"];
|
||||
var mode = qs["mode"];
|
||||
var username = qs["username"];
|
||||
if(startDate == undefined){
|
||||
startDate = '';
|
||||
}
|
||||
if(endDate == undefined){
|
||||
endDate = '';
|
||||
}
|
||||
if(mode == undefined){
|
||||
mode = '';
|
||||
}
|
||||
if(username == undefined){
|
||||
username = '';
|
||||
}
|
||||
layer.open({
|
||||
type: 2,
|
||||
title:'玩家上下分记录列表打印',
|
||||
content: '/player/scores_print?startDate='+startDate+'&endDate='+endDate+'&mode='+mode+'&username='+username,
|
||||
area: ['95%', '95%']
|
||||
});
|
||||
});
|
||||
function getQueryString() {
|
||||
var qs = location.search.substr(1), // 获取url中"?"符后的字串
|
||||
args = {}, // 保存参数数据的对象
|
||||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项,
|
||||
item = null,
|
||||
len = items.length;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
item = items[i].split("=");
|
||||
var name = decodeURIComponent(item[0]),
|
||||
value = decodeURIComponent(item[1]);
|
||||
if(name) {
|
||||
args[name] = value;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
$('#export').click(function(){
|
||||
var startDate = $('#start').val();
|
||||
var endDate = $('#end').val();
|
||||
var agent_level = $('#agent_level').val();
|
||||
var mode = $('#mode').val();
|
||||
var username = $('#username').val();
|
||||
layer.confirm('确定导出 excel 吗?',function(index){
|
||||
location.href = "/player/scores?export=1&&startDate="+startDate+"&&endDate="+endDate+"&&agent_level="+agent_level+"&&mode="+mode+"&&username="+username;
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
289
application/admin/view/player/scores_add.html
Normal file
289
application/admin/view/player/scores_add.html
Normal file
@ -0,0 +1,289 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
textarea, input[type="text"], input[type="password"],
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
||||
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
||||
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
|
||||
#search-agent{ padding-left:16px;padding-top:5px; background:#fff; border-radius:5px;position:absolute; left:315px;top:0; margin-left:-3px;display:block;height:21px; color:black; border:1px solid #ececec; width: 25px;cursor:pointer; }
|
||||
#search-agent:hover{border-color:#ccc;}
|
||||
#search-agent i{margin-top:30px;}
|
||||
#search-agent:hover > i{ color:#148cf1; }
|
||||
#search-agent i{ margin-left:-4px; }
|
||||
#L_username{ background:#ececec; cursor:pointer; }
|
||||
#agent_list{ width:300px; height:400px; border:1px solid #a2a2a2; position:absolute; left:550px; top:44px; z-index:99; background:#fff; display:none; }
|
||||
#agent_list #header-box{ width:100%; height:40px; border-bottom:1px solid #ccc; position:relative; cursor:move; }
|
||||
#agent_list #header-box a{ position:absolute; top:3px; right:20px; font-size:22px; }
|
||||
#agent_list #header-box div{ height:30px; margin:10px 25px; line-height:30px; font-size:18px; font-weight:bold; color:#333; }
|
||||
#agent_list .main-box{ height:50px; margin-top:10px; background:#fff; }
|
||||
#agent_list .main-box label{ font-size:14px; margin-left:25px; margin-right:10px; }
|
||||
#agent_list .main-box input{ border-radius:5px; height:30px; width:110px; border:1px solid #ccc; padding-left:5px; }
|
||||
#agent_list .main-box input:focus{ border:1px solid #148cf1; }
|
||||
#agent_list .main-box button{ background:#fff; border:1px solid #ccc; width:60px; height:30px; border-radius:5px; cursor:pointer; margin-left:10px; }
|
||||
#agent_list .main-box button:hover{ border:1px solid #8a8a8a; }
|
||||
#agent_list .main-box .z-tree{ margin-top:20px; height:240px; }
|
||||
#agent_list .main-box .z-tree ul{ margin-left: 50px; }
|
||||
#agent_list .main-box .z-tree ul li{ list-style: none; position:relative; height:20px; padding-left:2px; cursor:default; }
|
||||
#agent_list .main-box .z-tree ul li:before{ position:absolute; top:-12px; left:-12px; content: ''; width: 10px; height: 20px; border-style: none none dotted dotted; border-width: 1px; border-color: #9e9e9e; }
|
||||
#agent_list .main-box .z-tree ul li.first:before{ border-style: none none dotted none; }
|
||||
#agent_list .main-box .z-tree ul li span.agent_name_box.on{ background:#eaeaea; border:1px solid #ccc; }
|
||||
#agent_list .button-box{ height:40px; background:#eee; position:relative; top:249px; line-height:40px; }
|
||||
#agent_list .button-box span{ position:absolute; right:10px; }
|
||||
#agent_list .button-box span button{ width:50px; height:25px; margin-left:2px; border-radius:5px; }
|
||||
#agent_list .button-box span button:hover{ background:#edefd1; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one" data-id="1">玩家上下分记录列表</a>
|
||||
<a href="javascript:;" class="list-two actived" data-id="2">玩家上下分记录添加</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="info_from form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
<input id="L_username" name="L_username" type="text" readonly maxlength="50" minlength="3" class="required">
|
||||
<span id="search-agent"><i class="layui-icon"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作类型:</label>
|
||||
<div class="controls">
|
||||
<input class="scores" name="scores" value="1" type="radio" class="required" style="width:20px;">
|
||||
<span style="line-height:10px;display:inline-block;">上分</span>
|
||||
<input class="scores" name="scores" value="2" type="radio" class="required" style="width:20px;">下分
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作金额:</label>
|
||||
<div class="controls">
|
||||
<input id="L_amount" name="L_amount" type="text" value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作用户:</label>
|
||||
<div class="controls">
|
||||
<input id="L_controller" name="L_controller" type="text" readonly value="{$user_info.admin}" maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">余额:</label>
|
||||
<div class="controls">
|
||||
<input id="L_money" name="L_money" type="text" readonly value maxlength="50" minlength="3" class="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls">
|
||||
<textarea name="desc" id="L_remarks" style="width:25%;" placeholder="请输入内容" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<div class='submit'>保存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="agent_list">
|
||||
<div id="header-box">
|
||||
<div>选择代理</div>
|
||||
<a class="cancel" href="javascript:;">X</a>
|
||||
</div>
|
||||
<div class="main-box">
|
||||
<div class="search-box">
|
||||
<label class="key-word">关键字 :</label>
|
||||
<input type="text" id="agent_name">
|
||||
<button id="search_key_word">搜索</button>
|
||||
</div>
|
||||
<div class="z-tree" id="z-tree">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="button-box">
|
||||
<span>
|
||||
<button class="ensure">确定</button>
|
||||
<button class="cancel">取消</button>
|
||||
</span>
|
||||
</div>
|
||||
<input type="hidden" id="short-username" value="">
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == 1) location.href = '/player/scores';
|
||||
if(id == 2) location.href = '/player/scores_add';
|
||||
});
|
||||
|
||||
// 鼠标按下控件跟随移动
|
||||
function mouseMoveBox(pressId,boxId){
|
||||
var _move = false;//移动标记
|
||||
var _x,_y;//鼠标离控件左上角的相对位置
|
||||
$("#"+pressId).mousedown(function(e){
|
||||
// 按下鼠标计算与控件的相对位置
|
||||
_move = true;
|
||||
_x = e.pageX-parseInt($("#"+boxId).css("left"));
|
||||
_y = e.pageY-parseInt($("#"+boxId).css("top"));
|
||||
});
|
||||
$(document).mousemove(function(e){
|
||||
if(_move){
|
||||
//移动时根据鼠标位置计算控件左上角的绝对位置
|
||||
var x=e.pageX-_x;
|
||||
var y=e.pageY-_y;
|
||||
$("#"+boxId).css({top:y,left:x});//控件新位置
|
||||
}
|
||||
}).mouseup(function(){
|
||||
//松开鼠标后停止移动
|
||||
_move = false;
|
||||
});
|
||||
}
|
||||
// 代理列表跟随鼠标移动
|
||||
mouseMoveBox('header-box','agent_list');
|
||||
|
||||
|
||||
// 点击搜索所有的代理列表
|
||||
$('#search-agent').click(function(){
|
||||
var result = ajax('/player/getPlayer');
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
});
|
||||
$('#L_username').click(function(){
|
||||
var result = ajax('/player/getPlayer');
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
});
|
||||
|
||||
// 关键字搜索所有的代理列表
|
||||
$('#search_key_word').click(function(){
|
||||
var key_word = $('#agent_name').val();
|
||||
if(key_word){
|
||||
var query = new Object();
|
||||
query.username = key_word;
|
||||
var result = ajax('/player/getPlayer',query);
|
||||
$('#z-tree').empty().append(result);
|
||||
$('#agent_list').show();
|
||||
}
|
||||
});
|
||||
|
||||
// 选择代理名字
|
||||
$('#agent_list').on('click','.tree-li',function(){
|
||||
var username = $(this).find('span').eq(1).html();
|
||||
// 调整样式
|
||||
$('.agent_name_box').removeClass('on');
|
||||
$(this).find('.agent_name_box').addClass('on');
|
||||
// 动态数据
|
||||
$('#short-username').val(username);
|
||||
});
|
||||
// 双击触发选择代理
|
||||
$('#agent_list').on('dblclick','.tree-li',function(){
|
||||
$('.ensure').trigger('click');
|
||||
});
|
||||
|
||||
// 确定
|
||||
$('.ensure').click(function(){
|
||||
var username = $('#short-username').val();
|
||||
$('#L_username').val(username);
|
||||
$('#agent_list').hide();
|
||||
// 获取代理余额信息
|
||||
var username = $('#L_username').val();
|
||||
if(username){
|
||||
var result = ajax('/player/getPlayerMoney',{username:username});
|
||||
// 显示余额限制
|
||||
$('#L_money').val(result);
|
||||
}
|
||||
});
|
||||
|
||||
// 取消
|
||||
$('.cancel').click(function(){
|
||||
$('#agent_list').hide();
|
||||
});
|
||||
|
||||
// 选择上分还是下分
|
||||
$('.scores').click(function(){
|
||||
var id = $(this).val();
|
||||
if(id == 1) $('#L_remarks').html('总台上分 !');
|
||||
if(id == 2) $('#L_remarks').html('总台下分 !');
|
||||
});
|
||||
|
||||
//监听提交
|
||||
$('.submit').click(function () {
|
||||
// 获取和拼装添加代理的数据
|
||||
var query = new Object();
|
||||
query.username = $('#L_username').val();
|
||||
query.amount = $('#L_amount').val();
|
||||
query.mode = $('.scores:checked').val();
|
||||
query.controller = $('#L_controller').val();
|
||||
query.remarks = $('#L_remarks').val();
|
||||
var money = $('#L_money').val();
|
||||
|
||||
// 验证数据
|
||||
if(!query.username){
|
||||
layer.alert("请选择账号!");
|
||||
return false;
|
||||
}
|
||||
if(!query.mode){
|
||||
layer.alert("请选择操作类型!");
|
||||
return false;
|
||||
}
|
||||
if(!query.amount){
|
||||
layer.alert("请输入操作金额!");
|
||||
return false;
|
||||
}
|
||||
if(parseFloat(query.amount) <= 0){
|
||||
layer.alert("操作金额必须大于0!");
|
||||
return false;
|
||||
}
|
||||
if(query.mode == 2 && parseFloat(query.amount) > parseFloat(money)){
|
||||
layer.alert("操作金额不能大于余额!");
|
||||
return false;
|
||||
}
|
||||
// 发送数据到后台添加会员
|
||||
var result = ajax('/player/do_scores_add',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/player/scores";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// AJAX函数封装
|
||||
function ajax(url,query){
|
||||
var returnData = 0;
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:query,
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
async:false,
|
||||
success:function(data){
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
87
application/admin/view/player/scores_add_show.html
Normal file
87
application/admin/view/player/scores_add_show.html
Normal file
@ -0,0 +1,87 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-nav{overflow: inherit; }
|
||||
.x-nav .refresh{margin-right: 20px; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
.change_box .scores_add_show{border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative;border-left: 1px solid #e5e5e5;}
|
||||
.change_box .scores_add_show{color: #3daae9;}
|
||||
.change_box .scores_add_show:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.layui-input-block{ width:500px; }
|
||||
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
||||
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
||||
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px;padding-top: 5px; }
|
||||
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
||||
.pass_back{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav">
|
||||
<span class="change_box">
|
||||
<a href="/player/scores" class="scores_list">玩家上下分记录列表</a>
|
||||
<a href="javascript:;" class="scores_add_show">代理上下分记录查看</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<form class="layui-form form-horizontal">
|
||||
<div class="control-group">
|
||||
<label class="control-label">账号:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.username_for}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作类型:</label>
|
||||
{if condition="$recharge.mode == 1"}
|
||||
<div class="controls" style="position:relative;color:#ff5050;">
|
||||
{$recharge.mode_msg}
|
||||
</div>
|
||||
{else}
|
||||
<div class="controls" style="position:relative;color:#009688;">
|
||||
{$recharge.mode_msg}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作金额:</label>
|
||||
{if condition="$recharge.mode == 1"}
|
||||
<div class="controls" style="position:relative;color:#ff5050;">
|
||||
{$recharge.amount}
|
||||
</div>
|
||||
{else}
|
||||
<div class="controls" style="position:relative;color:#009688;">
|
||||
{$recharge.amount}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">操作用户:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.admin_user_name}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">余额:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.new_money}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">备注:</label>
|
||||
<div class="controls" style="position:relative;">
|
||||
{$recharge.remake}
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-buttom">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<a href="/player/scores">
|
||||
<div class='pass_back'>返回</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 隐藏参数 -->
|
||||
<input type="hidden" id="scores-id" value="{$recharge.id}">
|
||||
</body>
|
||||
|
||||
</html>
|
||||
11
application/admin/view/player/scores_agent_list.html
Normal file
11
application/admin/view/player/scores_agent_list.html
Normal file
@ -0,0 +1,11 @@
|
||||
<ul class="tree">
|
||||
{foreach name="$agent_list" item="vo" key="k"}
|
||||
<li class="<?php if($k == 0) echo 'first'; ?> tree-li" data-id="{$vo.id}">
|
||||
<span class="agent_name_box">
|
||||
<i class="iconfont" style="font-size:13px;"></i>
|
||||
<span>{$vo.username}</span>
|
||||
</span>
|
||||
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
44
application/admin/view/player/scores_print.html
Normal file
44
application/admin/view/player/scores_print.html
Normal file
@ -0,0 +1,44 @@
|
||||
{include file="public/header"}
|
||||
<body>
|
||||
<div class="x-body">
|
||||
<div class="layui-btn no-print" onclick="jQuery('html').print()">打印</div>
|
||||
<table class="layui-table">
|
||||
<div style="text-align: center;font-size: 18px;font-weight:bold;">玩家上下分记录列表</div>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center;">账号</th>
|
||||
<th style="text-align: center;">联系人</th>
|
||||
<th style="text-align: center;">代理类型</th>
|
||||
<th style="text-align: center;">操作类型</th>
|
||||
<th style="text-align: center;">操作金额</th>
|
||||
<th style="text-align: center;">操作人</th>
|
||||
<th style="text-align: center;">余额</th>
|
||||
<th style="text-align: center;">操作时间</th>
|
||||
<th style="text-align: center;">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="scoresList" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.username_for}</td>
|
||||
<td>{$vo.nickname_for}</td>
|
||||
<td>{$vo.user_agent_level}</td>
|
||||
{if condition="$vo.mode == 1"}
|
||||
<td>{$vo.mode_msg}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
{else}
|
||||
<td>{$vo.mode_msg}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
{/if}
|
||||
<td>{$vo.admin_user_name}</td>
|
||||
<td>{$vo.new_money}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>{$vo.remake}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
250
application/admin/view/player/user_online.html
Executable file
250
application/admin/view/player/user_online.html
Executable file
@ -0,0 +1,250 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:16px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:80px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:600px; min-height:150px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert .alert-main{width:600px;height:200px;overflow-y: scroll;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.alert-main th{width:40%; border-left:none; text-align:right;}
|
||||
.alert-main td{border-right:none; }
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">实时数据</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="x-body">
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 x-so float-left" action="/player/user_online" method="get">
|
||||
<div class="layui-input-block" >
|
||||
<select name="table_id" id="table_id">
|
||||
<option value="-1" selected>请选择桌子</option>
|
||||
{foreach name="$table_list" item="vo"}
|
||||
<option value="{$vo.id}" <?php if(isset($get['table_id']) && $get['table_id'] == $vo['id']) {echo 'selected';} ?>>{$vo.table_name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" id="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="<?php if(isset($get['username'])) {echo $get['username'];} ?>">
|
||||
<div class="layui-form-item" style="margin-bottom: 0px;">
|
||||
<label class="layui-form-label">只看未开</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" class="is_under" name="is_under" value="1" title="是" <?php if(isset($get['is_under']) && $get['is_under'] == 1) {echo 'checked';} ?>>
|
||||
<input type="radio" class="is_under" name="is_under" value="0" title="否" <?php if(isset($get['is_under']) && $get['is_under'] == 0) {echo 'checked';} ?>>
|
||||
</div>
|
||||
</div>
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon"></i></button>
|
||||
|
||||
<!-- <span class="layui-btn" id="export">导出excel</span>
|
||||
<span class="layui-btn" id="print">打印</span> -->
|
||||
<span style="margin-left:20px;color:red;">数据标红则疑似对打</span>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>登录客户端</th>
|
||||
<th>登录IP</th>
|
||||
<th>总押</th>
|
||||
<th>总赢</th>
|
||||
<th>当前余额</th>
|
||||
<th>下注详情</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="ttable">
|
||||
{foreach name="$user_online" item="vo"}
|
||||
{if $vo.is_beat == 1}
|
||||
<tr class="refreshData" style="background:red;">
|
||||
{else}
|
||||
<tr class="refreshData">
|
||||
{/if}
|
||||
<td>{$vo.username}</td>
|
||||
<td>{$vo.client}</td>
|
||||
<td>{$vo.last_login_ip}</td>
|
||||
<td>{$vo.amount}</td>
|
||||
<td>{$vo.win_total}</td>
|
||||
<td>{$vo.money}</td>
|
||||
<td>
|
||||
{$vo.bet_detail_first.bet_detail}
|
||||
{if condition="$vo.bet_detail_count > 1"}
|
||||
<a href="javascript:;" onclick="showBetDetail(this)" data-username="{$vo.username}" data-bet_detail={$vo.bet_detail}><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">更多</span></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:;">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" onclick="logout({$vo.user_id})">强制下线</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr class="refreshData">
|
||||
<th colspan="3" style="text-align: center;">统计</th>
|
||||
<th>{$totalData.amount}</th>
|
||||
<th>{$totalData.win_total}</th>
|
||||
<th colspan="3"></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<audio id="audio" hidden></audio>
|
||||
<div class="alert" id="alert_bet_detail">
|
||||
<div class="alert-title" id="show_username"></div>
|
||||
<div class="alert-main">
|
||||
<table class="layui-table" style="margin:0;">
|
||||
<tr><th>押庄赔率:</th><td id="show_price_banker"></td></tr>
|
||||
<tr><th>押闲赔率:</th><td id="show_price_player"></td></tr>
|
||||
<tr><th>押和赔率(百家乐):</th><td id="show_price_tie_baccarat"></td></tr>
|
||||
<tr><th>押对子赔率:</th><td id="show_price_pair"></td></tr>
|
||||
<tr><th>押龙赔率:</th><td id="show_price_dragon"></td></tr>
|
||||
<tr><th>押虎赔率:</th><td id="show_price_tiger"></td></tr>
|
||||
<tr><th>押和赔率(龙虎斗):</th><td id="show_price_tie_dt"></td></tr>
|
||||
<tr><th>押牛7-牛9赔率:</th><td id="show_price_n7_n9"></td></tr>
|
||||
<tr><th>押牛牛赔率:</th><td id="show_price_nn"></td></tr>
|
||||
<tr><th>押五公赔率:</th><td id="show_price_5n"></td></tr>
|
||||
<tr><th>押四条赔率:</th><td id="show_price_bomb"></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="hideBetDetail()" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var b = {$betIdArrJson};
|
||||
var bt = {$betIdDtArrJson};
|
||||
autoRefresh();
|
||||
function autoRefresh(){
|
||||
setInterval(function(){
|
||||
var username = $('#username').val();
|
||||
var table_id = $('#table_id').val();
|
||||
var is_under = $('.is_under:checked').val();
|
||||
$.ajax({
|
||||
url:'/player/user_online_autoRefresh',
|
||||
data:{username:username,table_id:table_id,is_under:is_under},
|
||||
dataType:'JSON',
|
||||
type:'POST',
|
||||
success:function(data){
|
||||
// 声音
|
||||
if(data.is_new == true){
|
||||
audioShow();
|
||||
}
|
||||
if(data.user_online){
|
||||
var total = data.totalData;
|
||||
var v = data.user_online;
|
||||
b = data.betIdArr;
|
||||
bt = data.betIdDtArr;
|
||||
var str = "";
|
||||
for(var i=0; i<v.length; i++){
|
||||
if(v[i]['is_beat'] == 1){
|
||||
str += '<tr class="refreshData" style="background:red;">';
|
||||
}else{
|
||||
str += '<tr class="refreshData">';
|
||||
}
|
||||
str += '<td>'+v[i].username+'</td>';
|
||||
str += '<td>'+v[i].client+'</td>';
|
||||
str += '<td>'+v[i].last_login_ip+'</td>';
|
||||
str += '<td>'+v[i].amount+'</td>';
|
||||
str += '<td>'+v[i].win_total+'</td>';
|
||||
str += '<td>'+v[i].money+'</td>';
|
||||
str += '<td>'+v[i].bet_detail_first.bet_detail;
|
||||
if(v[i].bet_detail_count > 1){
|
||||
str += '<a href="javascript:;" onclick="showBetDetail(this)" data-username="'+v[i].username+'" data-bet_detail='+JSON.stringify(v[i].bet_detail)+'><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;">更多</span></a></td>';
|
||||
}else{
|
||||
str += '</td>';
|
||||
}
|
||||
str += '<td><a href="javascript:;"><span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" onclick="logout('+v[i].user_id+')">强制下线</span></a> </td>';
|
||||
str += '</tr>';
|
||||
}
|
||||
str += '<tr class="refreshData">';
|
||||
str += '<th colspan="3" style="text-align: center;">统计</th>';
|
||||
str += '<th>'+total.amount+'</th>';
|
||||
str += '<th>'+total.win_total+'</th>';
|
||||
str += '<th colspan="3"></th>';
|
||||
str += '</tr>';
|
||||
|
||||
$('.refreshData').remove();
|
||||
$('.ttable').append(str);
|
||||
}
|
||||
}
|
||||
});
|
||||
},5000);
|
||||
}
|
||||
|
||||
function showBetDetail(obj){
|
||||
var username = $(obj).attr('data-username');
|
||||
var bet_detail = $(obj).attr('data-bet_detail');
|
||||
var v = JSON.parse(bet_detail);
|
||||
var str = '';
|
||||
console.log(v)
|
||||
console.log(b.indexOf(47))
|
||||
for(var i in v){
|
||||
|
||||
if(v[i]['game_id'] == 1 && b.includes(v[i]['bet_id'])){
|
||||
str += '<tr style="background:red;"><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}else if(v[i]['game_id'] == 2 && bt.includes(v[i]['bet_id'])){
|
||||
str += '<tr style="background:red;"><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}else{
|
||||
str += '<tr><td>'+ v[i]['bet_detail'] +'</td></tr>';
|
||||
}
|
||||
}
|
||||
$('#show_username').html(username);
|
||||
$('#alert_bet_detail').find('.layui-table').empty().html(str);
|
||||
$('#alert_bet_detail').show();
|
||||
}
|
||||
function hideBetDetail(){
|
||||
$('#alert_bet_detail').hide();
|
||||
}
|
||||
|
||||
// 踢人
|
||||
function logout(id){
|
||||
layer.confirm('确定强制该玩家下线吗?',function(){
|
||||
$.ajax({
|
||||
url:'/player/logout',
|
||||
data:{user_id:id},
|
||||
type:'POST',
|
||||
dataType:'JSON',
|
||||
success:function(data){
|
||||
layer.alert(data.msg,function(){
|
||||
location.reload();
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 新客人上线声音
|
||||
function audioShow(){
|
||||
var audio = $("#audio").get(0);
|
||||
var audioPath = '/static/console/mp3/welcome.mp3';
|
||||
$('#audio').attr('src',audioPath);
|
||||
audio.play();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
26
application/admin/view/public/header.html
Normal file
26
application/admin/view/public/header.html
Normal file
@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>网投系统</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
||||
<link rel="stylesheet" href="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/css/font.css">
|
||||
<link rel="stylesheet" href="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/css/xadmin.css">
|
||||
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/js/jquery-3.3.1.min.js"></script>
|
||||
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/lib/layui/layui.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/js/xadmin.js"></script>
|
||||
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/js/jQuery.print.js"></script>
|
||||
<script type="text/javascript" src="{$Think.ADMIN_STATIC_DOMAIN}/static/admin/js/img_upload.js"></script>
|
||||
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
||||
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style>
|
||||
th,td{text-align: center !important;}
|
||||
a.relation{text-decoration:underline;}
|
||||
a.relation:hover{text-decoration:underline;color:#3daae9}
|
||||
</style>
|
||||
</head>
|
||||
236
application/admin/view/recharge/index.html
Normal file
236
application/admin/view/recharge/index.html
Normal file
@ -0,0 +1,236 @@
|
||||
{include file="public/header"}
|
||||
<style>
|
||||
.x-body .layui-row{ margin-top:-10px; line-height:25px; background:#f5f5f5; border-radius:10px; }
|
||||
.x-body .layui-row .xblock button{ margin-top:-20px; }
|
||||
.x-body .layui-form{ margin-top:15px; margin-bottom:10px; }
|
||||
.x-body .layui-form .layui-input-block{ display:inline-block; width:150px; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item{ display:inline-block; margin-left:0; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-label{ width:48px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block{ margin-left:-10px; width:100px; }
|
||||
.x-body .layui-form .layui-form-item .layui-input-block .layui-form-radio i{ margin-right:4px; }
|
||||
.x-body .layui-form .layui-form-item .layui-form-radio{ margin-top:6px; margin-right:-8px; }
|
||||
.layui-input-block dl{ text-align:left; }
|
||||
.x-so{ margin:0; }
|
||||
.x-so input.layui-input{ width:150px; }
|
||||
.x-nav{overflow: inherit; } .x-nav .refresh{margin-right: 20px; }
|
||||
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
||||
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
||||
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
||||
|
||||
.alert{position:fixed; top:15%; left:30%; width:400px; min-height:320px; background:#fff; border:1px solid #e2e2e2; border-radius:5px; display:none;}
|
||||
.alert-title{background:#009688; height:40px; text-align: center; line-height:40px; font-size:14px; border-bootom:1px solid #F2F2F2;color:#fff;}
|
||||
.add_input{padding: 10px; font-size: 14px;text-align: center;}
|
||||
.alert-footer{padding:20px; text-align:center;}
|
||||
.alert-footer span{padding:10px 30px; display:inline-block; border-radius:5px; cursor:pointer;}
|
||||
</style>
|
||||
<body>
|
||||
<div class="x-nav" style="padding: 0px;">
|
||||
<span class="change_box">
|
||||
<a href="javascript:;" class="list-one actived" data-id="1">收款银行列表</a>
|
||||
<a href="javascript:;" class="list-two" data-id="2">收款二维码列表</a>
|
||||
</span>
|
||||
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
||||
href="javascript:location.replace(location.href);" title="刷新">
|
||||
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="layui-row">
|
||||
<span class="layui-btn" style="margin-left: 20px;" onclick="showAdd()">添加</span>
|
||||
</div>
|
||||
<div class="x-body">
|
||||
<table class="layui-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<th>收款人姓名</th>
|
||||
<th>收款银行</th>
|
||||
<th>收款银行账号</th>
|
||||
<th>状态</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach name="recharge_list" item="vo"}
|
||||
<tr>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.receivables_name}</td>
|
||||
<td>{$vo.receivables_bank}</td>
|
||||
<td>{$vo.receivables_bank_number}</td>
|
||||
<td>{$vo.is_use}</td>
|
||||
<td>{$vo.create_time}</td>
|
||||
<td>
|
||||
<a href="javascript:;" onclick="edit_bank(this)" receivables_id="{$vo.id}" receivables_name="{$vo.receivables_name}" receivables_bank="{$vo.receivables_bank}" receivables_bank_number="{$vo.receivables_bank_number}" status="{$vo.status}">
|
||||
<span class="layui-btn layui-btn-normal layui-btn-mini" style="background:#009688;" >修改</span>
|
||||
</a>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
{$recharge_list->render()}
|
||||
</div>
|
||||
<div class="alert" id="alert_add">
|
||||
<div class="alert-title">添加收款银行卡</div>
|
||||
<div class="alert-main">
|
||||
<div class="add_input">收款人姓名:<input id="receivables_name" name="receivables_name" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">收款人银行:<input id="receivables_bank" name="receivables_bank" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">收款人卡号:<input id="receivables_cardnum" name="receivables_cardnum" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">是否启用: <input name="is_use" class="required is_use" type="radio" value="1" maxlength="20" style="color:#999;width:35px;" checked><span>是</span>
|
||||
<input name="is_use" class="required is_use" type="radio" value="0" maxlength="20" style="color:#999;width:35px;"><span>否</span></div>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="do_add_bank()" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">提交</span>
|
||||
<span onclick="hiddenForm('alert_add')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert" id="alert_edit">
|
||||
<div class="alert-title">修改收款银行卡</div>
|
||||
<div class="alert-main">
|
||||
<input type="hidden" id="edit_receivables_id" value="">
|
||||
<div class="add_input">收款人姓名:<input id="edit_receivables_name" name="receivables_name" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">收款人银行:<input id="edit_receivables_bank" name="receivables_bank" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">收款人卡号:<input id="edit_receivables_cardnum" name="receivables_cardnum" type="text" value maxlength="50" minlength="3"></div>
|
||||
<div class="add_input">是否启用: <input name="edit_is_use" class="required edit_is_use" type="radio" value="1" maxlength="20" style="color:#999;width:35px;"><span>是</span>
|
||||
<input name="edit_is_use" class="required edit_is_use" type="radio" value="0" maxlength="20" style="color:#999;width:35px;"><span>否</span></div>
|
||||
</div>
|
||||
<div class="alert-footer">
|
||||
<span onclick="do_edit_bank()" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">提交</span>
|
||||
<span onclick="hiddenForm('alert_edit')" class="input_button" style="background:#009688; border:1px solid #e2e2e2;color:#fff;">关闭</span>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// 代理列表和添加代理切换
|
||||
$('.x-nav .change_box a').click(function(){
|
||||
// 样式切换
|
||||
$('.x-nav .change_box a').removeClass('actived');
|
||||
$(this).addClass('actived');
|
||||
// 页面切换
|
||||
var id = $(this).attr('data-id');
|
||||
if(id == "1") location.href = '/recharge/index';
|
||||
if(id == "2") location.href = '/recharge/qr_code';
|
||||
});
|
||||
|
||||
/**
|
||||
* 封装 AJAX 函数
|
||||
* @param url 目标地址
|
||||
* @param query 参数
|
||||
* @returns {string}
|
||||
*/
|
||||
function ajax(url, query) {
|
||||
var returnData = "";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: query,
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
async: false,
|
||||
success: function (data) {
|
||||
returnData = data;
|
||||
}
|
||||
});
|
||||
return returnData;
|
||||
}
|
||||
// 显示用户的赔率
|
||||
function showAdd(){
|
||||
$('#alert_add').show();
|
||||
}
|
||||
//点击隐藏表单弹窗
|
||||
function hiddenForm(id) {
|
||||
$('#receivables_name').val('');
|
||||
$('#receivables_bank').val('');
|
||||
$('#receivables_cardnum').val('');
|
||||
$('#' + id).hide();
|
||||
}
|
||||
function do_add_bank(){
|
||||
var query = new Object();
|
||||
query.receivables_name = $('#receivables_name').val();
|
||||
query.receivables_bank = $('#receivables_bank').val();
|
||||
query.receivables_cardnum = $('#receivables_cardnum').val();
|
||||
query.is_use = $('.is_use:checked').val();
|
||||
if(query.receivables_name.length == 0){
|
||||
layer.alert("请填写收款人姓名!");
|
||||
return false;
|
||||
}
|
||||
if(query.receivables_bank.length == 0){
|
||||
layer.alert("请填写收款银行!");
|
||||
return false;
|
||||
}
|
||||
if(query.receivables_cardnum.length == 0){
|
||||
layer.alert("请填写收款人卡号!");
|
||||
return false;
|
||||
}
|
||||
if(query.is_use.length == 0){
|
||||
layer.alert("请选择收款银行卡状态!");
|
||||
return false;
|
||||
}
|
||||
var result = ajax('/recharge/do_add_bank',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/recharge/index";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
function edit_bank(obj){
|
||||
$('input:radio[name="edit_is_use"]').removeAttr('checked');
|
||||
var receivables_name = $(obj).attr('receivables_name');
|
||||
var receivables_bank = $(obj).attr('receivables_bank');
|
||||
var receivables_bank_number = $(obj).attr('receivables_bank_number');
|
||||
var receivables_id = $(obj).attr('receivables_id');
|
||||
var status = $(obj).attr('status');
|
||||
$('#edit_receivables_id').val(receivables_id);
|
||||
$('#edit_receivables_name').val(receivables_name);
|
||||
$('#edit_receivables_bank').val(receivables_bank);
|
||||
$('#edit_receivables_cardnum').val(receivables_bank_number);
|
||||
if(status == 1){
|
||||
$("input[name='edit_is_use'][value=1]").attr("checked",true);
|
||||
$("input[name='edit_is_use'][value=0]").removeAttr("checked");
|
||||
}else{
|
||||
$("input[name='edit_is_use'][value=0]").attr("checked",true);
|
||||
$("input[name='edit_is_use'][value=1]").removeAttr("checked");
|
||||
}
|
||||
$('#alert_edit').show();
|
||||
}
|
||||
function do_edit_bank(){
|
||||
var query = new Object();
|
||||
query.receivables_id = $('#edit_receivables_id').val();
|
||||
query.receivables_name = $('#edit_receivables_name').val();
|
||||
query.receivables_bank = $('#edit_receivables_bank').val();
|
||||
query.receivables_cardnum = $('#edit_receivables_cardnum').val();
|
||||
query.is_use = $('.edit_is_use:checked').val();
|
||||
if(query.receivables_name.length == 0){
|
||||
layer.alert("请填写收款人姓名!");
|
||||
return false;
|
||||
}
|
||||
if(query.receivables_bank.length == 0){
|
||||
layer.alert("请填写收款银行!");
|
||||
return false;
|
||||
}
|
||||
if(query.receivables_cardnum.length == 0){
|
||||
layer.alert("请填写收款人卡号!");
|
||||
return false;
|
||||
}
|
||||
if(query.is_use.length == 0){
|
||||
layer.alert("请选择收款银行卡状态!");
|
||||
return false;
|
||||
}
|
||||
var result = ajax('/recharge/do_edit_bank',query);
|
||||
if(result.code == 1){
|
||||
layer.alert(result.msg, {icon: 6}, function () {
|
||||
location.href = "/recharge/index";
|
||||
});
|
||||
}else{
|
||||
layer.alert(result.msg,{icon:2});
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user