Merge branch 'hotfix/add_bans_type' into dev

master
ELF 5 years ago
commit cf31d4cc57

@ -1238,6 +1238,24 @@ class MemberController extends ThinkController
}
$list = M('device_bans', 'tab_')->where($map)->page($p, $row)->select();
$count = M('device_bans', 'tab_')->where($map)->count();
if (!empty($list)) {
foreach ($list as &$item) {
switch ($item['type']) {
case '1':
$item['type_name'] = '设备号';
break;
case '2':
$item['type_name'] = 'IP';
break;
case '3':
$item['type_name'] = '落地页链接';
break;
case '4':
$item['type_name'] = '下载链接';
break;
}
}
}
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
@ -1256,9 +1274,15 @@ class MemberController extends ThinkController
if (empty($type) || empty($tag)) {
return $this->error("请填写完整信息");
}
if (\in_array($type, [3,4]) && !preg_match("/^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/i", $tag)) {
return $this->error("请填写正确的url地址");
}
if ($type == 2 && !preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag)) {
return $this->error("请填写正确的ip信息如127.0.0.1");
}
if ($type == 1 && (preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag) || preg_match("/^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/i", $tag))) {
return $this->error("请填写正确的设备信息");
}
$map['type'] = $type;
$map['tag'] = $tag;
$item = M('device_bans', 'tab_')->where($map)->find();

@ -11,10 +11,13 @@
<select id="type" name="type" class="select_gallery">
<option value="1">设备号</option>
<option value="2">IP</option>
<option value="3">落地页链接</option>
<option value="4">下载链接</option>
</select>
</li>
<li>
<label>详情</label><input type="text" name="tag" class="" placeholder="风控标识" value="{:I('tag')}">
<label>详情</label>
<textarea name="tag" class="" placeholder="风控标识" >{:I('tag')}</textarea>
</li>
<li>
<label>&nbsp;</label><input type="submit" id="submit" value="确认保存" target-form="form-horizontal" class="form_btn ajax-post">

@ -48,6 +48,8 @@
<option value="">类型</option>
<option value="1" <?php echo I('type') == 1 ? "selected" : "" ?> >设备号</option>
<option value="2" <?php echo I('type') == 2 ? "selected" : "" ?> >IP</option>
<option value="3" <?php echo I('type') == 3 ? "selected" : "" ?>>落地页链接</option>
<option value="4" <?php echo I('type') == 4 ? "selected" : "" ?>>下载链接</option>
</select>
</div>
<div class="input-list">
@ -95,7 +97,7 @@
<tr>
<!-- <td><input class="ids" type="checkbox" value="{$data['id']}" name="ids"></td> -->
<td>{$data.id}</td>
<td><?php echo $data['type'] == 1 ? "设备号" : "IP";?></td>
<td>{$data.type_name}</td>
<td>{$data.tag}</td>
<td>{:get_admin_nickname($data['operator_id'])}</td>
<td>{$data.create_time|date='Y-m-d H:i:s',###}</td>

@ -141,7 +141,8 @@ class HomeController extends Controller
if ($code == '' && ($gameId == 0 || $promoteId == 0)) {
$this->error('访问错误');
}
$blackList = [];
$blackList = M('device_bans', 'tab_')->where(['type' => 3])->getField('tag', true);
if (in_array($code, $blackList) || in_array('gid/' . $gameId . '/pid/' . $promoteId, $blackList)) {
$this->error('该链接已被禁');
}

@ -30,12 +30,12 @@ class PackageController extends Controller
$code = I('code', '');
$gameId = I('game_id', 0);
$promoteId = I('promote_id', 0);
// var_dump($gameId, $promoteId);die();
if ($code == '' && ($gameId == 0 || $promoteId == 0)) {
$this->redirect("package/downloadError", ['message' => '访问错误']);
}
$blackList = [];
$blackList = M('device_bans', 'tab_')->where(['type' => 4])->getField('tag', true);
if (in_array($code, $blackList) || in_array('game_id/' . $gameId . '/promote_id/' . $promoteId, $blackList)) {
$this->redirect("package/downloadError", ['message' => '该链接已被禁']);
}

@ -218,7 +218,6 @@ class UserController extends BaseController
public function bindingPromote($promoteId, $account)
{
Log::write('cxj_login:' . date('Y-m-d H:i:s') . ' ---- ' . $promoteId.'INFO');
if ($promoteId > 0) {
$wherePromote['id'] = $promoteId;
$promoteData = M('Promote', 'tab_')->field('id,account')->where($wherePromote)->find();
@ -229,7 +228,6 @@ class UserController extends BaseController
$whereUser['mobile_phone'] = $account;
$userData = M('User', 'tab_')->where($whereUser)->find();
Log::write('cxj_login:' . date('Y-m-d H:i:s') . ' ---- userData' . json_encode($userData) .'INFO');
if (!empty($userData)) {
if (empty($userData['promote_id'])) {
$saveData['promote_id'] = $promoteId;
@ -404,7 +402,11 @@ class UserController extends BaseController
$pgInfo = strval(cookie('pgInfo'));
Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO');
if (isset($_POST['promote_id']) && !empty($_POST['promote_id'])) {
$pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, $_POST['promote_id'], $_POST['promote_account'], $sex, $nickname, $head_img);
Log::write('cxj_register:' . date('Y-m-d H:i:s') . ' ---- post' . json_encode($_POST) .' --- INFO');
$thisPromoteAccount = M('promote', 'tab_')->where(array('id' => $_POST['promote_id']))->getField('account');
$thisPromoteAccount = !empty($thisPromoteAccount) ? $thisPromoteAccount : '自然注册';
$promoteAccount = isset($_POST['promote_account']) ? $_POST['promote_account'] : $thisPromoteAccount;
$pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, $_POST['promote_id'], $promoteAccount, $sex, $nickname, $head_img);
} else {
$pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, '', '', $sex, $nickname, $head_img);
}

@ -59,14 +59,7 @@
var tis = this,that = $(tis);
if (that.hasClass('disabled')) {return false;}
var mobile = $.trim($('#mobile').val());
var promoteId = parseInt("{:I('get.pid',0)}");
var gameId = parseInt("{:I('get.gid',0)}");
var data = {};
if (promoteId > 0 && gameId > 0) {
data = {'phone':mobile,'promote_id':promoteId,'game_id':gameId};
} else {
data = {'phone':mobile};
}
var data = {'phone':mobile};
if (mobile) {
if (/^1[0-9]{10}$/.test(mobile)) {
$.ajax({

@ -608,4 +608,8 @@ promote_account_to:修改后账号
remark:
create_time:
op_account:
order_time:' WHERE `id` = 29;
order_time:' WHERE `id` = 29;
--
ALTER TABLE `tab_device_bans`
MODIFY COLUMN `type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型 0未知 1设备号 2IP 3落地页链接 4下载链接' AFTER `tag`;

Loading…
Cancel
Save