作者 sgj

注册页

@@ -9,8 +9,10 @@ @@ -9,8 +9,10 @@
9 namespace app\admin\controller; 9 namespace app\admin\controller;
10 10
11 11
  12 +use app\admin\model\HospitalModel;
12 use cmf\controller\AdminBaseController; 13 use cmf\controller\AdminBaseController;
13 use think\db; 14 use think\db;
  15 +use think\Request;
14 16
15 /** 17 /**
16 * Class HosptialController 18 * Class HosptialController
@@ -27,11 +29,19 @@ use think\db; @@ -27,11 +29,19 @@ use think\db;
27 */ 29 */
28 class HospitalController extends AdminBaseController 30 class HospitalController extends AdminBaseController
29 { 31 {
  32 + protected $HospitalModel;
  33 +
  34 +
  35 + public function __construct(HospitalModel $HospitalModel)
  36 + {
  37 + parent::__construct();
  38 + $this->HospitalModel = $HospitalModel;
  39 + }
30 40
31 /** 41 /**
32 - *医院管理 42 + *平台列表
33 * @adminMenu( 43 * @adminMenu(
34 - * 'name' => '医院设置', 44 + * 'name' => '平台列表',
35 * 'parent' => 'default', 45 * 'parent' => 'default',
36 * 'display'=> true, 46 * 'display'=> true,
37 * 'hasView'=> true, 47 * 'hasView'=> true,
@@ -42,10 +52,35 @@ class HospitalController extends AdminBaseController @@ -42,10 +52,35 @@ class HospitalController extends AdminBaseController
42 * ) 52 * )
43 */ 53 */
44 public function index(){ 54 public function index(){
45 - 55 + $platment=$this->HospitalModel->getPlatment()->toArray();
  56 + dump($platment);
  57 + $this->assign('platment',$platment);
  58 + return $this->fetch();
46 } 59 }
47 60
48 61
  62 + /**
  63 + *平台列表
  64 + * @adminMenu(
  65 + * 'name' => '医院列表',
  66 + * 'parent' => 'default',
  67 + * 'display'=> false,
  68 + * 'hasView'=> true,
  69 + * 'order' => 10000,
  70 + * 'icon' => '',
  71 + * 'remark' => '',
  72 + * 'param' => ''
  73 + * )
  74 + */
  75 + public function hospital(){
  76 + $platment_id=input('id');
  77 + if (empty($platment_id)){
  78 + return $this->error();
  79 + }
  80 + $hospital=$this->HospitalModel->getHospital($platment_id)->toArray();
  81 + $this->assign('hospital',$hospital);
  82 + return $this->fetch();
  83 + }
49 84
50 85
51 86
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * auther: sgj
  5 + * Date: 2018/11/25
  6 + * Time: 17:04
  7 + */
  8 +
  9 +namespace app\admin\model;
  10 +
  11 +
  12 +use think\Model;
  13 +
  14 +class HospitalModel extends Model
  15 +{
  16 + /**
  17 + * 返回平台信息
  18 + * @return false|\PDOStatement|string|\think\Collection
  19 + * @throws \think\db\exception\DataNotFoundException
  20 + * @throws \think\db\exception\ModelNotFoundException
  21 + * @throws \think\exception\DbException
  22 + */
  23 + public function getPlatment(){
  24 + $map['parent_id']='0';
  25 + $map['delete_time']='0';
  26 + $platment=db('portal_category')->where($map)->select();
  27 + return $platment;
  28 + }
  29 +
  30 + public function getHospital(){
  31 + $map['platment_id']='0';
  32 + $map['deleteTime']='0';
  33 + $hospital=db('hospital')->where($map)->select();
  34 + return $hospital;
  35 + }
  36 +}
@@ -31,5 +31,10 @@ class IndexController extends WeChatBaseController @@ -31,5 +31,10 @@ class IndexController extends WeChatBaseController
31 return $this->fetch(); 31 return $this->fetch();
32 } 32 }
33 33
  34 + public function platform(){
  35 +
  36 + $this->success('');
  37 + }
  38 +
