解决列表定义中linux下无法使用格式化函数的bug
This commit is contained in:
@@ -98,6 +98,21 @@ function get_username($uid = 0) {
|
|||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID获取昵称
|
||||||
|
* @param integer $uid 用户ID
|
||||||
|
* @return string 用户名
|
||||||
|
*/
|
||||||
|
function get_nickname($uid = 0) {
|
||||||
|
static $list;
|
||||||
|
if (!($uid && is_numeric($uid))) {
|
||||||
|
//获取当前登录用户名
|
||||||
|
return session('userInfo.nickname');
|
||||||
|
}
|
||||||
|
$name = Member::where('uid', $uid)->value('nickname');
|
||||||
|
return $name ? $name : '未知';
|
||||||
|
}
|
||||||
|
|
||||||
function avatar($uid, $size = 'middle') {
|
function avatar($uid, $size = 'middle') {
|
||||||
return request()->domain() . '/static/common/images/default_avatar_' . $size . '.jpg';
|
return request()->domain() . '/static/common/images/default_avatar_' . $size . '.jpg';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ class Content extends Base {
|
|||||||
$map[] = ['title', 'LIKE', '%'.$param['keyword'].'%'];
|
$map[] = ['title', 'LIKE', '%'.$param['keyword'].'%'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array(
|
$list = $this->model->where($map)->order($order)->paginate($this->request->pageConfig);
|
||||||
'query' => $this->request->param(),
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->data = array(
|
$this->data = array(
|
||||||
'grid' => $this->modelInfo['grid_list'],
|
'grid' => $this->modelInfo['grid_list'],
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class Form extends \think\Model {
|
|||||||
$list[$field] = ['field' => $field, 'title' => $title];
|
$list[$field] = ['field' => $field, 'title' => $title];
|
||||||
if (strrpos($title, "|")) {
|
if (strrpos($title, "|")) {
|
||||||
$title = explode("|", $title);
|
$title = explode("|", $title);
|
||||||
$list[$field] = ['field' => $field, 'title' => $title[0], 'format' => $title[1]];
|
$list[$field] = ['field' => $field, 'title' => $title[0], 'format' => trim($title[1])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class Model extends \think\Model{
|
|||||||
$list[$field] = ['field' => $field, 'title' => $title];
|
$list[$field] = ['field' => $field, 'title' => $title];
|
||||||
if (strrpos($title, "|")) {
|
if (strrpos($title, "|")) {
|
||||||
$title = explode("|", $title);
|
$title = explode("|", $title);
|
||||||
$list[$field] = ['field' => $field, 'title' => $title[0], 'format' => $title[1]];
|
$list[$field] = ['field' => $field, 'title' => $title[0], 'format' => trim($title[1])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user