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

Merge remote-tracking branch 'origin/master'

@@ -11,6 +11,9 @@ @@ -11,6 +11,9 @@
11 11
12 namespace app\user\controller; 12 namespace app\user\controller;
13 13
  14 +use app\admin\model\HospitalModel;
  15 +use app\admin\model\JobModel;
  16 +use app\user\model\UserModel;
14 use cmf\controller\AdminBaseController; 17 use cmf\controller\AdminBaseController;
15 use think\Db; 18 use think\Db;
16 19
@@ -130,4 +133,33 @@ class AdminIndexController extends AdminBaseController @@ -130,4 +133,33 @@ class AdminIndexController extends AdminBaseController
130 $this->error('数据传入失败!'); 133 $this->error('数据传入失败!');
131 } 134 }
132 } 135 }
  136 +
  137 +
  138 + public function editUserInfo(){
  139 + $map['u.id']=input('id');
  140 + $User=new UserModel();
  141 + $user=$User->alias('u')
  142 + ->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')
  143 + ->join('hospital h','h.id=u.hospital',"LEFT")
  144 + ->join('office o','u.office=o.id',"LEFT")
  145 + ->join('job j','u.job=j.id',"LEFT")
  146 + ->join('portal_category c','c.id=u.platform')
  147 + ->where($map)
  148 + ->find()
  149 + ->toArray();
  150 + $Job=new JobModel();
  151 + $jobs=$Job->getJob()->toArray() ;
  152 + $Hospital=new HospitalModel();
  153 + $hospitals=$Hospital->getHospital()->toArray();
  154 + $platform=$Hospital->getPlatment()->toArray();
  155 + dump($user);
  156 + dump($hospitals);
  157 + dump($platform);
  158 + $this->assign('user',$user);
  159 + $this->assign('jobs',$jobs);
  160 + $this->assign('hospitals',$hospitals);
  161 + $this->assign('platforms',$platform);
  162 + return $this->fetch();
  163 + }
  164 +
133 } 165 }
  1 +<include file="public@header" />
  2 +</head>
  3 +<body>
  4 +<div class="wrap js-check-wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li><a href="{:url('rbac/index')}">{:lang('ADMIN_RBAC_INDEX')}</a></li>
  7 + <li class="active"><a>编辑信息</a></li>
  8 + </ul>
  9 + <form class="form-horizontal js-ajax-form margin-top-20" action="{:url('')}" method="post">
  10 + <div class="form-group">
  11 + <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户姓名</label>
  12 + <div class="col-md-6 col-sm-10">
  13 + <input type="text" class="form-control" id="input-name" name="name" value="{$user.user_login}">
  14 + </div>
  15 + </div>
  16 + <div class="form-group">
  17 + <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户昵称</label>
  18 + <div class="col-md-6 col-sm-10">
  19 + <input type="text" class="form-control" id="input-name" name="name" value="{$user.user_nickname}">
  20 + </div>
  21 + </div>
  22 +
  23 + <div class="form-group">
  24 + <label for="input-remark" class="col-sm-2 control-label">用户简介</label>
  25 + <div class="col-md-6 col-sm-10">
  26 + <textarea type="text" class="form-control" id="input-remark" name="describe">{$user.describe}</textarea>
  27 + </div>
  28 + </div>
  29 +
  30 + <div class="form-group">
  31 + <label for="input-remark" class="col-sm-2 control-label">联系电话</label>
  32 + <div class="col-md-6 col-sm-10">
  33 + <input type="text" class="form-control" id="input-name" name="mobile" value="{$user.mobile}">
  34 + </div>
  35 + </div>
  36 +
  37 + <div class="form-group">
  38 + <label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>用户头像</label>
  39 + <div class="col-md-6 col-sm-10">
  40 + <div style="text-align: center;">
  41 + <input type="hidden" name="avatar" id="thumbnail"
  42 + value="{$user.avatar|default=''}">
  43 + <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
  44 + <if condition="empty($user.avatar)">
  45 + <img src="__TMPL__/public/assets/images/default-thumbnail.png"
  46 + id="thumbnail-preview"
  47 + width="135" style="cursor: pointer"/>
  48 + <else/>
  49 + <img src="{:cmf_get_image_preview_url($user.avatar)}"
  50 + id="thumbnail-preview"
  51 + width="135" style="cursor: pointer"/>
  52 + </if>
  53 + </a>
  54 + <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
  55 + </div>
  56 + </div>
  57 + </div>
  58 +
  59 + <div class="form-group">
  60 + <label for="input-remark" class="col-sm-2 control-label">职位级别</label>
  61 + <div class="col-md-6 col-sm-10">
  62 +
  63 + <select class="form-control valid" name="job" id="input-site_adminstyle" aria-invalid="false">
  64 + <volist name="jobs" id="job">
  65 + <option value="{$job.id}" selected="">{$job.name}</option>
  66 + </volist>
  67 + <option value="{$user.job}" selected="1">{$user.job_name}</option>
  68 + </select>
  69 +
  70 + </div>
  71 + </div>
  72 +
  73 + <div class="form-group">
  74 + <label for="input-remark" class="col-sm-2 control-label">所在地区-省</label>
  75 + <div class="col-md-6 col-sm-10">
  76 + <input type="text" class="form-control" id="input-name" name="province" value="{$user.province}">
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="form-group">
  81 + <label for="input-remark" class="col-sm-2 control-label">所在地区-市</label>
  82 + <div class="col-md-6 col-sm-10">
  83 + <input type="text" class="form-control" id="input-name" name="city" value="{$user.city}">
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group">
  88 + <label for="input-remark" class="col-sm-2 control-label">所在地区-区</label>
  89 + <div class="col-md-6 col-sm-10">
  90 + <input type="text" class="form-control" id="input-name" name="town" value="{$user.town}">
  91 + </div>
  92 + </div>
  93 +
  94 + <div class="form-group">
  95 + <label for="input-remark" class="col-sm-2 control-label">所在医院</label>
  96 + <div class="col-md-6 col-sm-10">
  97 + <select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
  98 +
  99 + <volist name="hospitals" id="vo">
  100 + <option value="{$vo.id}" selected="">{$vo.name}</option>
  101 + </volist>
  102 + <option value="{$user.hospital}" selected="1">{$user.hospital_name}</option>
  103 + </select>
  104 + </div>
  105 + </div>
  106 +
  107 + <div class="form-group">
  108 + <label for="input-remark" class="col-sm-2 control-label">所在科室</label>
  109 + <div class="col-md-6 col-sm-10">
  110 + <select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
  111 + <option value="{$user.office}" selected="1">{$user.office_name}</option>
  112 + </select>
  113 + </div>
  114 + </div>
  115 +
  116 + <div class="form-group">
  117 + <label for="input-remark" class="col-sm-2 control-label">所在平台</label>
  118 + <div class="col-md-6 col-sm-10">
  119 + <select class="form-control valid" name="hospital" id="input-site_adminstyle" aria-invalid="false">
  120 +
  121 + <volist name="platforms" id="vo">
  122 + <option value="{$vo.id}" selected="">{$vo.name}</option>
  123 + </volist>
  124 + <option value="{$user.platform}" selected="1">{$user.platform_name}</option>
  125 + </select>
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="form-group">
  130 + <div class="col-sm-offset-2 col-sm-10">
  131 + <input type="hidden" name="id" value="{$user.id}"/>
  132 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  133 + <a class="btn btn-default" href="{:url('admin/rbac/index')}">{:lang('BACK')}</a>
  134 + </div>
  135 + </div>
  136 +
  137 +
  138 + </form>
  139 +</div>
  140 +<script src="__STATIC__/js/admin.js"></script>
  141 +</body>
  142 +</html>
