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
b066c9e4
authored
Nov 13, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整处方列表
parent
883ee984
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
36 deletions
+35
-36
app/Admin/Controllers/PrescriptionController.php
+14
-15
app/Api/Controllers/PrescriptionController.php
+12
-12
lang/zh_CN/prescription.php
+9
-9
No files found.
app/Admin/Controllers/PrescriptionController.php
View file @
b066c9e4
...
@@ -21,29 +21,28 @@ protected function grid()
...
@@ -21,29 +21,28 @@ protected function grid()
return
Grid
::
make
(
new
PrescriptionRepository
(),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
new
PrescriptionRepository
(),
function
(
Grid
$grid
)
{
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'id'
,
'DESC'
);
$grid
->
column
(
'id'
)
->
sortable
();
$grid
->
column
(
'id'
,
'处方单编号'
)
->
sortable
();
$grid
->
column
(
'prescription_umber'
);
$grid
->
column
(
'status'
);
$grid
->
column
(
'status'
);
$grid
->
column
(
'patient_name'
);
$grid
->
column
(
'patient_name'
);
$grid
->
column
(
'patient_age'
);
$grid
->
column
(
'patient_age'
);
$grid
->
column
(
'patient_gender'
);
$grid
->
column
(
'patient_gender'
);
$grid
->
column
(
'diagnosis_id'
);
$grid
->
column
(
'diagnosis_name'
);
$grid
->
column
(
'diagnosis_name'
);
$grid
->
column
(
'inquiry_info'
);
$grid
->
column
(
'drug_info'
);
$grid
->
column
(
'doctor_id'
);
$grid
->
column
(
'doctor_name'
);
$grid
->
column
(
'doctor_name'
);
$grid
->
column
(
'doctor_online_hospital_name'
);
$grid
->
column
(
'doctor_department'
);
$grid
->
column
(
'doctor_title'
);
$grid
->
column
(
'doctor_license_no'
);
$grid
->
column
(
'pharmacy_id'
);
$grid
->
column
(
'pharmacy_name'
);
$grid
->
column
(
'pharmacist_id'
);
$grid
->
column
(
'pharmacist_name'
);
$grid
->
column
(
'pharmacist_name'
);
$grid
->
column
(
'pharmacist_license_number'
);
$grid
->
column
(
'drug_info'
);
$grid
->
column
(
'pharmacy_name'
);
// $grid->column('diagnosis_id');
// $grid->column('inquiry_info');
// $grid->column('doctor_id');
// $grid->column('doctor_online_hospital_name');
// $grid->column('doctor_department');
// $grid->column('doctor_title');
// $grid->column('doctor_license_no');
// $grid->column('pharmacy_id');
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_license_number');
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
//
$grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$filter
->
panel
();
// 更改为 panel 布局
$filter
->
panel
();
// 更改为 panel 布局
...
...
app/Api/Controllers/PrescriptionController.php
View file @
b066c9e4
...
@@ -36,40 +36,40 @@ public function prescriptionList(Request $request)
...
@@ -36,40 +36,40 @@ public function prescriptionList(Request $request)
$authInfo
=
auth
(
'api'
)
->
user
();
$authInfo
=
auth
(
'api'
)
->
user
();
$query
=
PrescriptionModel
::
query
();
$query
=
PrescriptionModel
::
query
();
// TODO 判断当前登录的用户角色
// TODO 判断当前登录的用户角色
#
$userInfo = User::with(['doctor', 'pharmacist'])->find($authInfo->id);
//
$userInfo = User::with(['doctor', 'pharmacist'])->find($authInfo->id);
if
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_USER
)
{
if
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_USER
)
{
$query
->
where
(
'user_id'
,
$authInfo
->
id
);
$query
->
where
(
'user_id'
,
$authInfo
->
id
);
}
else
if
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_DOCTOR
)
{
// 医师
}
elseif
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_DOCTOR
)
{
// 医师
$doctor
=
DoctorModel
::
query
()
->
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
$doctor
=
DoctorModel
::
query
()
->
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
$query
->
where
(
'doctor_id'
,
$doctor
->
id
);
$query
->
where
(
'doctor_id'
,
$doctor
->
id
);
}
else
if
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_PHARMACY
)
{
// 药店
}
elseif
(
$authInfo
->
last_login_type
==
User
::
LOGIN_TYPE_PHARMACY
)
{
// 药店
$pharmacy
=
PharmacyModel
::
query
()
->
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
$pharmacy
=
PharmacyModel
::
query
()
->
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
$query
->
where
(
'pharmacy_id'
,
$pharmacy
->
id
);
$query
->
where
(
'pharmacy_id'
,
$pharmacy
->
id
);
}
}
#
时间段
//
时间段
$start_time
=
$request
->
input
(
'start_time'
);
$start_time
=
$request
->
input
(
'start_time'
);
$end_time
=
$request
->
input
(
'end_time'
);
$end_time
=
$request
->
input
(
'end_time'
);
if
(
$start_time
&&
$end_time
)
{
if
(
$start_time
&&
$end_time
)
{
$query
->
whereBetween
(
'created_at'
,
[
$start_time
,
$end_time
]);
$query
->
whereBetween
(
'created_at'
,
[
$start_time
,
$end_time
]);
}
else
if
(
$start_time
)
{
}
elseif
(
$start_time
)
{
$query
->
where
(
'created_at'
,
'>='
,
$start_time
);
$query
->
where
(
'created_at'
,
'>='
,
$start_time
);
}
else
if
(
$end_time
)
{
}
elseif
(
$end_time
)
{
$query
->
where
(
'created_at'
,
'<='
,
$end_time
);
$query
->
where
(
'created_at'
,
'<='
,
$end_time
);
}
}
#
状态
//
状态
$status
=
$request
->
input
(
'status'
);
$status
=
$request
->
input
(
'status'
);
if
(
$status
)
{
if
(
$status
)
{
$query
->
where
(
'status'
,
$status
);
$query
->
where
(
'status'
,
$status
);
}
}
#
分页
//
分页
$page
=
$request
->
input
(
'page'
,
1
);
$page
=
$request
->
input
(
'page'
,
1
);
$perPage
=
$request
->
input
(
'per_page'
,
10
);
$perPage
=
$request
->
input
(
'per_page'
,
10
);
$prescription
=
$query
->
orderBy
(
'id'
,
'desc'
)
->
paginate
(
$perPage
,
[
'*'
],
'page'
,
$page
);
$prescription
=
$query
->
orderBy
(
'id'
,
'desc'
)
->
paginate
(
$perPage
,
[
'*'
],
'page'
,
$page
);
#
$prescription = $query->paginate(10);
//
$prescription = $query->paginate(10);
return
$this
->
success
(
$prescription
);
return
$this
->
success
(
$prescription
);
}
}
...
...
lang/zh_CN/prescription.php
View file @
b066c9e4
...
@@ -5,26 +5,26 @@
...
@@ -5,26 +5,26 @@
'prescription'
=>
'处方'
,
'prescription'
=>
'处方'
,
],
],
'fields'
=>
[
'fields'
=>
[
'status'
=>
'
审方
状态'
,
'status'
=>
'状态'
,
'patient_name'
=>
'
问诊人
姓名'
,
'patient_name'
=>
'姓名'
,
'patient_age'
=>
'
问诊人
年龄'
,
'patient_age'
=>
'年龄'
,
'patient_gender'
=>
'
问诊人
性别'
,
'patient_gender'
=>
'性别'
,
'diagnosis_id'
=>
'诊断表ID'
,
'diagnosis_id'
=>
'诊断表ID'
,
'diagnosis_name'
=>
'诊断'
,
'diagnosis_name'
=>
'诊断'
,
'inquiry_info'
=>
'问诊问题'
,
'inquiry_info'
=>
'问诊问题'
,
'drug_info'
=>
'
用药信息
'
,
'drug_info'
=>
'
处方药
'
,
'doctor_id'
=>
'医师表ID'
,
'doctor_id'
=>
'医师表ID'
,
'doctor_name'
=>
'
医师姓名
'
,
'doctor_name'
=>
'
开方医师
'
,
'doctor_online_hospital_name'
=>
'医师互联网医院名称'
,
'doctor_online_hospital_name'
=>
'医师互联网医院名称'
,
'doctor_department'
=>
'医师科室'
,
'doctor_department'
=>
'医师科室'
,
'doctor_title'
=>
'医师职称'
,
'doctor_title'
=>
'医师职称'
,
'doctor_license_no'
=>
'医师执照编号'
,
'doctor_license_no'
=>
'医师执照编号'
,
'pharmacy_id'
=>
'药店表ID'
,
'pharmacy_id'
=>
'药店表ID'
,
'pharmacy_name'
=>
'药店
名称
'
,
'pharmacy_name'
=>
'药店'
,
'pharmacist_id'
=>
'药师表ID'
,
'pharmacist_id'
=>
'药师表ID'
,
'pharmacist_name'
=>
'
药师姓名
'
,
'pharmacist_name'
=>
'
审方药师
'
,
'pharmacist_license_number'
=>
'药师执照编号'
,
'pharmacist_license_number'
=>
'药师执照编号'
,
'prescriptio
n_
umber'
=>
'处方单编号'
,
'prescriptio
_n
umber'
=>
'处方单编号'
,
],
],
'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