34 39
35 } 40 }
  1 +<include file="public@header"/>
  2 +</head>
  3 +<body>
  4 +<div class="wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li class="active"><a href="{:url('AdminTag/index')}">标签管理</a></li>
  7 + <li><a href="{:url('AdminTag/add')}">添加标签</a></li>
  8 + </ul>
  9 + <form method="post" class="js-ajax-form margin-top-20">
  10 + <div class="table-actions">
  11 + <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
  12 + </div>
  13 + <table class="table table-hover table-bordered table-list">
  14 + <thead>
  15 + <tr>
  16 + <th width="50">ID</th>
  17 + <th>标签名称</th>
  18 + <th>状态</th>
  19 + <th width="160">操作</th>
  20 + </tr>
  21 + </thead>
  22 + <tbody>
  23 + <foreach name="platment" item="vo">
  24 + <tr>
  25 + <td>{$vo.id}</td>
  26 + <td>{$vo.name}</td>
  27 + <td><a href="{:url('hospital',['id'=>$vo.id])}">查看医院</a></td>
  28 + </tr>
  29 + </foreach>
  30 + </tbody>
  31 + <tfoot>
  32 + <tr>
  33 + <th width="50">ID</th>
  34 + <th>标签名称</th>
  35 + <th>状态</th>
  36 + <th width="160">操作</th>
  37 + </tr>
  38 + </tfoot>
  39 + </table>
  40 + <div class="table-actions">
  41 + <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
  42 + </div>
  43 + </form>
  44 + <ul class="pagination">{$page|default=''}</ul>
  45 +</div>
  46 +<script src="__STATIC__/js/admin.js"></script>
  47 +</body>
  48 +</html>