@@ -21,12 +21,11 @@ @@ -21,12 +21,11 @@
21 <tr> 21 <tr>
22 <th>ID</th> 22 <th>ID</th>
23 <th>{:lang('USERNAME')}</th> 23 <th>{:lang('USERNAME')}</th>
24 - <th>{:lang('NICENAME')}</th> 24 + <th>微信{:lang('NICENAME')}</th>
25 <th>{:lang('AVATAR')}</th> 25 <th>{:lang('AVATAR')}</th>
26 - <th>{:lang('EMAIL')}</th>  
27 <th>手机</th> 26 <th>手机</th>
  27 + <th>用户类型</th>
28 <th>{:lang('REGISTRATION_TIME')}</th> 28 <th>{:lang('REGISTRATION_TIME')}</th>
29 - <th>{:lang('LAST_LOGIN_TIME')}</th>  
30 <th>{:lang('LAST_LOGIN_IP')}</th> 29 <th>{:lang('LAST_LOGIN_IP')}</th>
31 <th>{:lang('STATUS')}</th> 30 <th>{:lang('STATUS')}</th>
32 <th>{:lang('ACTIONS')}</th> 31 <th>{:lang('ACTIONS')}</th>
@@ -43,10 +42,12 @@ @@ -43,10 +42,12 @@
43 </td> 42 </td>
44 <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td> 43 <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
45 <td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td> 44 <td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td>
46 - <td>{$vo.user_email}</td>  
47 <td>{$vo.mobile}</td> 45 <td>{$vo.mobile}</td>
  46 + <td style="text-align: center"><switch name="$vo.is_expert">
  47 + <case value="1"><font color="#a52a2a">专家</font></case>
  48 + <case value="0"><font color="#006400">普通</font></case>
  49 + </switch></td>
48 <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td> 50 <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
49 - <td>{:date('Y-m-d H:i:s',$vo['last_login_time'])}</td>  
50 <td>{$vo.last_login_ip}</td> 51 <td>{$vo.last_login_ip}</td>
51 <td>{$user_statuses[$vo['user_status']]}</td> 52 <td>{$user_statuses[$vo['user_status']]}</td>
52 <td> 53 <td>
@@ -62,6 +63,7 @@ @@ -62,6 +63,7 @@
62 <else/> 63 <else/>
63 <a style="color: #ccc;">{:lang('BLOCK_USER')}</a> 64 <a style="color: #ccc;">{:lang('BLOCK_USER')}</a>
64 </neq> 65 </neq>
  66 + <a href="{:url('editUserInfo',['id'=>$vo.id])}" style="">查看详情</a>
65 </td> 67 </td>
66 </tr> 68 </tr>
67 </foreach> 69 </foreach>