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
19b4b421
authored
Nov 19, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开方
parent
751f01ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
app/Admin/Controllers/PharmacyController.php
+2
-2
app/Api/Controllers/PrescriptionController.php
+4
-3
No files found.
app/Admin/Controllers/PharmacyController.php
View file @
19b4b421
...
...
@@ -146,8 +146,8 @@ protected function form()
$role
=
Role
::
where
(
'slug'
,
'pharmacy'
)
->
first
();
// 从表单模型获取手机号和其他信息
$mobile
=
$form
->
mobile
;
$name
=
$form
->
name
;
$mobile
=
$form
->
mo
del
()
->
mo
bile
;
$name
=
$form
->
model
()
->
name
;
$pharmacyId
=
$form
->
getKey
();
// 查找当前是否已有管理员
...
...
app/Api/Controllers/PrescriptionController.php
View file @
19b4b421
...
...
@@ -105,6 +105,7 @@ public function create(Request $request)
}
else
{
return
$this
->
failed
(
'pharmacy_id不能为空'
);
}
// 生成处方
$prescription
=
new
PrescriptionModel
;
$prescription
->
status
=
PrescriptionModel
::
PRESCRIPTION_STATUS_PENDING
;
...
...
@@ -175,7 +176,7 @@ public function create(Request $request)
$prescription
->
doctor_department
=
$randomDoctor
->
department
;
$prescription
->
doctor_title
=
$randomDoctor
->
doctor_title
;
$prescription
->
doctor_license_no
=
$randomDoctor
->
license_no
;
$prescription
->
doctor_signed_pic
=
$randomDoctor
->
signed_pic
;
$prescription
->
doctor_signed_pic
=
$randomDoctor
->
getRawOriginal
(
'signed_pic'
)
;
// 药店信息
$prescription
->
pharmacy_id
=
$pharmacy
->
id
;
$prescription
->
pharmacy_name
=
$pharmacy
->
name
;
...
...
@@ -184,14 +185,14 @@ public function create(Request $request)
->
where
(
'pharmacy_id'
,
$pharmacy_id
)
->
where
(
function
(
$query
)
{
$query
->
where
(
'is_default'
,
1
)
->
orWhere
Null
(
'is_default'
);
->
orWhere
(
'is_default'
,
0
);
})
->
inRandomOrder
()
->
first
();
$prescription
->
pharmacist_id
=
$pharmacist
->
id
;
$prescription
->
pharmacist_name
=
$pharmacist
->
name
;
$prescription
->
pharmacist_license_number
=
$pharmacist
->
license_number
;
$prescription
->
pharmacist_signed_pic
=
$pharmacist
->
signed_pic
;
$prescription
->
pharmacist_signed_pic
=
$pharmacist
->
getRawOriginal
(
'signed_pic'
)
;
// 生成处方单信息
$prescription_at
=
Carbon
::
now
()
->
subMinutes
(
12
);
...
...
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