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
793776c1
authored
Nov 17, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式化
parent
1dbc1010
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
31 deletions
+41
-31
app/Admin/Controllers/DrugTagController.php
+2
-0
app/Admin/Controllers/DrugUnitController.php
+2
-0
app/Api/Controllers/PharmacistController.php
+37
-29
app/Api/Controllers/PharmacyController.php
+0
-2
No files found.
app/Admin/Controllers/DrugTagController.php
View file @
793776c1
...
...
@@ -39,9 +39,11 @@ protected function grid()
$filter
->
like
(
'tag_name'
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
$grid
->
disableRowSelector
();
// 禁用行选择器
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Admin/Controllers/DrugUnitController.php
View file @
793776c1
...
...
@@ -29,9 +29,11 @@ protected function grid()
$filter
->
like
(
'name'
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
// 行按钮控制
$grid
->
disableDeleteButton
();
// 禁用删除按钮
$grid
->
disableViewButton
();
// 禁用详情按钮
$grid
->
disableRowSelector
();
// 禁用行选择器
// 工具栏按钮控制
$grid
->
disableBatchDelete
();
// 禁用批量删除
...
...
app/Api/Controllers/PharmacistController.php
View file @
793776c1
...
...
@@ -10,8 +10,8 @@
class
PharmacistController
extends
BaseApiController
{
#
药师列表
public
function
pharmacistList
()
//
药师列表
public
function
pharmacistList
()
{
$authInfo
=
auth
(
'api'
)
->
user
();
$pharmacy
=
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
...
...
@@ -19,14 +19,15 @@ public function pharmacistList()
return
$this
->
failed
(
'药店信息不存在'
);
}
$pharmacist
=
PharmacistModel
::
where
(
'pharmacy_id'
,
$pharmacy
->
id
)
->
get
();
return
$this
->
success
(
$pharmacist
);
}
# 药师信息
public
function
detail
(
Request
$request
)
// 药师信息
public
function
detail
(
Request
$request
)
{
$pharmacist_id
=
$request
->
input
(
'pharmacist_id'
);
if
(
empty
(
$pharmacist_id
)
||
!
filter_var
(
$pharmacist_id
,
FILTER_VALIDATE_INT
))
{
if
(
empty
(
$pharmacist_id
)
||
!
filter_var
(
$pharmacist_id
,
FILTER_VALIDATE_INT
))
{
return
$this
->
failed
(
'ID不能为空且必须为整数'
);
}
$authInfo
=
auth
(
'api'
)
->
user
();
...
...
@@ -43,8 +44,8 @@ public function detail(Request $request)
}
}
#
证书上传
public
function
uploadCertificate
(
Request
$request
)
//
证书上传
public
function
uploadCertificate
(
Request
$request
)
{
// 验证上传的图片文件
$validated
=
$request
->
validate
([
...
...
@@ -86,18 +87,19 @@ public function uploadCertificate(Request $request)
// 返回图片地址
$imageUrl
=
Storage
::
disk
(
'cos'
)
->
url
(
'license-images/'
.
$fileName
);
// 删除临时文件
unlink
(
storage_path
(
'app/public/'
.
$fileName
));
return
$this
->
success
([
'message'
=>
'ok'
,
'url'
=>
$imageUrl
]);
}
else
{
return
$this
->
failed
(
'签名图片上传失败'
);
}
}
#
药师新增
public
function
add
(
Request
$request
)
//
药师新增
public
function
add
(
Request
$request
)
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 获取药店信息
...
...
@@ -108,17 +110,19 @@ public function add(Request $request)
$pharmacist
->
id_card
=
$request
->
input
(
'id_card'
);
$pharmacist
->
mobile
=
$request
->
input
(
'mobile'
);
$pharmacist
->
license_number
=
$request
->
input
(
'license_number'
);
$pharmacist
->
practicing_license
=
$request
->
input
(
'practicing_license'
);
#
执业注册证书链接
$pharmacist
->
practicing_license
=
$request
->
input
(
'practicing_license'
);
//
执业注册证书链接
$pharmacist
->
practicing_license_expired_time
=
$request
->
input
(
'practicing_license_expired_time'
);
$pharmacist
->
physician_license
=
$request
->
input
(
'physician_license'
);
#
执业资格证书链接
$pharmacist
->
physician_license
=
$request
->
input
(
'physician_license'
);
//
执业资格证书链接
$pharmacist
->
status
=
0
;
if
(
$pharmacist
->
save
()
)
{
if
(
$pharmacist
->
save
())
{
return
$this
->
success
(
$pharmacist
);
}
return
$this
->
failed
(
"药师新增失败!"
);
return
$this
->
failed
(
'药师新增失败!'
);
}
# 药师编辑
public
function
update
(
Request
$request
)
// 药师编辑
public
function
update
(
Request
$request
)
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 获取药店信息
...
...
@@ -134,36 +138,40 @@ public function update(Request $request)
$pharmacist
->
id_card
=
$request
->
input
(
'id_card'
);
$pharmacist
->
mobile
=
$request
->
input
(
'mobile'
);
$pharmacist
->
license_number
=
$request
->
input
(
'license_number'
);
$pharmacist
->
practicing_license
=
$request
->
input
(
'practicing_license'
);
#
执业注册证书链接
$pharmacist
->
practicing_license
=
$request
->
input
(
'practicing_license'
);
//
执业注册证书链接
$pharmacist
->
practicing_license_expired_time
=
$request
->
input
(
'practicing_license_expired_time'
);
$pharmacist
->
physician_license
=
$request
->
input
(
'physician_license'
);
#
执业资格证书链接
if
(
$pharmacist
->
save
()
)
{
$pharmacist
->
physician_license
=
$request
->
input
(
'physician_license'
);
//
执业资格证书链接
if
(
$pharmacist
->
save
())
{
return
$this
->
success
(
$pharmacist
);
}
return
$this
->
failed
(
"药师编辑失败"
);
return
$this
->
failed
(
'药师编辑失败'
);
}
# 设置默认药师
public
function
setDefault
(
Request
$request
)
{
// 设置默认药师
public
function
setDefault
(
Request
$request
)
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 获取药店信息
$pharmacy
=
PharmacyModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
if
(
!
$pharmacy
)
{
return
$this
->
failed
(
'该药店不存在'
);
}
#
把该药店下的所有药师默认状态改为0
//
把该药店下的所有药师默认状态改为0
PharmacistModel
::
where
(
'pharmacy_id'
,
$pharmacy
->
id
)
->
update
([
'is_default'
=>
0
]);
$pharmacist
=
PharmacistModel
::
where
(
'id'
,
$request
->
input
(
'id'
))
->
first
();
if
(
empty
(
$pharmacist
))
{
return
$this
->
failed
(
'该药师不存在'
);
}
$pharmacist
->
is_default
=
1
;
if
(
$pharmacist
->
save
()
)
{
if
(
$pharmacist
->
save
())
{
return
$this
->
success
(
$pharmacist
);
}
return
$this
->
failed
(
"设置默认药师失败!"
);
return
$this
->
failed
(
'设置默认药师失败!'
);
}
# 药师签名上传
// 药师签名上传
public
function
upload
(
Request
$request
)
{
...
...
app/Api/Controllers/PharmacyController.php
View file @
793776c1
...
...
@@ -9,7 +9,6 @@
use
App\Models\PrescriptionLogModel
;
use
App\Models\PrescriptionModel
;
use
Carbon\Carbon
;
use
Illuminate\Http\Request
;
// 药店控制器
...
...
@@ -107,7 +106,6 @@ public function prescription(Request $request)
$pharmacistLog
->
log_info
=
$prescription
->
pharmacist_name
.
'在'
.
$currentTime
.
'为'
.
$prescription
->
patient_name
.
'('
.
$patient
->
mobile
.
')审方(处方单编号:'
.
$prescription
->
id
.
')'
;
$pharmacistLog
->
save
();
return
$this
->
success
(
'审方成功'
);
}
else
{
return
$this
->
failed
(
'审方失败'
);
...
...
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