新增风控标识

master
yulingwei 5 years ago
parent 820f80f066
commit fa9d40f87a

@ -1231,6 +1231,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);
@ -1249,9 +1267,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>

@ -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