后台用户权限问题
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
// 应用公共文件
|
||||
use think\facade\Session;
|
||||
use app\model\Member;
|
||||
use think\facade\Session;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -33,18 +33,23 @@ function form($field = [], $data = []) {
|
||||
* @param array $param 参数
|
||||
* @return mixed
|
||||
*/
|
||||
function ad($name, $param = []){
|
||||
function ad($name, $param = []) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function parse_field_bind(){
|
||||
|
||||
function parse_field_bind() {
|
||||
|
||||
}
|
||||
|
||||
function time_format($value){
|
||||
function time_format($value) {
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
// 不区分大小写的in_array实现
|
||||
function in_array_case($value, $array) {
|
||||
return in_array(strtolower($value), array_map('strtolower', $array));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户端IP地址
|
||||
* @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字
|
||||
@@ -101,10 +106,10 @@ function msubstr($str, $start = 0, $length, $charset = "utf-8", $suffix = true)
|
||||
$slice = '';
|
||||
}
|
||||
} else {
|
||||
$re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
|
||||
$re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
|
||||
$re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/";
|
||||
$re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
|
||||
$re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
|
||||
$re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
|
||||
$re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
|
||||
preg_match_all($re[$charset], $str, $match);
|
||||
$slice = join("", array_slice($match[0], $start, $length));
|
||||
}
|
||||
@@ -156,7 +161,7 @@ function parse_config_attr($string) {
|
||||
$value = array();
|
||||
foreach ($array as $val) {
|
||||
list($k, $v) = explode(':', $val);
|
||||
$value[$k] = $v;
|
||||
$value[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
$value = $array;
|
||||
@@ -222,7 +227,6 @@ function format_bytes($size, $delimiter = '') {
|
||||
return round($size, 2) . $delimiter . $units[$i];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取附件信息
|
||||
* @param int $cover_id
|
||||
@@ -238,7 +242,7 @@ function get_attach($id, $field = false, $is_list = false) {
|
||||
$map[] = ['id', 'IN', explode(",", $id)];
|
||||
$picture = \app\model\Attach::where($map)->column("*", "id");
|
||||
return $picture;
|
||||
}else{
|
||||
} else {
|
||||
$map[] = ['id', '=', $id];
|
||||
$picture = \app\model\Attach::where($map)->find();
|
||||
if ($field == 'path') {
|
||||
|
||||
Reference in New Issue
Block a user