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
8a44edf3
authored
Nov 20, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加药品用法用量过滤
parent
d2e22d49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
app/Api/Controllers/DrugController.php
+1
-0
app/Api/Controllers/PrescriptionController.php
+6
-2
database/migrations/2024_11_20_153412_add_doctor_introduction_to_prescription_table.php
+28
-0
No files found.
app/Api/Controllers/DrugController.php
View file @
8a44edf3
...
@@ -64,6 +64,7 @@ public function drugList(Request $request)
...
@@ -64,6 +64,7 @@ public function drugList(Request $request)
}
}
$search_input
=
$request
->
input
(
'search_input'
);
$search_input
=
$request
->
input
(
'search_input'
);
$data
=
PharmacyDrugModel
::
where
(
'pharmacy_id'
,
$pharmacy_id
)
$data
=
PharmacyDrugModel
::
where
(
'pharmacy_id'
,
$pharmacy_id
)
->
whereNotNull
(
'dosage_id'
)
->
whereHas
(
'drug'
,
function
(
$query
)
use
(
$search_input
)
{
->
whereHas
(
'drug'
,
function
(
$query
)
use
(
$search_input
)
{
if
(
$search_input
)
{
if
(
$search_input
)
{
$query
->
where
(
'name'
,
'LIKE'
,
"%
{
$search_input
}
%"
)
$query
->
where
(
'name'
,
'LIKE'
,
"%
{
$search_input
}
%"
)
...
...
app/Api/Controllers/PrescriptionController.php
View file @
8a44edf3
...
@@ -77,7 +77,10 @@ public function prescriptionList(Request $request)
...
@@ -77,7 +77,10 @@ public function prescriptionList(Request $request)
// 处方详情
// 处方详情
public
function
detail
(
Request
$request
)
public
function
detail
(
Request
$request
)
{
{
$prescription_id
=
$request
->
input
(
'prescription_id'
);
$c
=
$request
->
input
(
'prescription_id'
);
if
(
empty
(
$prescription_id
)
||
!
filter_var
(
$prescription_id
,
FILTER_VALIDATE_INT
))
{
return
$this
->
failed
(
'ID不能为空且必须为整数'
);
}
$prescription
=
PrescriptionModel
::
query
()
->
where
(
'id'
,
$prescription_id
)
->
first
();
$prescription
=
PrescriptionModel
::
query
()
->
where
(
'id'
,
$prescription_id
)
->
first
();
return
$this
->
success
(
$prescription
);
return
$this
->
success
(
$prescription
);
...
@@ -197,12 +200,13 @@ public function create(Request $request)
...
@@ -197,12 +200,13 @@ public function create(Request $request)
}
}
$prescription
->
doctor_id
=
$randomDoctor
->
id
;
$prescription
->
doctor_id
=
$randomDoctor
->
id
;
$prescription
->
doctor_name
=
$randomDoctor
->
m
ame
;
$prescription
->
doctor_name
=
$randomDoctor
->
n
ame
;
$prescription
->
doctor_online_hospital_name
=
$randomDoctor
->
online_hospital_name
;
$prescription
->
doctor_online_hospital_name
=
$randomDoctor
->
online_hospital_name
;
$prescription
->
doctor_department
=
$randomDoctor
->
department
;
$prescription
->
doctor_department
=
$randomDoctor
->
department
;
$prescription
->
doctor_title
=
$randomDoctor
->
doctor_title
;
$prescription
->
doctor_title
=
$randomDoctor
->
doctor_title
;
$prescription
->
doctor_license_no
=
$randomDoctor
->
license_no
;
$prescription
->
doctor_license_no
=
$randomDoctor
->
license_no
;
$prescription
->
doctor_signed_pic
=
$randomDoctor
->
getRawOriginal
(
'signed_pic'
);
$prescription
->
doctor_signed_pic
=
$randomDoctor
->
getRawOriginal
(
'signed_pic'
);
$prescription
->
doctor_introduction
=
$randomDoctor
->
doctor_introduction
;
// 药店信息
// 药店信息
$prescription
->
pharmacy_id
=
$pharmacy
->
id
;
$prescription
->
pharmacy_id
=
$pharmacy
->
id
;
$prescription
->
pharmacy_name
=
$pharmacy
->
name
;
$prescription
->
pharmacy_name
=
$pharmacy
->
name
;
...
...
database/migrations/2024_11_20_153412_add_doctor_introduction_to_prescription_table.php
0 → 100644
View file @
8a44edf3
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
()
:
void
{
Schema
::
table
(
'prescription'
,
function
(
Blueprint
$table
)
{
$table
->
text
(
'doctor_introduction'
)
->
nullable
()
->
comment
(
'医师简介'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'prescription'
,
function
(
Blueprint
$table
)
{
//
});
}
};
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