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
7fcde24f
authored
Nov 13, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整结构,增加
parent
ef6ae026
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
63 additions
and
28 deletions
+63
-28
.env.example
+5
-0
app/Admin/Controllers/DiagnosiController.php
+1
-3
app/Admin/Controllers/DrugController.php
+1
-0
app/Admin/Controllers/DrugTagController.php
+9
-2
app/Admin/Controllers/InquiryController.php
+1
-0
app/Admin/Controllers/PatientController.php
+11
-14
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/drug-tag.php
+1
-0
lang/zh_CN/patient.php
+4
-3
No files found.
.env.example
View file @
7fcde24f
...
...
@@ -43,3 +43,7 @@ COS_BUCKET=cloud-rx
# 百度地图
MAP_PROVIDER=baidu
BAIDU_MAP_API_KEY=
# 小程序
WECHAT_MINI_PROGRAM_APPID=wx848e75ebc215b462
WECHAT_MINI_PROGRAM_SECRET=
\ No newline at end of file
app/Admin/Controllers/DiagnosiController.php
View file @
7fcde24f
...
...
@@ -25,9 +25,6 @@ protected function grid()
$grid
->
column
(
'code'
);
$grid
->
column
(
'content'
);
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'code'
,
'content'
])
->
placeholder
(
'请输入[诊断/诊断显示/简码]'
)
->
width
(
25
);
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
...
...
@@ -39,6 +36,7 @@ protected function grid()
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/DrugController.php
View file @
7fcde24f
...
...
@@ -56,6 +56,7 @@ protected function grid()
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/DrugTagController.php
View file @
7fcde24f
...
...
@@ -24,17 +24,24 @@ protected function grid()
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'tag_name'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
$grid
->
column
(
'inquiry'
)
->
display
(
function
(
$inquirys
)
{
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
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
expand
();
// 默认展开搜索框
$filter
->
like
(
'tag_name'
)
->
width
(
3
);
});
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/InquiryController.php
View file @
7fcde24f
...
...
@@ -35,6 +35,7 @@ protected function grid()
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/PatientController.php
View file @
7fcde24f
...
...
@@ -4,6 +4,8 @@
use
App\Admin\Repositories\PatientRepository
;
use
App\Models\PatientModel
;
use
App\Models\PharmacyModel
;
use
App\Models\User
;
use
Dcat\Admin\Form
;
use
Dcat\Admin\Grid
;
use
Dcat\Admin\Http\Controllers\AdminController
;
...
...
@@ -19,7 +21,7 @@ class PatientController extends AdminController
*/
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
->
column
(
'id'
)
->
sortable
();
...
...
@@ -30,9 +32,9 @@ protected function grid()
return
getAgeByIdCard
(
$this
->
id_card
);
});
$grid
->
column
(
'mobile'
);
$grid
->
column
(
'
miniapp_openid'
);
$grid
->
column
(
'
avatar
'
);
$grid
->
column
(
'
nick_name
'
);
$grid
->
column
(
'
is_default'
)
->
using
([
0
=>
'否'
,
1
=>
'是'
]
);
$grid
->
column
(
'
user.id'
,
'用户
'
);
$grid
->
column
(
'
pharmacy.name'
,
'药店
'
);
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'id_card'
,
'mobile'
])
->
placeholder
(
'请输入[姓名/身份证/手机号]'
)
->
width
(
25
);
...
...
@@ -47,8 +49,8 @@ protected function grid()
});
// 行按钮控制
$grid
->
disableCreateButton
();
// 禁用创建按钮
$grid
->
disableEditButton
();
// 禁用编辑按钮
//
$grid->disableCreateButton(); // 禁用创建按钮
//
$grid->disableEditButton(); // 禁用编辑按钮
$grid
->
disableDeleteButton
();
// 禁用删除按钮
// 工具栏按钮控制
...
...
@@ -70,9 +72,6 @@ protected function detail($id)
$show
->
field
(
'gender'
)
->
width
(
4
);
$show
->
field
(
'id_card'
)
->
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
(
'updated_at'
)
->
width
(
4
);
...
...
@@ -92,12 +91,10 @@ protected function form()
return
Form
::
make
(
new
PatientRepository
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
)
->
width
(
4
);
$form
->
text
(
'name'
)
->
width
(
4
);
$form
->
text
(
'gender'
)
->
width
(
4
);
$form
->
text
(
'id_card'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
);
$form
->
text
(
'miniapp_openid'
)
->
width
(
4
);
$form
->
text
(
'avatar'
)
->
width
(
4
);
$form
->
text
(
'nick_name'
)
->
width
(
4
);
$form
->
mobile
(
'mobile'
)
->
width
(
4
)
->
rules
(
'required|regex:/^1[3456789]\d{9}$/'
);
$form
->
select
(
'user_id'
)
->
options
(
User
::
all
()
->
pluck
(
'openid'
,
'id'
))
->
width
(
4
);
$form
->
select
(
'pharmacy_id'
)
->
options
(
PharmacyModel
::
all
()
->
pluck
(
'name'
,
'id'
))
->
width
(
4
);
$form
->
display
(
'created_at'
)
->
width
(
4
);
$form
->
display
(
'updated_at'
)
->
width
(
4
);
...
...
app/Models/DiagnosiModel.php
View file @
7fcde24f
...
...
@@ -7,6 +7,7 @@
use
Illuminate\Database\Eloquent\SoftDeletes
;
use
Overtrue\Pinyin\Pinyin
;
// 诊断
class
DiagnosiModel
extends
Model
{
use
HasDateTimeFormatter
;
...
...
app/Models/DoctorCorrectionModel.php
View file @
7fcde24f
...
...
@@ -5,6 +5,7 @@
use
Dcat\Admin\Traits\HasDateTimeFormatter
;
use
Illuminate\Database\Eloquent\Model
;
// 医师纠错
class
DoctorCorrectionModel
extends
Model
{
use
HasDateTimeFormatter
;
...
...
app/Models/PatientModel.php
View file @
7fcde24f
...
...
@@ -27,9 +27,24 @@ class PatientModel extends Model
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
()
{
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 @
7fcde24f
...
...
@@ -6,6 +6,7 @@
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
// 药店
class
PharmacyModel
extends
Model
{
use
HasDateTimeFormatter
;
...
...
@@ -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 @
7fcde24f
...
...
@@ -18,8 +18,8 @@ public function up(): void
$table
->
tinyInteger
(
'gender'
)
->
default
(
0
)
->
comment
(
'性别。[1=男性,2=女性,0=未知]'
);
$table
->
string
(
'id_card'
,
18
)
->
index
(
'idx_idcard'
)
->
comment
(
'身份证号'
);
$table
->
string
(
'mobile'
,
11
)
->
index
(
'idx_mobile'
)
->
comment
(
'手机号'
);
$table
->
bigInteger
(
'user_id'
)
->
default
(
0
)
->
index
(
'idx_userid'
)
->
comment
(
'用户表ID。用户添加问诊人才有值'
);
$table
->
bigInteger
(
'pharmacy_id'
)
->
default
(
0
)
->
index
(
'idx_pharmacyid'
)
->
comment
(
'药店表ID。药店添加问诊人猜有值'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
(
)
->
index
(
'idx_userid'
)
->
comment
(
'用户表ID。用户添加问诊人才有值'
);
$table
->
bigInteger
(
'pharmacy_id'
)
->
nullable
(
)
->
index
(
'idx_pharmacyid'
)
->
comment
(
'药店表ID。药店添加问诊人猜有值'
);
$table
->
boolean
(
'is_default'
)
->
default
(
0
)
->
comment
(
'默认问诊人,用户添加的才需要设置[0=否,1=是]'
);
$table
->
timestamps
();
...
...
database/migrations/2024_11_04_223543_create_pharmacy_table.php
View file @
7fcde24f
...
...
@@ -27,8 +27,8 @@ public function up()
$table
->
string
(
'address'
,
128
)
->
comment
(
'详细地址'
);
$table
->
string
(
'mobile'
,
11
)
->
comment
(
'药店管理员手机号'
);
$table
->
string
(
'business_hours'
,
32
)
->
comment
(
'营业时间'
);
$table
->
string
(
'lng'
,
12
)
->
comment
(
'经度'
);
$table
->
string
(
'lat'
,
12
)
->
comment
(
'纬度'
);
$table
->
string
(
'lng'
,
20
)
->
nullable
(
)
->
comment
(
'经度'
);
$table
->
string
(
'lat'
,
20
)
->
nullable
(
)
->
comment
(
'纬度'
);
$table
->
boolean
(
'status'
)
->
default
(
0
)
->
comment
(
'启用[0=未启用,1=启用]'
);
$table
->
bigInteger
(
'user_id'
)
->
nullable
()
->
unique
(
'uk_userid'
)
->
comment
(
'用户表ID'
);
$table
->
timestamps
();
...
...
lang/zh_CN/drug-tag.php
View file @
7fcde24f
...
...
@@ -6,6 +6,7 @@
],
'fields'
=>
[
'tag_name'
=>
'标签名称'
,
'inquiry'
=>
'问诊问题'
,
],
'options'
=>
[
],
...
...
lang/zh_CN/patient.php
View file @
7fcde24f
...
...
@@ -7,11 +7,12 @@
'fields'
=>
[
'name'
=>
'姓名'
,
'gender'
=>
'性别'
,
'age'
=>
'年龄'
,
'id_card'
=>
'身份证号'
,
'mobile'
=>
'手机号'
,
'
miniapp_openid'
=>
'openid
'
,
'
avatar'
=>
'头像
'
,
'
nick_name'
=>
'昵称
'
,
'
is_default'
=>
'默认问诊人
'
,
'
pharmacy_id'
=>
'药店
'
,
'
user_id'
=>
'用户
'
,
],
'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