Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
ELF 5 years ago
commit eb09c67dd4

@ -215,4 +215,160 @@ class PromoteCoinController extends ThinkController {
$this->display();
}
//获取线下充值列表
public function offlineList($p=0)
{
//获取记录
$map = array();
$map['pay_type'] = 2;
$map['is_del'] = 0;
//其他条件查询
if(isset($_REQUEST['promote_account'])){
$map['promote_account']=array('like','%'.trim($_REQUEST['promote_account']).'%');
unset($_REQUEST['promote_account']);
}
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
$map['create_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
unset($_REQUEST['time-start']);unset($_REQUEST['time-end']);
}elseif(isset($_REQUEST['time-start'])){
$map['create_time'] = ['GT',strtotime(I('time-start'))];
unset($_REQUEST['time-start']);
}elseif(isset($_REQUEST['time-end'])){
$map['create_time'] = ['LT',strtotime(I('time-end'))+86399];
unset($_REQUEST['time-end']);
}
if(isset($_REQUEST['order_status'])){
$map['order_status']=$_REQUEST['order_status'];
unset($_REQUEST['order_status']);
}
$data = D("CoinPayOrder")->lists($_GET["p"], $map, $order);
// dump($data);
//执行查询
// parent::order_lists("CoinPayOrder",$_GET["p"],$extend);
$this->meta_title = '线下充值审核列表';
$this->assign('list_data',$data['data']);
$this->assign('_page',$data['page']);
$this->display();
# code...
}
public function offlineOrderInfo()
{
if(!isset($_REQUEST['id'])){
exit("参数错误");
}
$id = $_REQUEST['id'];
$data = D("CoinPayOrder")->info($id);
$this->meta_title = '线下充值审核详情';
$this->assign('data', $data);
$this->display();
# code...
}
//审核通过
public function offlineAgree()
{
if(!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1){
exit("参数错误");
}
$ids = I("ids");
$count = count($ids);
//执行操作
for ($i=0; $i <$count; $i++) {
$this->doOfflineAgree($ids[$i]);
}
$this->success("批量通过成功");
# code...
}
//批量审核拒绝
public function offlineReject()
{
if(!isset($_REQUEST['ids']) || count($_REQUEST['ids']) < 1){
exit("参数错误");
}
$ids = I("ids");
$count = count($ids);
//执行操作
for ($i=0; $i <$count; $i++) {
$this->orderReject($ids[$i]);
}
$this->success("批量拒绝成功");
# code...
}
public function doOfflineAgree($id)
{
//获取记录
$order = D("CoinPayOrder")->info($id);
if($order['order_status'] != 2){
return;
}
//
$balance_map['promote_id'] = $order['promote_id'];
$balance_map['game_id'] = 0;
$balance = M('promote_balance_coin', 'tab_')->where($balance_map)->find();
$this->balance_coin_update($order,$balance);//更新汇总
$this->coin_record_add($order,$balance); //添加流水
$this->promote_balance_coin_update($order); //更新推广员平台币余额
$this->orderAgree($id);//更新表
}
public function orderReject($id)
{
$order = D("CoinPayOrder")->info($id);
if($order['order_status'] != 2){
return;
}
$savedata = array();
$auth = $_SESSION['onethink_admin']['user_auth'];
$savedata['auditor_id']=$auth['uid'];
$savedata['auditor_account']=$auth['username'];
$savedata['auditor_time']=time();
$savedata['order_status']=-1;
D("CoinPayOrder")->updateData($savedata,$id);
# code...
}
public function orderAgree($id)
{
$savedata = array();
$auth = $_SESSION['onethink_admin']['user_auth'];
$savedata['auditor_id']=$auth['uid'];
$savedata['auditor_account']=$auth['username'];
$savedata['auditor_time']=time();
$savedata['order_status']=4;
D("CoinPayOrder")->updateData($savedata,$id);
# code...
}
// 添加流水
public function coin_record_add($order,$balance){
$data['sn']=date('Ymd') . date('His') . sp_random_num(6);
$data['type']=1;
$data['sub_type'] =1;
$data['target_id'] = $order['promote_id'];
$data['target_type'] = 1;
$data['ref_id'] = $order['id'];
$data['coin'] = $order['real_amount'];
$data['balance_coin'] = $balance['num']+$order['coin_num'];
$data['remark'] = $order['remark'];
$data['create_time']=time();
$data['description']='线下充值';
M('promote_coin_record', 'tab_')->data($data)->add();
}
//更新汇总
public function balance_coin_update($order,$balance){
if(!empty($balance)){
$map['promote_id'] = $order['promote_id'];
$map['game_id'] = 0;
M('promote_balance_coin', 'tab_')->where($map)->setInc('num',$order['coin_num']);
}else{
$balance['promote_id']= $order['promote_id'];
$balance['game_id'] = 0;
$balance['num']=$order['coin_num'];
M('promote_balance_coin', 'tab_')->data($balance)->add();
}
}
//更新推广员平台币余额
public function promote_balance_coin_update($order){
$map['id'] = $order['promote_id'];
M('promote', 'tab_')->where($map)->setInc('balance_coin',$order['coin_num']);
}
}

@ -1,5 +1,6 @@
<?php
namespace Admin\Controller;
use mysql_xdevapi\Exception;
use User\Api\PromoteApi;
use User\Api\UserApi;
use Org\XiguSDK\Xigu;
@ -899,4 +900,54 @@ unset($_REQUEST['parent_id']);
}
}
public function shortCutMenu($p = 1) {
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
$row=10;
$this->meta_title = '快捷菜单管理';
$this->m_title = '站点设置(推广员后台)';
$list = M("quick_menu","tab_")->page($page,$row)->select();
$count = M("quick_menu","tab_")->count();
$page = set_pagination($count,$row);
if($page) {$this->assign('_page', $page);}
$this->assign('list',$list);
$this->display();
}
public function shortCutMenuEdit() {
$id = I("id");
$where['id'] = $id;
$data = M("quick_menu","tab_")->where($where)->find();
$this->assign("data",$data);
$this->meta_title = '快捷菜单管理编辑';
$this->m_title = '站点设置(推广员后台)';
$this->display();
}
public function shortCutMenuSave() {
$where['id'] = I("id");
$save['icon'] = I("icon");
M('quick_menu', 'tab_')->startTrans(); //事物
try{
M('quick_menu', 'tab_')->where($where)->save($save);
}catch (Exception $e) {
M('quick_menu', 'tab_')->rollback();//回滚
}
M('quick_menu', 'tab_')->commit(); //提交事物
$this->success('保存成功',U("promote/shortCutMenu"));
}
}

@ -199,9 +199,14 @@ class TestResourceController extends ThinkController
$arrUserId = array_column($data,'id');
$logId = implode(',',$arrUserId);
$logRead = M('protect_log_read','tab_')
->where("log_id IN({$logId}) and promote_id = {$promote_id}")
->select();
if ($logId) {
$logRead = M('protect_log_read','tab_')
->where("log_id IN({$logId}) and promote_id = {$promote_id}")
->select();
}
else {
$logRead = [];
}
$upsetData = array_column($logRead,'log_id');

@ -1 +0,0 @@
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":0,"player":0,"money":0},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}

