作者 杨育虎
1 个管道 的构建 通过 耗费 3 秒

Merge remote-tracking branch 'origin/master'

... ... @@ -11,6 +11,9 @@
namespace app\user\controller;
use app\admin\model\HospitalModel;
use app\admin\model\JobModel;
use app\user\model\UserModel;
use cmf\controller\AdminBaseController;
use think\Db;
... ... @@ -130,4 +133,33 @@ class AdminIndexController extends AdminBaseController
$this->error('数据传入失败!');
}
}
public function editUserInfo(){
$map['u.id']=input('id');
$User=new UserModel();
$user=$User->alias('u')
->field('u.*,u.id,h.name as hospital_name,o.name as office_name,u.user_login,j.name as job_name,u.describe,u.avatar,u.mobile,c.name as platform_name')
->join('hospital h','h.id=u.hospital',"LEFT")
->join('office o','u.office=o.id',"LEFT")
->join('job j','u.job=j.id',"LEFT")
->join('portal_category c','c.id=u.platform')
->where($map)
->find()
->toArray();
$Job=new JobModel();
$jobs=$Job->getJob()->toArray() ;
$Hospital=new HospitalModel();
$hospitals=$Hospital->getHospital()->toArray();
$platform=$Hospital->getPlatment()->toArray();
dump($user);
dump($hospitals);
dump($platform);
$this->assign('user',$user);
$this->assign('jobs',$jobs);
$this->assign('hospitals',$hospitals);
$this->assign('platforms',$platform);
return $this->fetch();
}
}
... ...
<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('rbac/index')}">{:lang('ADMIN_RBAC_INDEX')}</a></li>
<li class="active"><a>编辑信息</a></li>
</ul>
<form class="form-horizontal js-ajax-form margin-top-20" action="{:url('')}" method="post">
<div class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户姓名</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="name" value="{$user.user_login}">
</div>
</div>
<div class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户昵称</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="name" value="{$user.user_nickname}">
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">用户简介</label>
<div class="col-md-6 col-sm-10">
<textarea type="text" class="form-control" id="input-remark" name="describe">{$user.describe}</textarea>
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">联系电话</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="mobile" value="{$user.mobile}">
</div>
</div>
<div class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户头像</label>
<div class="col-md-6 col-sm-10">
<div style="text-align: center;">
<input type="hidden" name="avatar" id="thumbnail"
value="{$user.avatar|default=''}">
<a href="javascript:uploadOneImage('图片上传','#thumbnail');">
<if condition="empty($user.avatar)">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_preview_url($user.avatar)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
</div>
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">职位级别</label>
<div class="col-md-6 col-sm-10">
<select class="form-control valid" name="job" id="input-site_adminstyle" aria-invalid="false">
<volist name="jobs" id="job">
<option value="{$job.id}" selected="">{$job.name}</option>
</volist>
<option value="{$user.job}" selected="1">{$user.job_name}</option>
</select>
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在地区-省</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="province" value="{$user.province}">
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在地区-市</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="city" value="{$user.city}">
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在地区-区</label>
<div class="col-md-6 col-sm-10">
<input type="text" class="form-control" id="input-name" name="town" value="{$user.town}">
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在医院</label>
<div class="col-md-6 col-sm-10">
<select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
<volist name="hospitals" id="vo">
<option value="{$vo.id}" selected="">{$vo.name}</option>
</volist>
<option value="{$user.hospital}" selected="1">{$user.hospital_name}</option>
</select>
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在科室</label>
<div class="col-md-6 col-sm-10">
<select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
<option value="{$user.office}" selected="1">{$user.office_name}</option>
</select>
</div>
</div>
<div class="form-group">
<label for="input-remark" class="col-sm-2 control-label">所在平台</label>
<div class="col-md-6 col-sm-10">
<select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
<volist name="platforms" id="vo">
<option value="{$vo.id}" selected="">{$vo.name}</option>
</volist>
<option value="{$user.platform}" selected="1">{$user.platform_name}</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="id" value="{$user.id}"/>
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
<a class="btn btn-default" href="{:url('admin/rbac/index')}">{:lang('BACK')}</a>
</div>
</div>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -21,12 +21,11 @@
<tr>
<th>ID</th>
<th>{:lang('USERNAME')}</th>
<th>{:lang('NICENAME')}</th>
<th>微信{:lang('NICENAME')}</th>
<th>{:lang('AVATAR')}</th>
<th>{:lang('EMAIL')}</th>
<th>手机</th>
<th>用户类型</th>
<th>{:lang('REGISTRATION_TIME')}</th>
<th>{:lang('LAST_LOGIN_TIME')}</th>
<th>{:lang('LAST_LOGIN_IP')}</th>
<th>{:lang('STATUS')}</th>
<th>{:lang('ACTIONS')}</th>
... ... @@ -43,10 +42,12 @@
</td>
<td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
<td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td>
<td>{$vo.user_email}</td>
<td>{$vo.mobile}</td>
<td style="text-align: center"><switch name="$vo.is_expert">
<case value="1"><font color="#a52a2a">专家</font></case>
<case value="0"><font color="#006400">普通</font></case>
</switch></td>
<td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
<td>{:date('Y-m-d H:i:s',$vo['last_login_time'])}</td>
<td>{$vo.last_login_ip}</td>
<td>{$user_statuses[$vo['user_status']]}</td>
<td>
... ... @@ -62,6 +63,7 @@
<else/>
<a style="color: #ccc;">{:lang('BLOCK_USER')}</a>
</neq>
<a href="{:url('editUserInfo',['id'=>$vo.id])}" style="">查看详情</a>
</td>
</tr>
</foreach>
... ...