@@ -119,5 +119,155 @@ @@ -119,5 +119,155 @@
119 background-size: cover; 119 background-size: cover;
120 } 120 }
121 </style> 121 </style>
  122 +
  123 +<script type="application/javascript">
  124 +$(document).ready(function () {
  125 + $('.mask_box').hide()
  126 + $('.form_popup_box').hide()
  127 +
  128 + $(function () {
  129 + //获取短信验证码
  130 + var validCode = true;
  131 + $(".getCode").click(function () {
  132 + var time = 60;
  133 + var $code = $(this);
  134 + if (validCode) {
  135 + validCode = false;
  136 + var t = setInterval(function () {
  137 + time--;
  138 + $code.html(time + "秒");
  139 + if (time == 0) {
  140 + clearInterval(t);
  141 + $code.html("重新获取");
  142 + validCode = true;
  143 + }
  144 + }, 1000)
  145 + }
  146 + })
  147 + })
  148 + $('.platform_item').click(function () {
  149 + weui.picker([
  150 + {label: '平台1', value: 0},
  151 + {label: '平台2', value: 1},
  152 + {label: '平台3', value: 2},
  153 + ], {
  154 + onChange: function (res) {
  155 + console.log(res)
  156 + },
  157 + onConfirm: function (res) {
  158 + $('#platform').val(res[0].label)
  159 + }
  160 + }
  161 + )
  162 + })
  163 + $('.hospital_item').click(function () {
  164 + weui.picker([
  165 + {label: '医院1', value: 0},
  166 + {label: '医院2', value: 1},
  167 + {label: '医院3', value: 2},
  168 + ], {
  169 + onChange: function (res) {
  170 + console.log(res)
  171 + },
  172 + onConfirm: function (res) {
  173 + $('#hospital').val(res[0].label)
  174 + }
  175 + }
  176 + )
  177 + })
  178 + $('.department_item').click(function () {
  179 + weui.picker([
  180 + {label: '科室1', value: 0},
  181 + {label: '科室2', value: 1},
  182 + {label: '科室3', value: 2},
  183 + ], {
  184 + onChange: function (res) {
  185 + console.log(res)
  186 + },
  187 + onConfirm: function (res) {
  188 + $('#department').val(res[0].label)
  189 + }
  190 + }
  191 + )
  192 + })
  193 + $('.position_item').click(function () {
  194 + weui.picker([
  195 + {label: '职务1', value: 0},
  196 + {label: '职务2', value: 1},
  197 + {label: '职务3', value: 2},
  198 + ], {
  199 + onChange: function (res) {
  200 + console.log(res)
  201 + },
  202 + onConfirm: function (res) {
  203 + $('#position').val(res[0].label)
  204 + }
  205 + }
  206 + )
  207 + })
  208 +
  209 + $('.register_btn').click(function () {
  210 + var user_name = $('#user_name').val()
  211 + var phone_num = $('#phone_num').val()
  212 + var verify_code = $('#verify_code').val()
  213 + var platform = $('#platform').val()
  214 + var hospital = $('#hospital').val()
  215 + var department = $('#department').val()
  216 + var position = $('#position').val()
  217 + var province = $('#province').val()
  218 + var city = $('#city').val()
  219 + var town = $('#town').val()
  220 + if (user_name == '') {
  221 + $('.form_popup_box').show()
  222 + $('.form_popup_box').text('用户名不能为空')
  223 + $('.form_popup_box').delay(1000).hide(0);
  224 + } else if (phone_num == '') {
  225 + $('.form_popup_box').show()
  226 + $('.form_popup_box').text('手机号不能为空')
  227 + $('.form_popup_box').delay(1000).hide(0);
  228 + } else if (verify_code == '') {
  229 + $('.form_popup_box').show()
  230 + $('.form_popup_box').text('密码不能为空')
  231 + $('.form_popup_box').delay(1000).hide(0);
  232 + } else if (platform == '') {
  233 + $('.form_popup_box').show()
  234 + $('.form_popup_box').text('平台不能为空')
  235 + $('.form_popup_box').delay(1000).hide(0);
  236 + } else if (hospital == '') {
  237 + $('.form_popup_box').show()
  238 + $('.form_popup_box').text('医院不能为空')
  239 + $('.form_popup_box').delay(1000).hide(0);
  240 + } else if (department == '') {
  241 + $('.form_popup_box').show()
  242 + $('.form_popup_box').text('科室不能为空')
  243 + $('.form_popup_box').delay(1000).hide(0);
  244 + } else if (position == '') {
  245 + $('.form_popup_box').show()
  246 + $('.form_popup_box').text('职务不能为空')
  247 + $('.form_popup_box').delay(1000).hide(0);
  248 + } else if (province == '请选择') {
  249 + $('.form_popup_box').show()
  250 + $('.form_popup_box').text('省份不能为空')
  251 + $('.form_popup_box').delay(1000).hide(0);
  252 + } else if (city == '请选择') {
  253 + $('.form_popup_box').show()
  254 + $('.form_popup_box').text('城市不能为空')
  255 + $('.form_popup_box').delay(1000).hide(0);
  256 + } else if (town == '请选择') {
  257 + $('.form_popup_box').show()
  258 + $('.form_popup_box').text('区县不能为空')
  259 + $('.form_popup_box').delay(1000).hide(0);
  260 + } else {
  261 + $('.success').show().delay(2000).hide(2)
  262 + // $('.first').show().delay(2000).hide(2)
  263 + // setTimeout(function () {
  264 + // $('.success').show().delay(2000).hide(2)
  265 + // },2000);
  266 + }
  267 + }
  268 + )
  269 +})
  270 +</script>
  271 +
