|
|
|
@ -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();
|
|
|
|
|