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
64fea532
authored
Nov 13, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.imohe.com/zhaozengyu/tzt-admin
parents
0bb778bc
a18f96ba
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
100 additions
and
48 deletions
+100
-48
.env.example
+6
-2
app/Admin/Controllers/DiagnosiController.php
+1
-3
app/Admin/Controllers/DoctorController.php
+16
-11
app/Admin/Controllers/DrugController.php
+8
-3
app/Admin/Controllers/DrugTagController.php
+9
-2
app/Admin/Controllers/InquiryController.php
+1
-0
app/Admin/Controllers/PatientController.php
+11
-14
app/Admin/Controllers/PharmacistController.php
+6
-3
app/Admin/Controllers/PharmacyController.php
+4
-1
app/Models/DiagnosiModel.php
+1
-0
app/Models/DoctorCorrectionModel.php
+1
-0
app/Models/PatientModel.php
+15
-0
app/Models/PharmacyModel.php
+9
-2
database/migrations/2024_11_04_135741_create_patient_table.php
+2
-2
database/migrations/2024_11_04_223543_create_pharmacy_table.php
+2
-2
lang/zh_CN/doctor.php
+1
-0
lang/zh_CN/drug-tag.php
+1
-0
lang/zh_CN/patient.php
+4
-3
lang/zh_CN/pharmacist.php
+1
-0
lang/zh_CN/pharmacy.php
+1
-0
No files found.
.env.example
View file @
64fea532
...
@@ -42,4 +42,8 @@ COS_BUCKET=cloud-rx
...
@@ -42,4 +42,8 @@ COS_BUCKET=cloud-rx
# 百度地图
# 百度地图
MAP_PROVIDER=baidu
MAP_PROVIDER=baidu
BAIDU_MAP_API_KEY=
BAIDU_MAP_API_KEY=
\ No newline at end of file
# 小程序
WECHAT_MINI_PROGRAM_APPID=wx848e75ebc215b462
WECHAT_MINI_PROGRAM_SECRET=
\ No newline at end of file
app/Admin/Controllers/DiagnosiController.php
View file @
64fea532
...
@@ -25,9 +25,6 @@ protected function grid()
...
@@ -25,9 +25,6 @@ protected function grid()
$grid
->
column
(
'code'
);
$grid
->
column
(
'code'
);
$grid
->
column
(
'content'
);
$grid
->
column
(
'content'
);
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'code'
,
'content'
])
->
placeholder
(
'请输入[诊断/诊断显示/简码]'
)
->
width
(
25
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
expand
();
// 默认展开搜索框
...
@@ -39,6 +36,7 @@ protected function grid()
...
@@ -39,6 +36,7 @@ protected function grid()
// 行按钮控制
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/DoctorController.php
View file @
64fea532
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\DoctorRepository
;
use
App\Admin\Repositories\DoctorRepository
;
use
App\Models\User
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
@@ -18,26 +19,29 @@ class DoctorController extends AdminController
...
@@ -18,26 +19,29 @@ class DoctorController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
DoctorRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
DoctorRepository
(
'user'
),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'name'
);
$grid
->
column
(
'name'
);
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'id_card'
);
$grid
->
column
(
'id_card'
);
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'license_no'
);
$grid
->
column
(
'license_no'
);
$grid
->
column
(
'license_no_pic'
)
->
image
(
''
,
50
,
50
);
//
$grid->column('license_no_pic')->image('', 50, 50);
$grid
->
column
(
'license_no_period'
);
//
$grid->column('license_no_period');
$grid
->
column
(
'physician_license'
)
->
image
(
''
,
50
,
50
);
//
$grid->column('physician_license')->image('', 50, 50);
$grid
->
column
(
'id_card_front_pic'
)
->
image
(
''
,
50
,
50
);
//
$grid->column('id_card_front_pic')->image('', 50, 50);
$grid
->
column
(
'id_card_back_pic'
)
->
image
(
''
,
50
,
50
);
//
$grid->column('id_card_back_pic')->image('', 50, 50);
$grid
->
column
(
'online_hospital_name'
);
$grid
->
column
(
'online_hospital_name'
);
$grid
->
column
(
'department'
);
$grid
->
column
(
'department'
);
$grid
->
column
(
'doctor_title'
);
//
$grid->column('doctor_title');
$grid
->
column
(
'be_good_at'
);
//
$grid->column('be_good_at');
$grid
->
column
(
'introduction'
);
//
$grid->column('introduction');
$grid
->
column
(
'signed_pic'
)
->
image
(
''
,
50
,
50
);
$grid
->
column
(
'signed_pic'
)
->
image
(
''
,
50
,
50
);
$grid
->
column
(
'status'
);
$grid
->
column
(
'status'
)
->
switch
();
$grid
->
column
(
'user.openid'
,
'关联用户'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
// 快捷搜索
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
...
@@ -113,6 +117,7 @@ protected function form()
...
@@ -113,6 +117,7 @@ protected function form()
$form
->
textarea
(
'be_good_at'
)
->
width
(
4
);
$form
->
textarea
(
'be_good_at'
)
->
width
(
4
);
$form
->
textarea
(
'introduction'
)
->
width
(
4
);
$form
->
textarea
(
'introduction'
)
->
width
(
4
);
$form
->
image
(
'signed_pic'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
image
(
'signed_pic'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/DrugController.php
View file @
64fea532
...
@@ -20,7 +20,7 @@ class DrugController extends AdminController
...
@@ -20,7 +20,7 @@ class DrugController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
DrugRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
DrugRepository
(
'tag'
),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
...
@@ -33,7 +33,11 @@ protected function grid()
...
@@ -33,7 +33,11 @@ protected function grid()
$grid
->
column
(
'factory'
);
$grid
->
column
(
'factory'
);
$grid
->
column
(
'approval_no'
);
$grid
->
column
(
'approval_no'
);
$grid
->
column
(
'limit_buy_7'
);
$grid
->
column
(
'limit_buy_7'
);
$grid
->
column
(
'tag'
);
$grid
->
column
(
'tag'
)
->
display
(
function
(
$tags
)
{
return
collect
(
$tags
)
->
map
(
function
(
$tag
)
{
return
"<span class='label' style='background:#6d8be6'>
{
$tag
->
tag_name
}
</span>"
;
})
->
implode
(
' '
);
});
$grid
->
column
(
'standard_code'
);
$grid
->
column
(
'standard_code'
);
// $grid->column('created_at');
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
// $grid->column('updated_at')->sortable();
...
@@ -52,6 +56,7 @@ protected function grid()
...
@@ -52,6 +56,7 @@ protected function grid()
// 行按钮控制
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
@@ -101,7 +106,7 @@ protected function form()
...
@@ -101,7 +106,7 @@ protected function form()
return
Form
::
make
(
new
DrugRepository
(
'tag'
),
function
(
Form
$form
)
{
return
Form
::
make
(
new
DrugRepository
(
'tag'
),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'name'
)
->
width
(
4
)
->
required
();
$form
->
hidden
(
'code'
)
->
width
(
4
)
->
required
(
);
$form
->
text
(
'code'
)
->
readonly
()
->
width
(
4
);
$form
->
text
(
'unit'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'unit'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'spec'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'spec'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'dosage_form'
)
->
width
(
4
)
->
required
();
$form
->
text
(
'dosage_form'
)
->
width
(
4
)
->
required
();
...
...
app/Admin/Controllers/DrugTagController.php
View file @
64fea532
...
@@ -24,17 +24,24 @@ protected function grid()
...
@@ -24,17 +24,24 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'tag_name'
);
$grid
->
column
(
'tag_name'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'inquiry'
)
->
display
(
function
(
$inquirys
)
{
$grid
->
column
(
'updated_at'
)
->
sortable
();
return
collect
(
$inquirys
)
->
map
(
function
(
$inquiry
)
{
return
"<span class='label' style='background:#6d8be6'>
{
$inquiry
->
question
}
</span>"
;
})
->
implode
(
' '
);
});
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'tag_name'
)
->
width
(
3
);
$filter
->
like
(
'tag_name'
)
->
width
(
3
);
});
});
// 行按钮控制
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/InquiryController.php
View file @
64fea532
...
@@ -35,6 +35,7 @@ protected function grid()
...
@@ -35,6 +35,7 @@ protected function grid()
// 行按钮控制
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/PatientController.php
View file @
64fea532
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
use
App\Admin\Repositories\PatientRepository
;
use
App\Admin\Repositories\PatientRepository
;
use
App\Models\PatientModel
;
use
App\Models\PatientModel
;
use
App\Models\PharmacyModel
;
use
App\Models\User
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
@@ -19,7 +21,7 @@ class PatientController extends AdminController
...
@@ -19,7 +21,7 @@ class PatientController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
PatientRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
PatientRepository
(
[
'user'
,
'pharmacy'
]
),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
...
@@ -30,9 +32,9 @@ protected function grid()
...
@@ -30,9 +32,9 @@ protected function grid()
return
getAgeByIdCard
(
$this
->
id_card
);
return
getAgeByIdCard
(
$this
->
id_card
);
});
});
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'
miniapp_openid'
);
$grid
->
column
(
'
is_default'
)
->
using
([
0
=>
'否'
,
1
=>
'是'
]
);
$grid
->
column
(
'
avatar
'
);
$grid
->
column
(
'
user.id'
,
'关联用户
'
);
$grid
->
column
(
'
nick_name
'
);
$grid
->
column
(
'
pharmacy.name'
,
'关联药店
'
);
// 快捷搜索
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'id_card'
,
'mobile'
])
->
placeholder
(
'请输入[姓名/身份证/手机号]'
)
->
width
(
25
);
$grid
->
quickSearch
([
'name'
,
'id_card'
,
'mobile'
])
->
placeholder
(
'请输入[姓名/身份证/手机号]'
)
->
width
(
25
);
...
@@ -47,8 +49,8 @@ protected function grid()
...
@@ -47,8 +49,8 @@ protected function grid()
});
});
// 行按钮控制
// 行按钮控制
$grid
->
disableCreateButton
();
// 禁用创建按钮
//
$grid->disableCreateButton(); // 禁用创建按钮
$grid
->
disableEditButton
();
// 禁用编辑按钮
//
$grid->disableEditButton(); // 禁用编辑按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
// 工具栏按钮控制
// 工具栏按钮控制
...
@@ -70,9 +72,6 @@ protected function detail($id)
...
@@ -70,9 +72,6 @@ protected function detail($id)
$show
->
field
(
'gender'
)
->
width
(
4
);
$show
->
field
(
'gender'
)
->
width
(
4
);
$show
->
field
(
'id_card'
)
->
width
(
4
);
$show
->
field
(
'id_card'
)
->
width
(
4
);
$show
->
field
(
'mobile'
)
->
width
(
4
);
$show
->
field
(
'mobile'
)
->
width
(
4
);
$show
->
field
(
'miniapp_openid'
)
->
width
(
4
);
$show
->
field
(
'avatar'
)
->
width
(
4
);
$show
->
field
(
'nick_name'
)
->
width
(
4
);
$show
->
field
(
'created_at'
)
->
width
(
4
);
$show
->
field
(
'created_at'
)
->
width
(
4
);
$show
->
field
(
'updated_at'
)
->
width
(
4
);
$show
->
field
(
'updated_at'
)
->
width
(
4
);
...
@@ -92,12 +91,10 @@ protected function form()
...
@@ -92,12 +91,10 @@ protected function form()
return
Form
::
make
(
new
PatientRepository
(),
function
(
Form
$form
)
{
return
Form
::
make
(
new
PatientRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
);
$form
->
text
(
'gender'
)
->
width
(
4
);
$form
->
text
(
'id_card'
)
->
width
(
4
);
$form
->
text
(
'id_card'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
)
->
rules
(
'required|regex:/^1[3456789]\d{9}$/'
);
$form
->
text
(
'miniapp_openid'
)
->
width
(
4
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
);
$form
->
text
(
'avatar'
)
->
width
(
4
);
$form
->
select
(
'pharmacy_id'
)
->
options
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
text
(
'nick_name'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/PharmacistController.php
View file @
64fea532
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\PharmacistRepository
;
use
App\Admin\Repositories\PharmacistRepository
;
use
App\Models\PharmacyModel
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Form
;
...
@@ -29,7 +30,7 @@ public function __construct(Request $request)
...
@@ -29,7 +30,7 @@ public function __construct(Request $request)
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
PharmacistRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
PharmacistRepository
(
'pharmacy'
),
function
(
Grid
$grid
)
{
Admin
::
style
(
Admin
::
style
(
<<<'CSS'
<<<'CSS'
.nav-tabs {
.nav-tabs {
...
@@ -68,10 +69,11 @@ protected function grid()
...
@@ -68,10 +69,11 @@ protected function grid()
$grid
->
column
(
'signed_pic'
)
->
image
(
''
,
50
,
50
);
$grid
->
column
(
'signed_pic'
)
->
image
(
''
,
50
,
50
);
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'practicing_license_expired_time'
);
$grid
->
column
(
'practicing_license_expired_time'
);
$grid
->
column
(
'pharmacy.name'
,
'关联药店'
);
// $grid->column('practicing_license')->image('', 50, 50);
// $grid->column('practicing_license')->image('', 50, 50);
// $grid->column('physician_license')->image('', 50, 50);
// $grid->column('physician_license')->image('', 50, 50);
$grid
->
column
(
'created_at'
);
//
$grid->column('created_at');
$grid
->
column
(
'updated_at'
)
->
sortable
();
//
$grid->column('updated_at')->sortable();
// 快捷搜索
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
...
@@ -138,6 +140,7 @@ protected function form()
...
@@ -138,6 +140,7 @@ protected function form()
$form
->
date
(
'practicing_license_expired_time'
)
->
width
(
4
);
$form
->
date
(
'practicing_license_expired_time'
)
->
width
(
4
);
$form
->
image
(
'physician_license'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
image
(
'physician_license'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
image
(
'signed_pic'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
image
(
'signed_pic'
)
->
accept
(
'jpg,png,jpeg'
)
->
uniqueName
()
->
autoUpload
()
->
retainable
()
->
removable
(
false
)
->
width
(
4
);
$form
->
select
(
'pharmacy_id'
)
->
options
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
...
...
app/Admin/Controllers/PharmacyController.php
View file @
64fea532
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
namespace
App\Admin\Controllers
;
use
App\Admin\Repositories\PharmacyRepository
;
use
App\Admin\Repositories\PharmacyRepository
;
use
App\Models\User
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
@@ -18,7 +19,7 @@ class PharmacyController extends AdminController
...
@@ -18,7 +19,7 @@ class PharmacyController extends AdminController
*/
*/
protected
function
grid
()
protected
function
grid
()
{
{
return
Grid
::
make
(
new
PharmacyRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
PharmacyRepository
(
'user'
),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'desc'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'desc'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
)
->
sortable
();
...
@@ -36,6 +37,7 @@ protected function grid()
...
@@ -36,6 +37,7 @@ protected function grid()
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'mobile'
);
// $grid->column('lng');
// $grid->column('lng');
// $grid->column('lat');
// $grid->column('lat');
$grid
->
column
(
'user.openid'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
$grid
->
column
(
'updated_at'
)
->
sortable
();
...
@@ -112,6 +114,7 @@ protected function form()
...
@@ -112,6 +114,7 @@ protected function form()
$form
->
mobile
(
'mobile'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
);
$form
->
text
(
'business_hours'
)
->
width
(
4
);
$form
->
text
(
'business_hours'
)
->
width
(
4
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
$form
->
map
(
'lat'
,
'lng'
,
'经纬度坐标'
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
switch
(
'status'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
...
...
app/Models/DiagnosiModel.php
View file @
64fea532
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Overtrue\Pinyin\Pinyin
;
use
Overtrue\Pinyin\Pinyin
;
// 诊断
class
DiagnosiModel
extends
Model
class
DiagnosiModel
extends
Model
{
{
use
HasDateTimeFormatter
;
use
HasDateTimeFormatter
;
...
...
app/Models/DoctorCorrectionModel.php
View file @
64fea532
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
// 医师纠错
class
DoctorCorrectionModel
extends
Model
class
DoctorCorrectionModel
extends
Model
{
{
use
HasDateTimeFormatter
;
use
HasDateTimeFormatter
;
...
...
app/Models/PatientModel.php
View file @
64fea532
...
@@ -27,9 +27,24 @@ class PatientModel extends Model
...
@@ -27,9 +27,24 @@ class PatientModel extends Model
self
::
SEX_FEMALE
=>
'女'
,
self
::
SEX_FEMALE
=>
'女'
,
];
];
/**
* 根据身份证设置性别
*/
public
function
setIdCardAttribute
(
$value
)
{
$this
->
attributes
[
'id_card'
]
=
$value
;
$this
->
attributes
[
'gender'
]
=
getSexByIdCard
(
$this
->
id_card
)
??
self
::
SEX_UNDEFINED
;
}
// 问诊人所属于的用户,多对一
// 问诊人所属于的用户,多对一
public
function
user
()
public
function
user
()
{
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
);
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
,
'id'
);
}
}
// 问诊人所属于的药店,多对一
public
function
pharmacy
()
{
return
$this
->
belongsTo
(
PharmacyModel
::
class
,
'pharmacy_id'
,
'id'
);
}
}
}
app/Models/PharmacyModel.php
View file @
64fea532
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
// 药店
class
PharmacyModel
extends
Model
class
PharmacyModel
extends
Model
{
{
use
HasDateTimeFormatter
;
use
HasDateTimeFormatter
;
...
@@ -20,8 +21,14 @@ public function user()
...
@@ -20,8 +21,14 @@ public function user()
}
}
// 药店关联的药师,一对多
// 药店关联的药师,一对多
public
function
pharmac
y
()
public
function
pharmac
ist
()
{
{
return
$this
->
hasMany
(
User
::
class
,
'pharmacy_id'
,
'id'
);
return
$this
->
hasMany
(
PharmacistModel
::
class
,
'pharmacist_id'
,
'id'
);
}
// 药店关联的问诊人,一对多
public
function
patient
()
{
return
$this
->
hasMany
(
PatientModel
::
class
,
'patient_id'
,
'id'
);
}
}
}
}
database/migrations/2024_11_04_135741_create_patient_table.php
View file @
64fea532
...
@@ -18,8 +18,8 @@ public function up(): void
...
@@ -18,8 +18,8 @@ public function up(): void
$table
->
tinyInteger
(
'gender'
)
->
default
(
0
)
->
comment
(
'性别。[1=男性,2=女性,0=未知]'
);
$table
->
tinyInteger
(
'gender'
)
->
default
(
0
)
->
comment
(
'性别。[1=男性,2=女性,0=未知]'
);
$table
->
string
(
'id_card'
,
18
)
->
index
(
'idx_idcard'
)
->
comment
(
'身份证号'
);
$table
->
string
(
'id_card'
,
18
)
->
index
(
'idx_idcard'
)
->
comment
(
'身份证号'
);
$table
->
string
(
'mobile'
,
11
)
->
index
(
'idx_mobile'
)
->
comment
(
'手机号'
);
$table
->
string
(
'mobile'
,
11
)
->
index
(
'idx_mobile'
)
->
comment
(
'手机号'
);
$table
->
bigInteger
(
'user_id'
)
->
default
(
0
)
->
index
(
'idx_userid'
)
->
comment
(
'用户表ID。用户添加问诊人才有值'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
(
)
->
index
(
'idx_userid'
)
->
comment
(
'用户表ID。用户添加问诊人才有值'
);
$table
->
bigInteger
(
'pharmacy_id'
)
->
default
(
0
)
->
index
(
'idx_pharmacyid'
)
->
comment
(
'药店表ID。药店添加问诊人猜有值'
);
$table
->
bigInteger
(
'pharmacy_id'
)
->
nullable
(
)
->
index
(
'idx_pharmacyid'
)
->
comment
(
'药店表ID。药店添加问诊人猜有值'
);
$table
->
boolean
(
'is_default'
)
->
default
(
0
)
->
comment
(
'默认问诊人,用户添加的才需要设置[0=否,1=是]'
);
$table
->
boolean
(
'is_default'
)
->
default
(
0
)
->
comment
(
'默认问诊人,用户添加的才需要设置[0=否,1=是]'
);
$table
->
timestamps
();
$table
->
timestamps
();
...
...
database/migrations/2024_11_04_223543_create_pharmacy_table.php
View file @
64fea532
...
@@ -27,8 +27,8 @@ public function up()
...
@@ -27,8 +27,8 @@ public function up()
$table
->
string
(
'address'
,
128
)
->
comment
(
'详细地址'
);
$table
->
string
(
'address'
,
128
)
->
comment
(
'详细地址'
);
$table
->
string
(
'mobile'
,
11
)
->
comment
(
'药店管理员手机号'
);
$table
->
string
(
'mobile'
,
11
)
->
comment
(
'药店管理员手机号'
);
$table
->
string
(
'business_hours'
,
32
)
->
comment
(
'营业时间'
);
$table
->
string
(
'business_hours'
,
32
)
->
comment
(
'营业时间'
);
$table
->
string
(
'lng'
,
12
)
->
comment
(
'经度'
);
$table
->
string
(
'lng'
,
20
)
->
nullable
(
)
->
comment
(
'经度'
);
$table
->
string
(
'lat'
,
12
)
->
comment
(
'纬度'
);
$table
->
string
(
'lat'
,
20
)
->
nullable
(
)
->
comment
(
'纬度'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
()
->
unique
(
'uk_userid'
)
->
comment
(
'用户表ID'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
()
->
unique
(
'uk_userid'
)
->
comment
(
'用户表ID'
);
$table
->
timestamps
();
$table
->
timestamps
();
...
...
lang/zh_CN/doctor.php
View file @
64fea532
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
'signed_pic'
=>
'签名照'
,
'signed_pic'
=>
'签名照'
,
'status'
=>
'启用'
,
'status'
=>
'启用'
,
'mobile'
=>
'手机号'
,
'mobile'
=>
'手机号'
,
'user_id'
=>
'关联用户'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
lang/zh_CN/drug-tag.php
View file @
64fea532
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
],
],
'fields'
=>
[
'fields'
=>
[
'tag_name'
=>
'标签名称'
,
'tag_name'
=>
'标签名称'
,
'inquiry'
=>
'问诊问题'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
lang/zh_CN/patient.php
View file @
64fea532
...
@@ -7,11 +7,12 @@
...
@@ -7,11 +7,12 @@
'fields'
=>
[
'fields'
=>
[
'name'
=>
'姓名'
,
'name'
=>
'姓名'
,
'gender'
=>
'性别'
,
'gender'
=>
'性别'
,
'age'
=>
'年龄'
,
'id_card'
=>
'身份证号'
,
'id_card'
=>
'身份证号'
,
'mobile'
=>
'手机号'
,
'mobile'
=>
'手机号'
,
'
miniapp_openid'
=>
'openid
'
,
'
is_default'
=>
'默认问诊人
'
,
'
avatar'
=>
'头像
'
,
'
pharmacy_id'
=>
'关联药店
'
,
'
nick_name'
=>
'昵称
'
,
'
user_id'
=>
'关联用户
'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
lang/zh_CN/pharmacist.php
View file @
64fea532
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
'physician_license'
=>
'执业资格证书'
,
'physician_license'
=>
'执业资格证书'
,
'signed_pic'
=>
'签名照'
,
'signed_pic'
=>
'签名照'
,
'status'
=>
'启用'
,
'status'
=>
'启用'
,
'pharmacy_id'
=>
'关联药店'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
lang/zh_CN/pharmacy.php
View file @
64fea532
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
'lng'
=>
'经度'
,
'lng'
=>
'经度'
,
'lat'
=>
'纬度'
,
'lat'
=>
'纬度'
,
'status'
=>
'启用'
,
'status'
=>
'启用'
,
'user_id'
=>
'关联用户'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
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