122 </body> 272 </body>
123 </html> 273 </html>
1 -$(document).ready(function () {  
2 - $('.mask_box').hide()  
3 - $('.form_popup_box').hide()  
4 -  
5 - $(function () {  
6 - //获取短信验证码  
7 - var validCode = true;  
8 - $(".getCode").click(function () {  
9 - var time = 60;  
10 - var $code = $(this);  
11 - if (validCode) {  
12 - validCode = false;  
13 - var t = setInterval(function () {  
14 - time--;  
15 - $code.html(time + "秒");  
16 - if (time == 0) {  
17 - clearInterval(t);  
18 - $code.html("重新获取");  
19 - validCode = true;  
20 - }  
21 - }, 1000)  
22 - }  
23 - })  
24 - })  
25 - $('.platform_item').click(function () {  
26 - weui.picker([  
27 - {label: '平台1', value: 0},  
28 - {label: '平台2', value: 1},  
29 - {label: '平台3', value: 2},  
30 - ], {  
31 - onChange: function (res) {  
32 - console.log(res)  
33 - },  
34 - onConfirm: function (res) {  
35 - $('#platform').val(res[0].label)  
36 - }  
37 - }  
38 - )  
39 - })  
40 - $('.hospital_item').click(function () {  
41 - weui.picker([  
42 - {label: '医院1', value: 0},  
43 - {label: '医院2', value: 1},  
44 - {label: '医院3', value: 2},  
45 - ], {  
46 - onChange: function (res) {  
47 - console.log(res)  
48 - },  
49 - onConfirm: function (res) {  
50 - $('#hospital').val(res[0].label)  
51 - }  
52 - }  
53 - )  
54 - })  
55 - $('.department_item').click(function () {  
56 - weui.picker([  
57 - {label: '科室1', value: 0},  
58 - {label: '科室2', value: 1},  
59 - {label: '科室3', value: 2},  
60 - ], {  
61 - onChange: function (res) {  
62 - console.log(res)  
63 - },  
64 - onConfirm: function (res) {  
65 - $('#department').val(res[0].label)  
66 - }  
67 - }  
68 - )  
69 - })  
70 - $('.position_item').click(function () {  
71 - weui.picker([  
72 - {label: '职务1', value: 0},  
73 - {label: '职务2', value: 1},  
74 - {label: '职务3', value: 2},  
75 - ], {  
76 - onChange: function (res) {  
77 - console.log(res)  
78 - },  
79 - onConfirm: function (res) {  
80 - $('#position').val(res[0].label)  
81 - }  
82 - }  
83 - )  
84 - })  
85 -  
86 - $('.register_btn').click(function () {  
87 - var user_name = $('#user_name').val()  
88 - var phone_num = $('#phone_num').val()  
89 - var verify_code = $('#verify_code').val()  
90 - var platform = $('#platform').val()  
91 - var hospital = $('#hospital').val()  
92 - var department = $('#department').val()  
93 - var position = $('#position').val()  
94 - var province = $('#province').val()  
95 - var city = $('#city').val()  
96 - var town = $('#town').val()  
97 - if (user_name == '') {  
98 - $('.form_popup_box').show()  
99 - $('.form_popup_box').text('用户名不能为空')  
100 - $('.form_popup_box').delay(1000).hide(0);  
101 - } else if (phone_num == '') {  
102 - $('.form_popup_box').show()  
103 - $('.form_popup_box').text('手机号不能为空')  
104 - $('.form_popup_box').delay(1000).hide(0);  
105 - } else if (verify_code == '') {  
106 - $('.form_popup_box').show()  
107 - $('.form_popup_box').text('密码不能为空')  
108 - $('.form_popup_box').delay(1000).hide(0);  
109 - } else if (platform == '') {  
110 - $('.form_popup_box').show()  
111 - $('.form_popup_box').text('平台不能为空')  
112 - $('.form_popup_box').delay(1000).hide(0);  
113 - } else if (hospital == '') {  
114 - $('.form_popup_box').show()  
115 - $('.form_popup_box').text('医院不能为空')  
116 - $('.form_popup_box').delay(1000).hide(0);  
117 - } else if (department == '') {  
118 - $('.form_popup_box').show()  
119 - $('.form_popup_box').text('科室不能为空')  
120 - $('.form_popup_box').delay(1000).hide(0);  
121 - } else if (position == '') {  
122 - $('.form_popup_box').show()  
123 - $('.form_popup_box').text('职务不能为空')  
124 - $('.form_popup_box').delay(1000).hide(0);  
125 - } else if (province == '请选择') {  
126 - $('.form_popup_box').show()  
127 - $('.form_popup_box').text('省份不能为空')  
128 - $('.form_popup_box').delay(1000).hide(0);  
129 - } else if (city == '请选择') {  
130 - $('.form_popup_box').show()  
131 - $('.form_popup_box').text('城市不能为空')  
132 - $('.form_popup_box').delay(1000).hide(0);  
133 - } else if (town == '请选择') {  
134 - $('.form_popup_box').show()  
135 - $('.form_popup_box').text('区县不能为空')  
136 - $('.form_popup_box').delay(1000).hide(0);  
137 - } else {  
138 - $('.success').show().delay(2000).hide(2)  
139 - // $('.first').show().delay(2000).hide(2)  
140 - // setTimeout(function () {  
141 - // $('.success').show().delay(2000).hide(2)  
142 - // },2000);  
143 - }  
144 - }  
145 - )  
146 -})