@ -0,0 +1,82 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <banhuajie@163.com>
// +----------------------------------------------------------------------
namespace Admin\Model;
use Think\Model;
/**
* 文档基础模型
*/
class CoinPayOrderModel extends Model{
/**
* 构造函数
* @param string $name 模型名称
* @param string $tablePrefix 表前缀
* @param mixed $connection 数据库连接信息
*/
public function __construct($name = '', $tablePrefix = '', $connection = '') {
/* 设置默认的表前缀 */
$this->tablePrefix ='tab_';
/* 执行构造方法 */
parent::__construct($name, $tablePrefix, $connection);
}
public function lists($p=1, $map=array(), $order, $field=true)
{
$page = intval($p);
$page = $page ? $page : 1; //默认显示第一页数据
if(isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$list = $this->field($field?:true)
->where($map)
->page($page, $row)
->order($order?$order:'pay_time desc')
->select();
$count = $this->where($map)->count();
$data['data'] = $list;
$page = set_pagination($count,$row);
if($page) {
$data['page']=$page;
}
return $data;
}
//获取单个信息
public function info($id)
{
$info = $this->field($field?:true)
->where("id = '".$id."'")
->find();
if(!empty($info['voucher_img'])){
$info['voucher_img'] = get_cover($info['voucher_img'])['path'];
}
return $info;
# code...
}
//更新
public function updateData($save,$id)
{
if(!empty($save['id'])){
return false;
}
return $this->where("id = {$id}")->save($save);
# code...
}
}

@ -1051,16 +1051,31 @@ class UserModel extends Model{
}
}
public function login_sdk($account,$password,$type=1,$game_id,$game_name,$sdk_version){
public function login_sdk($account,$password,$type=1,$game_id,$game_name,$sdk_version,$unique_code){
$map['account'] = $account;
/* 获取用户数据 */
$user = $this->where($map)->find();
if(is_array($user) && $user['lock_status'] && $user['check_status']){
/* 验证用户密码 */
if(think_ucenter_md5($password, UC_AUTH_KEY) === $user['password']||$type==2){
$token = $this->updateLogin_($user['id'],$account,$password,$user['fgame_id'],$game_id,$game_name); //更新用户登录信息
$this->user_login_record2($user,$type,$game_id,$game_name,$sdk_version);
return array("user_id"=>$user['id'],"token"=>$token); //登录成功返回用户ID
$test_resource = M('test_resource','tab_')->where("user_id=%s and apply_status=2",$user['id'])->find();//测试资源(扶持号)
if($test_resource){ //扶持号
if($user['device_number'] && $unique_code && $user['device_number'] !=$unique_code){ //#当前登录设备信息与历史登录设备信息不一致,触发账户冻结
$this->sdklogin_device_error($user,$test_resource,$unique_code);
$this->sdklogin_ip_error($user,$test_resource,get_client_ip());
return -1;//扶持号被禁用
}else{
$token = $this->sdklogin_update($user,$account,$password,$user['fgame_id'],$game_id,$game_name,$unique_code); //更新用户登录信息
$this->user_login_record2($user,$type,$game_id,$game_name,$sdk_version);
$this->sdklogin_ip_error($user,$test_resource,get_client_ip());
return array("user_id"=>$user['id'],"token"=>$token); //登录成功返回用户ID
}
}else{
$token = $this->sdklogin_update($user,$account,$password,$user['fgame_id'],$game_id,$game_name,$unique_code); //更新用户登录信息
$this->user_login_record2($user,$type,$game_id,$game_name,$sdk_version);
return array("user_id"=>$user['id'],"token"=>$token); //登录成功返回用户ID
}
} else {
return -2; //密码错误
}
@ -1070,6 +1085,79 @@ class UserModel extends Model{
}
//更新用户登录信息
protected function sdklogin_update($user,$account,$password,$user_fgame_id,$game_id,$game_name,$unique_code=''){
$model = M('User','tab_');
$uid = $user['id'];
$data["id"] = $uid;
$data["login_time"] = NOW_TIME;
$data["login_ip"] = get_client_ip();
$data["device_number"] = $unique_code;
$data["last_login_ip"] = $user['login_ip'];
$data["last_device_number"] = $user['device_number'];
$data["token"] = $this->generateToken($uid,$account,$password);
if($user_fgame_id){
$model->save($data);
}else{
$data['fgame_id']=$game_id;
$data['fgame_name']=$game_name;
$model->save($data);
}
return $data["token"];
}
// 扶持号登录设备异常
protected function sdklogin_device_error($user,$resource,$unique_code){
$model = M('User','tab_');
$uid = $user['id'];
$data["id"] = $uid;
$data["device_number"] = $unique_code;
$data["last_device_number"] = $user['device_number'];
$data["lock_status"] = 0 ;
$model->save($data);
$protect_data['user_id']= $uid;
$protect_data['user_account']= $resource['user_account'];
$protect_data['server_id'] = $resource['server_id'];
$protect_data['server_name']= $resource['server_name'];
$protect_data['game_id']=$resource['game_id'];
$protect_data['game_name']=$resource['game_name'];
$protect_data['nickname']=$resource['role_name'];
$protect_data['promote_id']=$resource['promote_id'];
$protect_data['promote_account']=$resource['promote_account'];
$protect_data['type']=2;
$protect_data['detail']="登录设备号异常,本次异常设备号:".$unique_code.",历史登录设备号:".$user['device_number'];
$protect_data['create_time'] = NOW_TIME;
M('protect_log','tab_')->add($protect_data);
}
// 扶持号登录IP异常
protected function sdklogin_ip_error($user,$resource,$ip){
$newloginip_source = file_get_contents("http://ip.taobao.com/service/getIpInfo.php?ip=".$ip);
$aldloginip_source = file_get_contents("http://ip.taobao.com/service/getIpInfo.php?ip=".$user['login_ip']);
$newloginip_source = json_decode($newloginip_source,true);
$aldloginip_source = json_decode($aldloginip_source,true);
if($newloginip_source['data']['city']!=$aldloginip_source['data']['city']){ //登录城市不一致时触发IP异常
$uid = $user['id'];
$protect_data['user_id']= $uid;
$protect_data['user_account']= $resource['user_account'];
$protect_data['server_id'] = $resource['server_id'];
$protect_data['server_name']= $resource['server_name'];
$protect_data['game_id']=$resource['game_id'];
$protect_data['game_name']=$resource['game_name'];
$protect_data['nickname']=$resource['role_name'];
$protect_data['promote_id']=$resource['promote_id'];
$protect_data['promote_account']=$resource['promote_account'];
$protect_data['type']=1;
$protect_data['detail']="登录IP异常本次异常IP".$ip."历史登录IP".$user['login_ip'];
$protect_data['create_time'] = NOW_TIME;
M('protect_log','tab_')->add($protect_data);
}
}
//判断game_id是否有值
protected function updateLogin_($uid,$account,$password,$user_fgame_id,$game_id,$game_name){
$model = M('User','tab_');

@ -0,0 +1,59 @@
<extend name="Public/base"/>
<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<div class="cf main-place top_nav_list navtab_list">
{:W('Index/navigation',array('value'=>'Site/channel'))}
<h3 class="page_title">快捷菜单管理</h3>
<p class="description_text"></p>
</div>
<div class="data_list">
<table>
<thead>
<tr>
<th>ID</th>
<th>菜单名称</th>
<th>菜单跳转地址</th>
<th>菜单图标</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<notempty name="list">
<volist name="list" id="list">
<tr>
<td>{$list.id}</td>
<td>{$list.name}</td>
<td>{$list.url}</td>
<td><img src="{$list.icon}" style="width: 100px"/></td>
<td><a href="{:U('promote/shortCutMenuEdit',array('id'=>$list['id']))}">编辑</a></td>
</tr>
</volist>
<else/>
<td colspan="6" class="text-center">aOh! 暂时还没有内容!</td>
</notempty>
</tbody>
</table>
</div>
<div class="page">
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Site/channel">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Site/channel')}');
</script>
</block>

@ -0,0 +1,184 @@
<extend name="Public/base" />
<block name="css">
<!-- <link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all"> -->
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/area1.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/AreaData_min.js"></script>
<script type="text/javascript" src="__STATIC__/provincecityarea/jquery-1.7.min.js"></script>
<script type="text/javascript" src="__JS__/jquery.mousewheel.js"></script>
<style>
#form .txt_area.download_url {width:400px;}
.tabcon1711 .table_radio2 .table_btn {width:215px;}
</style>
</block>
<block name="body">
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<style>
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.tabcon1711 .select2-container--default .select2-selection--single{
font-size: 12px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;height:30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__rendered {line-height: 30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__arrow {height:30px;}
.tabcon1711 .select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.tabcon1711 .select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
{:W('Index/navigation',array('value'=>'Site/channel'))}
<h3 class="page_title">快捷菜单管理</h3>
<p class="description_text"></p>
</div>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<form id="form" action="{:U('shortCutMenuSave')}" method="post" class="form-horizontal">
<!-- 基础文档模型 -->
<div id="tab1" class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l">菜单名称:</td>
<td class="r">
<input type="text" class="txt " name="user_password" value="{$data['name']}" disabled="disabled" placeholder="请输入菜单名称">
</td>
</tr>
<tr>
<td class="l">菜单跳转地址:</td>
<td class="r">
<input type="text" class="txt " name="role_name" value="{$data['url']}" disabled="disabled" placeholder="请输入菜单跳转地址">
</td>
</tr>
<tr>
<td class="l">角色名称:</td>
<td class="r">
<div style="float:left;width:215px;padding:10px 0;">
<input type="hidden" name="id" value="{{$data['id']}}"/>
<input type="file" id="upload_picture">
<input type="hidden" name="cover_id" id="cover_id" value=""/>
<input type="hidden" name="icon" id="icon" value="{$data['icon']}"/>
<div class="upload-img-box">
<notempty name="data">
<div class="upload-pre-item">
<span class="placeholder-graphic"><img style="width:50px" src="{$data['icon']}"/></span>
</div>
</notempty>
</div>
<script type="text/javascript">
//上传图片
/* 初始化上传插件 */
$("#upload_picture").uploadify({
"height" : 30,
"swf" : "__STATIC__/uploadify/uploadify.swf",
"fileObjName" : "download",
"buttonText" : "上传图片",
"uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
"width" : 120,
'removeTimeout' : 1,
'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
"onUploadSuccess" : uploadPicture,
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
}
});
function uploadPicture(file, data){
var data = $.parseJSON(data);
var src = '';
if(data.status){
$("#cover_id").val(data.id);
src = data.url || '__ROOT__' + data.path;
$("#cover_id").parent().find('.upload-img-box').html(
'<div class="upload-pre-item"><span class="placeholder-graphic"><img style="width:50px" src="' + src + '"/></span></div>'
);
// console.log(data);
$("#icon").val(data.path);
} else {
updateAlert(data.info);
setTimeout(function(){
$('#top-alert').find('button').click();
$(that).removeClass('disabled').prop('disabled',false);
},1500);
}
}
</script>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<input type="hidden" name="id" value="{$data['id']}">
<input type="hidden" name="type" value="{$_GET['type']}">
<div class="form-item cf">
<button class="submit_btn ajax-post " id="submit" type="submit" target-form="form-horizontal" style="margin-left:210px;">
保存
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</form>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Giftbag/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript">
//导航高亮
// $('.side-sub-menu').eq(0).show();
highlight_subnav('{:U('Site/channel')}');
</script>
</block>

@ -0,0 +1,342 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css"/>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">线下充值审核</h3>
<p class="description_text">说明:当用户在推广后台发起线下充值时,可在本页面审核是否通过,通过则自动发币</p>
</div>
<div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<a class="ajax-post " onclick="loadicon()" target-form="ids" url="{:U('PromoteCoin/offlineAgree')}"><span class="button_icon button_icon12"></span>审核通过</a>
<a class="ajax-post " onclick="loadicon()" target-form="ids" url="{:U('PromoteCoin/offlineReject')}"><span class="button_icon button_icon9"></span>审核不通过</a>
</div>
</div>
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" name="promote_account" placeholder="充值账号" class=""
value="{:I('promote_account')}">
</div>
<div class="input-list">
<input type="text" id="time-start" name="time-start" class="" value="{:I('time-start')}"
placeholder="开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="time-end" class="" value="{:I('time-end')}"
placeholder="结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select name="order_status" style="color:#444" class="select_gallery" id="pay_game_status">
<option value="">审核状态</option>
<option value="2">待审核</option>
<option value="4">审核通过</option>
<option value="-1">审核不通过</option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('PromoteCoin/offlineList','model='.$model['name'] . '&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list zdata_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th class="">
<input class="check-all" type="checkbox" name="ids[]">
</th>
<th>充值账号</th>
<th>提交时间</th>
<th>平台币数量</th>
<th>付款金额</th>
<th>汇入银行</th>
<th>支付凭证</th>
<th>备注</th>
<th>审核状态</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="15" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.promote_account}</td>
<td>{:set_show_time($data['create_time'])}</td>
<td>{$data.coin_num}</td>
<td>{$data.real_amount}</td>
<td>— —</td>
<td>{$data.pay_order_number}</td>
<td>{$data.remark}</td>
<td>
<if condition="($data.order_status eq 2)"> 待审核
<elseif condition="$data.order_status eq 4"/>审核通过
<else /> 审核不通过
</if>
</td>
<td>
<a href="{:U('PromoteCoin/offlineOrderInfo?id='.$data['id'])}">查看 </a>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
</div>
</div>
<div class="page">
<!-- <a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>7,'xlsname'=>'游戏订单_游戏充值'),I('get.')))}">导出</a> -->
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="PromoteCoin/offlineList">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('PromoteCoin/offlineList')}");
function loadicon(){
layer.load(2,{shade:0.3,time:1.5*1000});
return true;
}
$(function () {
//搜索功能
$("#search").click(function () {
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down11 .nav-list li").find("a").each(function () {
var that = $(".drop-down11");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down12").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down12 .nav-list li").find("a").each(function () {
var that = $(".drop-down12");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
$(".d_list").find(".drop-down13").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {
$(this).find(".nav-list").addClass("hidden");
});
$(".drop-down13 .nav-list li").find("a").each(function () {
var that = $(".drop-down13");
$(this).click(function () {
var text = $(this).text(), val = $(this).attr("value");
that.find(".sort-txt").text(text).attr("data", val);
that.find(".nav-list").addClass("hidden");
that.siblings('.hiddenvalue').val(val);
})
});
//下拉内容框
$(".drop-down2").on('click', function (event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function () {
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#i_list_id').on('keyup', function (event) {
var val = $.trim($(this).val()).toLowerCase();
$('#i_list_idh').val(val);
});
$("#i_list_li").find("a").each(function () {
$(this).click(function () {
var text = $.trim($(this).text()).toLowerCase();
$("#i_list_id").val(text);
$('#i_list_idh').val(text);
})
});
})
/**
* 初始化select2单选默认带搜索功能。
*/
//初始化页面加载
$(document).ready(function () {
//初始化select2单选
initSelect2WithSearch();
});
function initSelect2WithSearch() {
$("#pay_game_status").select2({
tags: true,
placeholder: '审核状态',
allowClear: false,
minimumResultsForSearch: Infinity, // 永久隐藏搜索框
});
}
</script>
</block>

@ -0,0 +1,154 @@
<extend name="Public/base" />
<block name="body">
<style>
.tabcon1711 .table_click,
.tabcon1711 .table_click:hover {
border: none;
}
.tabcon1711 .table_click .table_click_text {
border-bottom: 1px solid transparent;
}
.tabcon1711 .table_click:hover .table_click_text {
border-bottom-color: #145CCD;
}
.tabcon1711 .datainfo {
font-size: 14px;
}
.submit_btn {
background-image: none;
}
</style>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<!-- 标签页导航 -->
<div class="tab-wrap">
<div class="tab-content tabcon1711">
<!-- 表单 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">线下充值审核</h3>
<p class="description_text">说明:当用户在推广后台发起线下充值时,可在本页面审核是否通过,通过则自动发币</p>
</div>
<div class="tab-pane in tab1">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l">充值账号:</td>
<td class="r">
<span class="datainfo">{$data['promote_account']}</span>
</td>
</tr>
<tr>
<td class="l">平台币数量:</td>
<td class="r">
<span class="datainfo">{$data['coin_num']}</span>
</td>
</tr>
<tr>
<td class="l">购买金额:</td>
<td class="r">
<span class="datainfo">{$data['real_amount']}</span>
</td>
</tr>
<tr>
<td class="l">汇入银行:</td>
<td class="r">
<span class="datainfo">--</span>
</td>
</tr>
<tr>
<td class="l">支付凭证:</td>
<td class="r">
<span class="datainfo">{$data['pay_order_number']}</span>
</td>
</tr>
<tr>
<td class="l">支付截图:</td>
<td class="r">
<img src="{$data['voucher_img']}" style="width: 200px;height: auto;">
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r">
<span class="datainfo">{$data['remark']}</span>
</td>
</tr>
<if condition="$data.order_status eq 2 ">
<tr>
<td class="l noticeinfo"></td>
<td class="r">
<div class="new_submit" data-id="{$data['id']}">
<button id="agree" class="submit_btn" style="background-color:rgba(51, 153, 255, 1);">
审核通过
</button>
<button id="reject" class="submit_btn " style="background-color:red;">
拒绝审核通过
</button>
</div>
</td>
</tr>
</if>
</table>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('PromoteCoin/offlineList')}");
Think.setValue("prmoote_id_to", "{$data.promote_id |default= 0}");
$('#submit').click(function () {
$('#form').submit();
});
$("#agree").on("click",function(){
var id = $(this).parents(".new_submit").data("id");
var url= "{:U('PromoteCoin/offlineAgree')}"+"&ids[]="+id;
$.get(url, function(result){
if(result.status == 1){
layer.msg(result.info, {
icon: 1,
time: 1000 //2秒关闭如果不配置默认是3秒
}, function(){
window.location.reload()
});
}
});
})
$("#reject").on("click",function(){
var id = $(this).parents(".new_submit").data("id");
var url= "{:U('PromoteCoin/offlineReject')}"+"&ids[]="+id;
$.get(url, function(result){
if(result.status == 1){
layer.msg(result.info, {
icon: 1,
time: 1000 //2秒关闭如果不配置默认是3秒
}, function(){
window.location.reload()
});
}
});
// window.location.href = "{:U('PromoteCoin/offlineReject')}"+"&ids[]="+id;
})
$(function () {
});
</script>
</block>

@ -31,10 +31,9 @@
<div class="cf main-place top_nav_list navtab_list">
<ul class="tabnav1711 fr jstabnav">
<li data-tab="tab1" class="current"><a href="javascript:void(0);">基本信息</a></li></li>
<li data-tab="tab2" ><a href="javascript:void(0);">结算信息</a></li>
<li data-tab="tab1" class="current"><a href="javascript:void(0);">新增测试账号</a></li></li>
</ul>
<h3 class="page_title">编辑推广员</h3>
<h3 class="page_title">新增测试账号</h3>
<p class="description_text">说明:此功是查看推广员的基础信息</p>
</div>
@ -152,7 +151,7 @@
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Promote/lists')}');
highlight_subnav('{:U('testResource/index')}');
Think.setValue("game_type_id", {$data.game_type_id|default = 0});
Think.setValue("category", {$data.category|default = 0});
Think.setValue("ba_id", {$data.ba_id|default = 0});

@ -107,7 +107,7 @@
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('Giftbag/lists')}');
highlight_subnav('{:U('testResource/index')}');
if ("{$Think.get.game_id}" =="") {
Think.setValue("game_id", {$data.game_id|default = 0});
}else{

@ -141,7 +141,7 @@
<script type="text/javascript">
//导航高亮
$('.side-sub-menu').eq(0).show();
highlight_subnav('{:U('TestResource/index')}');
highlight_subnav('{:U('testResource/index')}');
$('#submit').click(function(){
$('#form').submit();
});

@ -440,7 +440,7 @@
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据');
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('apply','','')}" + '/id/' + param;
@ -448,4 +448,7 @@
});
</script>
<style>
.textColor .layui-layer-content{color: #ffffff;background:#000; opacity: 0.8;text-align: center}
</style>
</block>

@ -183,14 +183,14 @@
$('.froze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认冻结帐号?', {icon: 3, title:'提示'}, function(index){
layer.confirm('是否确认冻结帐号?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/freezeSupport')}",
data: {support_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
layer.msg(response.msg, {time: 1000}, function() {
layer.msg(response.msg, {time: 1000,skin:'msgClolor'}, function() {
window.location.href = window.location.href
})
}
@ -202,14 +202,14 @@
$('.unfroze-btn').on({
click: function() {
var id = $(this).parents('tr').eq(0).attr('data-id')
layer.confirm('是否确认启用帐号?', {icon: 3, title:'提示'}, function(index){
layer.confirm('是否确认启用帐号?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/unfreezeSupport')}",
data: {support_id: id},
type: 'post',
dataType: 'json',
success: function(response) {
layer.msg(response.msg, {time: 1000}, function() {
layer.msg(response.msg, {time: 1000,skin:'msgClolor'}, function() {
window.location.href = window.location.href
})
}
@ -222,7 +222,7 @@
click: function() {
var id = $(this).attr('data-id')
console.log(id);
layer.confirm('是否确认重置账号密码?', {icon: 3, title:'提示'}, function(index){
layer.confirm('是否确认重置账号密码?', {icon: 3, title:'提示',skin:'textColor'}, function(index){
$.ajax({
url: "{:U('TestResource/rechangePassward')}",
data: {support_id: id},
@ -230,7 +230,7 @@
dataType: 'json',
success: function(response) {
console.log(response)
layer.confirm(response.msg, {icon: 3, title:'提示'}, function() {
layer.confirm(response.msg, {icon: 3, title:'提示',skin:'textColor'}, function() {
window.location.href = window.location.href
})
}
@ -333,6 +333,7 @@
</script>
<script type="text/javascript">
//点击字母按照条件按钮筛选
@ -472,7 +473,7 @@
});
param = str.join(',');
} else {
layer.msg('请选择要操作的数据');
layer.msg('请选择要操作的数据',{skin:'textColor'});
return false;
}
var url = "{:U('apply','','')}" + '/id/' + param;
@ -480,4 +481,8 @@
});
</script>
<style>
.textColor .layui-layer-content{color: #000000;}
.msgClolor .layui-layer-content{color: #ffffff;background:#000; opacity: 0.8;text-align: center}
</style>
</block>

@ -100,24 +100,48 @@ class PromoteController extends BaseController
$page = $this->ajax_page($count, 20, 'seach');
$this->assign("_page", $page);
$user_count = M("user", "tab_")->where("promote_id=" . get_pid())->count();
$total_money = $this->pay_total(0, 0);
$today_add_user_money = $this->pay_total(1);
$month_add_user_money = $this->pay_total(3);
$promote = M("promote","tab_")->field("parent_id,grand_id")->where("id=".get_pid())->find();
$promoteId = array(get_pid());
if ($promote['parent_id'] == 1) {
$promoteId = M("promote", "tab_")->field('id')->where("parent_id=" . get_pid()." or grand_id=". get_pid())->select();
$promoteId = array_column($promoteId,'id');
array_push($promoteId,get_pid());
} elseif ($promote['parent_id'] > 0 && $promote['grand_id'] == 0) {
$promoteId = M("promote", "tab_")->field('id')->where("parent_id=" . get_pid())->select();
$promoteId = array_column($promoteId,'id');
array_push($promoteId,get_pid());
}
$promoteId = implode(',',$promoteId);
if ($promoteId) {
$user_count = M("user", "tab_")->where("promote_id IN({$promoteId})")->count();
} else {
$user_count = 0;
}
$total_money = $this->pay_total(0, 0,$promoteId);
$today_add_user_money = $this->pay_total(1,1,$promoteId);
$month_add_user_money = $this->pay_total(3,1,$promoteId);
$yesterday_start = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
$yesterday_end = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$yesterday_user_regist_count = M("user", "tab_")->where(
array("promote_id" => get_pid(),
array("promote_id" => array('in',$promoteId),
"register_time" => array("BETWEEN", array($yesterday_start, $yesterday_end))))
->count();
$yesterday_total_money = $this->pay_total(5, 0);
$yesterday_regist_user_count = M("user", "tab_")
->where(array("promote_id" => get_pid(),
"register_time" => array("BETWEEN", array($yesterday_start, $yesterday_end))))
$yesterday_total_money = $this->pay_total(5, 0,$promoteId);
$today_start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$today_end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
$today_regist_user_count = M("user", "tab_")
->where(array("promote_id" => array('in',$promoteId),
"register_time" => array("BETWEEN", array($today_start, $today_end))))
->count();
$today_total_money = $this->pay_total(1, 0,$promoteId);
$yesterday_total_money = $this->pay_total(1, 0);
$this->assign("user_count", $user_count);
$this->assign("total_money", $total_money);
$this->assign("today_add_user_money", $today_add_user_money);
@ -126,6 +150,8 @@ class PromoteController extends BaseController
$this->assign("yesterday_total_money", $yesterday_total_money);
$this->assign("yesterday_regist_user_count", $yesterday_regist_user_count);
$this->assign("yesterday_total_money", $yesterday_total_money);
$this->assign("today_regist_user_count", $today_regist_user_count);
$this->assign("today_total_money", $today_total_money);
$this->assign("menu_list", $quick_menu_list);
$this->assign("gg_list", $gg_list);
@ -141,7 +167,7 @@ class PromoteController extends BaseController
$this->display();
}
private function pay_total($type = 0, $newadd = 1)
private function pay_total($type = 0, $newadd = 1,$promoteId="")
{
if ($_REQUEST['promote_id'] === null || $_REQUEST['promote_id'] === '0') {
$map['parent_id'] = get_pid();
@ -155,7 +181,7 @@ class PromoteController extends BaseController
} else {
$ids = array($_REQUEST['promote_id']);
}
$where['spend.promote_id'] = array('in', $ids);
$where['spend.promote_id'] = array('in', $promoteId);
$where['spend.pay_status'] = 1;
$where['spend.is_check'] = array('NEQ', 2);
switch ($type) {
@ -206,6 +232,7 @@ class PromoteController extends BaseController
$where['user.register_time'] = array("BETWEEN", array($start, $end));
}
}
if ($newadd == 1) {
$total = M('spend as spend', "tab_")->field("SUM(spend.pay_amount) as amount")->join("right join tab_user user on user.id=spend.user_id")->where($where)->select();
} else {
@ -860,6 +887,15 @@ class PromoteController extends BaseController
$this->ajaxReturn(array('status' => -1, 'msg' => '身份证格式错误'));
}
}
if (mb_strlen($_POST['account']) < 6 || mb_strlen($_POST['account']) > 15) {
$this->error('账号长度为6-15个字符', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
return false;
}
if (mb_strlen($_POST['real_name']) < 2 || mb_strlen($_POST['real_name']) > 4) {
$this->error('姓名长度为2-4个字符', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0))));
return false;
}
$res = $user->promote_add($_POST);
if (is_numeric($res)) {

@ -101,7 +101,7 @@ class QueryController extends BaseController
empty(I('sdk_version')) || $map['tab_game.sdk_version'] = I('sdk_version');
empty(I('server_id')) || $map['tab_spend.server_id'] = I('server_id');
empty(I('game_player_name')) || $map['tab_spend.game_player_name'] = ['like', '%' . I('game_player_name') . '%'];
empty(I('user_account')) || $map['tab_spend.user_account'] = ['like', '%' . I('user_account') . '%'];
empty(I('user_account')) || $map['tab_spend.user_account'] = I('user_account');
empty(I('order_number')) || $map['tab_spend.order_number'] = I('order_number');
$map['tab_spend.pay_status'] = 1;
$map['tab_spend.is_check'] = ['neq', 2];
@ -231,7 +231,7 @@ class QueryController extends BaseController
$map['tab_user.register_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]];
}
empty(I('account')) || $map['tab_user.account'] = ['like', '%' . I('account') . '%'];
empty(I('account')) || $map['tab_user.account'] = I('account');
empty(I('id')) || $map['tab_user.id'] = intval(I('id'));
$data = M('User', 'tab_')
@ -1155,7 +1155,9 @@ class QueryController extends BaseController
$newUserNumData = $userPlayInfoModel
->field('tab_user_play_info.create_time,count(distinct tab_user_play_info.user_id) as num')
->join($join)
->where($userPlayInfoWhere2)
->where($map)
->having('tab_user_play_info.create_time between ' . $begTime . ' and ' . ($endTime + 86399))
->order('tab_user_play_info.id')
->find();
@ -1163,7 +1165,9 @@ class QueryController extends BaseController
$newDeviceData = $userPlayInfoModel
->field('tab_user_play_info.create_time,count(distinct tab_user_play_info.create_device_number) as num')
->join($join)
->where($userPlayInfoWhere2)
->where($map)
->having('tab_user_play_info.create_time between ' . $begTime . ' and ' . ($endTime + 86399))
->order('tab_user_play_info.id')
->find();
@ -1171,7 +1175,9 @@ class QueryController extends BaseController
$newIpNumData = $userPlayInfoModel
->field('tab_user_play_info.create_time,count(distinct tab_user_play_info.create_ip) as num')
->join($join)
->where($userPlayInfoWhere2)
->where($map)
->having('tab_user_play_info.create_time between ' . $begTime . ' and ' . ($endTime + 86399))
->order('tab_user_play_info.id')
->find();

@ -37,13 +37,13 @@
<tr>
<td class="l"><span class="req">*</span>帐号:</td>
<td class="r">
<input type="text" class="name input-txt txt" name="account" id="account" placeholder="请输入帐号">
<input type="text" class="name input-txt txt" name="account" id="account" maxlength="15" minlength="6" placeholder="请输入帐号">
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>姓名:</td>
<td class="r">
<input type="text" class="name input-txt txt" name="real_name" id="real_name" placeholder="请输入姓名">
<input type="text" class="name input-txt txt" name="real_name" id="real_name" maxlength="4" minlength="2" placeholder="请输入姓名">
</td>
</tr>
<tr>
@ -141,8 +141,14 @@
if($('#account').val()==""){
return json_data = {'status':0,'msg':'子渠道账号不能为空'}
}
if($.trim($('#account').val()).length < 6){
return json_data = {'status':0,'msg':'子渠道账号不能小于6位字符'}
// if($.trim($('#account').val()).length < 6){
// return json_data = {'status':0,'msg':'子渠道账号不能小于6位字符'}
// }
if($.trim($('#account').val()).length < 6 || $.trim($('#account').val()).length > 15){
return json_data = {'status':0,'msg':'子渠道账号长度为6-15位字符'}
}
if($.trim($('#real_name').val()).length < 2 || $.trim($('#real_name').val()).length > 4){
return json_data = {'status':0,'msg':'子渠道姓名长度为2-4位字符'}
}
if($('#password').val()==""){
return json_data = {'status':0,'msg':'子渠道密码不能为空'}

@ -13,8 +13,8 @@
<ul style="margin-top: 10px">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div> <div class="text text2"><p>昨日注册用户</p><span>{$yesterday_user_regist_count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div> <div class="text text1"><p>昨日充值金额</p><span>¥{$yesterday_total_money}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>今日注册用户</p><span>{$yesterday_regist_user_count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>今日充值金额</p><span>¥{$yesterday_total_money}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div> <div class="text text3"><p>今日注册用户</p><span>{$today_regist_user_count}</span></div> </li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div> <div class="text text5"><p>今日充值金额</p><span>¥{$today_total_money}</span></div> </li>
</ul>
</div>
<div class="index-tab-list">

@ -48,7 +48,7 @@
</if>
</div>
<?php
$whiteList = [1, 8];
$whiteList = [1, 8, 2];
$isOpenQuery = in_array($loginer['id'], $whiteList) || in_array($loginer['parent_id'], $whiteList) || in_array($loginer['grand_id'], $whiteList) ? true : false;
?>
<?php if($isOpenQuery):?>

@ -203,7 +203,7 @@
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.user_account}</td>
<td title="玩家ID{$vo.user_id}">{$vo.user_account}</td>
<td>{$vo.order_number}</td>
<td>{:get_pay_way($vo['pay_way'])}</td>
<td>{$vo.pay_amount}</td>

@ -124,7 +124,7 @@
<else/>
<volist name="listData" id="vo">
<tr class="num2">
<td>{$vo.account}</td>
<td title="玩家ID{$vo.id}">{$vo.account}</td>
<td>{$vo.promote_account}({$vo.pro_real_name})</td>
<td>{$vo.device_number}</td>
<td>{$vo.register_time|date='Y-m-d H:i:s',###}</td>

@ -370,7 +370,7 @@ class UserController extends BaseController
break;
}
if (!preg_match("/^1[34578]\d{9}$/", $phone)) {
if (!preg_match("/^1[345789]\d{9}$/", $phone)) {
echo json_encode(['status' => 0, 'msg' => '手机号格式不正确']);
die;
}

@ -40,7 +40,7 @@ class UserController extends BaseController
//1.登录成功,验证在本地是否有此账号
$user_res = M('user', 'tab_') -> where(['account' => $uc_username]) -> find();
if (!empty($user_res)) {//本地存在账号,验证密码直接登录
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version']);#调用登录
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'],$user['unique_code']);#调用登录
$res_msg = array();
switch ($result) {
case - 1:
@ -112,7 +112,7 @@ class UserController extends BaseController
if ($res > 0) {
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version']);#调用登录
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'],$user['unique_code']);#调用登录
$res_msg = array();
switch ($result) {
case - 1:
@ -173,7 +173,7 @@ class UserController extends BaseController
} elseif ($uc_uid == - 1) {
//用户不存在,验证本地用户账号密码
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version']);#调用登录
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'],$user['unique_code']);#调用登录
$res_msg = array();
switch ($result) {
case - 1:
@ -236,7 +236,7 @@ class UserController extends BaseController
}
#实例化用户接口
$userApi = new MemberApi();
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version']);#调用登录
$result = $userApi -> login_sdk($user["account"], $user['password'], 1, $user["game_id"], get_game_name($user["game_id"]), $user['sdk_version'],$user['unique_code']);#调用登录
$res_msg = array();
switch ($result) {
@ -1196,7 +1196,13 @@ class UserController extends BaseController
$data['create_ip'] = get_client_ip();
// $data['create_device_number'] = time();
$user_play->add($data);
// 修改重复插入问题 增加唯一索引 记录重复插入异常
try {
$user_play->add($data);
} catch (\Exception $e) {
Log::write('Duplicate Exception:' .json_encode($e->getMessage()), Log::ERR);
}
$this->updateLoginRecord($data);
}

@ -111,12 +111,12 @@ class MemberApi extends Api{
public function login_($account, $password,$type=2,$game_id=0,$game_name='',$sdk_version){
return $this->model->login_1($account, $password,$type,$game_id,$game_name,$sdk_version);
}
public function login_sdk($account, $password,$type=2,$game_id=0,$game_name='',$sdk_version){
return $this->model->login_sdk($account, $password,$type,$game_id,$game_name,$sdk_version);
public function login_sdk($account, $password,$type=2,$game_id=0,$game_name='',$sdk_version,$unique_code=''){
return $this->model->login_sdk($account, $password,$type,$game_id,$game_name,$sdk_version,$unique_code);
}
/**
*修改数据
*/

@ -180,3 +180,5 @@ MODIFY COLUMN `promote_account` varchar(30) BINARY CHARACTER SET utf8 COLLATE u
-- 2019-10-22 cxj
UPDATE `sys_model` SET list_grid = "id:编号\r\nsort:排序\r\ngame_name:游戏名称\r\ngame_type_name:游戏类型\r\ngame_type_id:游戏类型\r\ngame_appid:游戏appid\r\ngame_status|get_info_status:显示状态\r\npay_status|get_info_status:支付状态\r\nicon:图片id\r\napply_status:审核状态\r\ncategory:开放类型\r\nrecommend_status|get_info_status*1:推荐状态\r\nrelation_game_id:关联游戏id\r\nrelation_game_name:关联游戏名称\r\nsdk_version:运营平台\r\ndevelopers:开发商\r\ndow_num:下载\r\nonline_status:上线状态\r\ncreate_time:创建时间\r\nserver_type:混服管理\r\nid:操作:[EDIT]&id=[id]|编辑,Game/del?ids=[id]|删除" where id = 15;
-- 2019-10-23 zcl
ALTER TABLE `tab_coin_pay_order` CHANGE COLUMN `currency_num` `coin_num` int(11) NULL DEFAULT 0 COMMENT '代币数量' AFTER `auditor_time`;
Loading…
Cancel
Save