Merge branch 'feature/admin_optimize' of 47.111.118.107:wmtx/platform into feature/admin_optimize

master
chenzhi 5 years ago
commit 29618ce878

@ -854,3 +854,11 @@ function convertAmountToCn($num) {
return $daxie . '整';
}
/**
* @param $phone
* @return false|int
*/
function checkPhone($phone) {
return preg_match("/^1[3456789]\d{9}$/",$phone);
}

@ -1194,11 +1194,10 @@ class QueryController extends ThinkController
$this->ajaxReturn(['msg' => $msg]);
}
public function set_withdraw_status()
public function set_withdraw_status($status = 1)
{
$withdraw = M('withdraw', "tab_");
$ids = I('ids', 0);
$status = 1;
if (empty($ids)) {
$this->error('参数异常');
}
@ -1207,14 +1206,21 @@ class QueryController extends ThinkController
} else {
$map['id'] = $ids;
}
$map['status'] = 0;
switch ($status) {
case 1:
$map['status'] = 0;
break;
case 2:
$map['status'] = 1;
break;
}
$save['audit_time'] = time();
$save['status'] = $status;
$res = $withdraw->where($map)->save($save);
if ($res === false) {
$this->error('审核失败');
$this->error('操作失败');
} else {
$this->success('审核成功', U('withdraw'));
$this->success('操作成功', U('withdraw'));
}
}

@ -233,6 +233,18 @@ class StatementMangementController extends ThinkController
public function rewardManageList($row = 10, $p = 1)
{
$map = [];
if (!empty(I("game_name"))) {
$game_ids = array_column(getGameByName(I("game_name")), 'id');
if ($game_ids) {
$map['relation_game_id'] = ['in', $game_ids];
}
}
if (!empty(I('partner_id'))) {
$map['company_id'] = I('partner_id');
}
if (!empty(I('account'))) {
$map['accounts'] = ['like', '%' . I('account') . '%'];
}
$list = M('reward_record', 'tab_')->where($map)->page($p, $row)->select();
if ($list) {
$companys[1] = array_column(M('partner', 'tab_')->field('id, partner as name')->select(), 'name', 'id');

@ -726,7 +726,7 @@ class ToolController extends ThinkController {
$this->error('公司名称已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
if(!checkPhone(I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$res2 = $model->where(['link_phone' => I('link_phone')])->getField('id');
@ -798,7 +798,7 @@ class ToolController extends ThinkController {
$this->error('公司名称已存在');
}
if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) {
if(!checkPhone(I('link_phone'))) {
$this->error('联系电话格式不正确');
}
$res2 = $model->where([

@ -219,9 +219,7 @@
<td>{$record.status_text}</td>
<td>{$record.respond}</td>
<td>
<if condition="$record['status'] eq 2">
<a href="{:U('downloadProve', ['id'=>$record['id']])}">汇款证明</a>
<elseif condition="$record['status'] eq -1"/>
<if condition="$record['status'] eq -1">
<span class="renew-review" data-id="{$record['id']}" style="color: #0bb20c;cursor: pointer;">重新审核</span>
</if>
<if condition="$record['status'] eq -1 or $record['status'] eq 0">

@ -59,6 +59,7 @@
<a class="ajax-post" target-form="ids" url="{:U('set_withdraw_status')}"><span class="button_icon button_icon12"></span>通 过</a>
<a class="agree" data-id="ids"><span class="button_icon button_icon13"></span>驳 回</a>
<a href="{:U('autoReview')}"><span class="button_icon button_icon9 "></span>自动审核管理</a>
<a class="ajax-post" target-form="ids" url="{:U('set_withdraw_status', array('status' => 2))}" style="border: 1px solid #3C95C8;background-color: #3C95C8;background-image: initial"><span style="margin-left: 10px;float: initial;color: #fff;">确认汇款</span></a>
</div>
</div>
</empty>
@ -187,7 +188,7 @@
<a class="ajax-get" url="{:U('set_withdraw_status',array('ids'=>$data['id']))}">通过</a>
<a class="agree" data-id="{$data['id']}">驳回</a>
<elseif condition="$data.status eq 1"/>
<a class="upload-transfer-proof" data-id="{$data['id']}">上传汇款证明</a>
<a class="ajax-get" url="{:U('set_withdraw_status',array('ids'=>$data['id'], 'status' => 2))}">确认汇款</a>
</if>
</div>
</td>

@ -52,12 +52,54 @@
<p class="description_text">上下游奖罚记录管理</p>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class="butn" href="{:U('StatementMangement/rewardManageSave')}">添加</a>
</div>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<div class="input-list input-list-server search_label_rehab">
<select id="partner_id" name="partner_id" class="select_gallery" style="width:120px;">
<option value="">请选择合作公司</option>
<volist name=":getPartner()" id="vo">
<option partner-id="{$vo.id}" value="{$vo.id}" <if condition="$vo.id eq $_GET['partner_id']">selected=selected</if>>{$vo.partner}</option>
</volist>
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">请选择游戏</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <if condition="$vo.game_name eq I('game_name')">selected</if>
>{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<input type="text" name="account" placeholder="账号" class="" value="{:I('account')}"/>&nbsp;
</div>
<input type="hidden" name="from" value="{$_GET['from']}"/>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('StatementMangement/rewardManageList','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
<!-- <a class="sch-btn" href="javascript:history.go(-1)" style="background:#fff;color: #000;border: #000 solid 1px;width: 100px">返回</a>-->
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
@ -150,5 +192,54 @@
</volist>
$(".select_gallery").select2();
highlight_subnav("{:U('StatementMangement/rewardManageList')}");
function get_game_list()
{
var game_name = $('#game_name').val();
var partner_id = $("#partner_id option:selected").val();
var sdk_type = $("#sdk_version1 option:selected").val();
$.ajax({
url:"{:U('Finance/getGameList')}",
type:"post",
data:{
partner_id:partner_id,
sdk_type:sdk_type
},
dataType:'json',
success:function(data){
var str = "<option value=''>请选择游戏</option>";
for (var i in data){
str += "<option value='"+data[i].game_name+"'"+(game_name && data[i].game_name == game_name?'selected':'')+">"+data[i].game_name+"</option>"
}
// console.log(str);
$("#game_name").empty();
$("#game_name").append(str);
$("#game_name").select2();
}
})
}
$(function(){
$("#partner_id").change(function(){
get_game_list();
});
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
console.log(url);
query += "&" + $('.jssearch').find('select').serialize();
console.log(query);
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.replace(url);
});
});
</script>
</block>

@ -1124,10 +1124,10 @@ CREATE TABLE `tab_reward_record` (
`relation_game_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '游戏id',
`content` varchar(1000) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '事件内容',
`money` double(11,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '金额',
`reward_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖惩时间',
`remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`creater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建者ID',
`reward_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖惩时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

Loading…
Cancel
Save