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
4b0146c2
authored
Nov 21, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加作废接口
parent
6ea285f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
app/Api/Controllers/PrescriptionController.php
+23
-0
routes/api.php
+2
-0
No files found.
app/Api/Controllers/PrescriptionController.php
View file @
4b0146c2
...
...
@@ -271,4 +271,27 @@ public function create(Request $request)
return
$this
->
success
(
'ok'
);
}
// 处方作废
public
function
invalid
(
Request
$request
)
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 获取药店信息
$pharmacy
=
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
// 只有药店端可进行处方作废
$prescription_id
=
$request
->
input
(
'prescription_id'
);
$prescription
=
PrescriptionModel
::
where
(
'id'
,
$prescription_id
)
->
where
(
'pharmacy_id'
,
$pharmacy
->
id
)
->
first
();
if
(
$prescription
)
{
$prescription
->
is_voided
=
1
;
if
(
$prescription
->
save
())
{
return
$this
->
success
(
'处方作废成功'
);
}
}
return
$this
->
failed
(
'处方作废失败'
);
}
}
routes/api.php
View file @
4b0146c2
...
...
@@ -78,6 +78,8 @@
Route
::
get
(
'/prescriptions'
,
'App\Api\Controllers\PrescriptionController@prescriptionList'
);
# 处方详情
Route
::
post
(
'/prescription-detail'
,
'App\Api\Controllers\PrescriptionController@detail'
);
# 处方作废
Route
::
post
(
'/prescription-invalid'
,
'App\Api\Controllers\PrescriptionController@invalid'
);
# 开方
Route
::
post
(
'/prescription-create'
,
'App\Api\Controllers\PrescriptionController@create'
);
# 医师详情
...
...
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