Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1e01f709
authored
Dec 04, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台端医师增加类型
parent
19c9faba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
app/Admin/Controllers/DoctorController.php
+2
-2
app/Models/DoctorModel.php
+12
-0
No files found.
app/Admin/Controllers/DoctorController.php
View file @
1e01f709
...
...
@@ -48,7 +48,7 @@ protected function grid()
$grid
->
column
(
'user.openid'
,
'关联用户'
);
$grid
->
column
(
'created_at'
);
// $grid->column('updated_at')->sortable();
$grid
->
column
(
'type'
,
'医师类型'
)
->
using
(
DoctorModel
::
DOCTOR_TYPE_MAP
);
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
...
...
@@ -131,7 +131,7 @@ protected function form()
$form
->
display
(
'user_id'
);
$form
->
switch
(
'status'
);
$form
->
switch
(
'is_auto'
);
$form
->
radio
(
'type'
,
'医师类型'
)
->
options
(
DoctorModel
::
DOCTOR_TYPE_MAP
)
->
default
(
DoctorModel
::
DOCTOR_TYPE_WM
)
->
required
();
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
});
...
...
app/Models/DoctorModel.php
View file @
1e01f709
...
...
@@ -43,6 +43,18 @@ class DoctorModel extends Model
self
::
IS_AUTO_TRUE
=>
'success'
,
];
const
DOCTOR_TYPE_ALL
=
2
;
const
DOCTOR_TYPE_WM
=
0
;
const
DOCTOR_TYPE_TCM
=
1
;
// 性别-文字映射
const
DOCTOR_TYPE_MAP
=
[
self
::
DOCTOR_TYPE_ALL
=>
'全部'
,
self
::
DOCTOR_TYPE_WM
=>
'西药'
,
self
::
DOCTOR_TYPE_TCM
=>
'中药'
,
];
// 医师所属于的用户,一对一
public
function
user
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment