后台用户管理

This commit is contained in:
2016-12-02 10:12:43 +08:00
parent 3d9cbcfa22
commit e2910d287a
2 changed files with 10 additions and 5 deletions

View File

@@ -23,6 +23,9 @@
<th>
<span>手机号码</span>
</th>
<th>
<span>授权分组</span>
</th>
<th>
<span>创建时间</span>
</th>
@@ -46,6 +49,7 @@
<td>
<span >{$item['mobile']}</span>
</td>
<td>{$item['group_list']|implode=',',###}</td>
<td>{$item['reg_time']|date='Y-m-d',###}</td>
<td class="text-center">
{if condition="$item['status']"}

View File

@@ -72,6 +72,11 @@ class User extends Base{
return md5($value.$data['salt']);
}
protected function getGroupListAttr($value, $data){
$sql = db('AuthGroupAccess')->where('uid', $data['uid'])->fetchSql(true)->column('group_id');
return db('AuthGroup')->where('id in ('.$sql.')')->column('title', 'id');
}
/**
* 用户登录模型
*/
@@ -175,11 +180,7 @@ class User extends Base{
public function getInfo($uid){
$data = $this->where(array('uid'=>$uid))->find();
if ($data) {
return $data->toArray();
}else{
return false;
}
return $data;
}
/**