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
9b588ecb
authored
Dec 04, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.imohe.com/zhaozengyu/tzt-admin
into develop
parents
2c52ce36
4e3f78e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
app/Admin/Controllers/DoctorController.php
+2
-2
app/Api/Controllers/DrugController.php
+2
-1
app/Api/Controllers/PrescriptionController.php
+5
-2
app/Models/DoctorModel.php
+12
-0
No files found.
app/Admin/Controllers/DoctorController.php
View file @
9b588ecb
...
@@ -48,7 +48,7 @@ protected function grid()
...
@@ -48,7 +48,7 @@ protected function grid()
$grid
->
column
(
'user.openid'
,
'关联用户'
);
$grid
->
column
(
'user.openid'
,
'关联用户'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'created_at'
);
// $grid->column('updated_at')->sortable();
// $grid->column('updated_at')->sortable();
$grid
->
column
(
'type'
,
'医师类型'
)
->
using
(
DoctorModel
::
DOCTOR_TYPE_MAP
);
// 快捷搜索
// 快捷搜索
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
$grid
->
quickSearch
([
'name'
,
'mobile'
,
'id_card'
])
->
placeholder
(
'请输入[姓名|手机号|身份证号码]'
)
->
width
(
25
);
...
@@ -131,7 +131,7 @@ protected function form()
...
@@ -131,7 +131,7 @@ protected function form()
$form
->
display
(
'user_id'
);
$form
->
display
(
'user_id'
);
$form
->
switch
(
'status'
);
$form
->
switch
(
'status'
);
$form
->
switch
(
'is_auto'
);
$form
->
switch
(
'is_auto'
);
$form
->
radio
(
'type'
,
'医师类型'
)
->
options
(
DoctorModel
::
DOCTOR_TYPE_MAP
)
->
default
(
DoctorModel
::
DOCTOR_TYPE_WM
)
->
required
();
$form
->
display
(
'created_at'
);
$form
->
display
(
'created_at'
);
$form
->
display
(
'updated_at'
);
$form
->
display
(
'updated_at'
);
});
});
...
...
app/Api/Controllers/DrugController.php
View file @
9b588ecb
...
@@ -128,6 +128,7 @@ public function drugLimit(Request $request)
...
@@ -128,6 +128,7 @@ public function drugLimit(Request $request)
$drugCounts
[
$drugId
]
=
(
$drugCounts
[
$drugId
]
??
0
)
+
$drugInfo
[
'num'
];
$drugCounts
[
$drugId
]
=
(
$drugCounts
[
$drugId
]
??
0
)
+
$drugInfo
[
'num'
];
}
}
}
}
// 查询已经开过方的药方(7天内)
// 查询已经开过方的药方(7天内)
$sevenDayAgo
=
Carbon
::
now
()
->
subDay
(
7
);
$sevenDayAgo
=
Carbon
::
now
()
->
subDay
(
7
);
$prescriptions_7
=
PrescriptionModel
::
where
(
'patient_id'
,
$patient_id
)
$prescriptions_7
=
PrescriptionModel
::
where
(
'patient_id'
,
$patient_id
)
...
@@ -158,7 +159,7 @@ public function drugLimit(Request $request)
...
@@ -158,7 +159,7 @@ public function drugLimit(Request $request)
if
(
$canBuyMahuangCount
<
0
)
{
if
(
$canBuyMahuangCount
<
0
)
{
$canBuyMahuangCount
=
0
;
$canBuyMahuangCount
=
0
;
}
}
Log
::
info
(
'all_limit_num=>'
.
$limit_num
.
' drugCounts=>'
.
$drugCounts
.
' drugs=>'
.
$drugs
.
' canBuyMahuangCount=>'
.
$canBuyMahuangCount
);
// 处理麻黄素药品数据
// 处理麻黄素药品数据
$mahuangsu_buy_num
=
0
;
// 本次购买麻黄素药品数量
$mahuangsu_buy_num
=
0
;
// 本次购买麻黄素药品数量
$exclusions
=
[];
// 单个药品的排他管理
$exclusions
=
[];
// 单个药品的排他管理
...
...
app/Api/Controllers/PrescriptionController.php
View file @
9b588ecb
...
@@ -109,6 +109,9 @@ public function create(Request $request)
...
@@ -109,6 +109,9 @@ public function create(Request $request)
$inquirys
=
$request
->
input
(
'inquirys'
);
// [['inquiry_id'=>1, 'answer'=>1]]
$inquirys
=
$request
->
input
(
'inquirys'
);
// [['inquiry_id'=>1, 'answer'=>1]]
$drugs
=
$request
->
input
(
'drugs'
);
// [['pharmacy_drug_id'=>2, 'num'=>1]]
$drugs
=
$request
->
input
(
'drugs'
);
// [['pharmacy_drug_id'=>2, 'num'=>1]]
$prescription_type
=
$request
->
input
(
'prescription_type'
,
0
);
$prescription_type
=
$request
->
input
(
'prescription_type'
,
0
);
# 医师类型
$doctor_type
=
$prescription_type
==
PrescriptionModel
::
PRESCRIPTION_TYPE_WM
?
[
DoctorModel
::
DOCTOR_TYPE_ALL
,
DoctorModel
::
DOCTOR_TYPE_WM
]
:
[
DoctorModel
::
DOCTOR_TYPE_ALL
,
DoctorModel
::
DOCTOR_TYPE_TCM
];
$pharmacy
=
null
;
$pharmacy
=
null
;
$open_source
=
0
;
$open_source
=
0
;
// 获取当前用户信息,如果是药店则无需传pharmacy_id参数
// 获取当前用户信息,如果是药店则无需传pharmacy_id参数
...
@@ -241,13 +244,13 @@ public function create(Request $request)
...
@@ -241,13 +244,13 @@ public function create(Request $request)
}
else
{
}
else
{
return
$this
->
failed
(
'医师开方数超过限制'
);
return
$this
->
failed
(
'医师开方数超过限制'
);
}
}
$randomDoctor
=
$randomQuery
->
inRandomOrder
()
->
first
();
$randomDoctor
=
$randomQuery
->
whereIn
(
'type'
,
$doctor_type
)
->
inRandomOrder
()
->
first
();
// $randomDoctor = DoctorModel::whereIn('id', $availableDoctors)
// $randomDoctor = DoctorModel::whereIn('id', $availableDoctors)
// ->where('status', DoctorModel::STATUS_TRUE)
// ->where('status', DoctorModel::STATUS_TRUE)
// ->inRandomOrder()
// ->inRandomOrder()
// ->first();
// ->first();
}
else
{
}
else
{
$randomDoctor
=
DoctorModel
::
inRandomOrder
()
->
where
(
'status'
,
DoctorModel
::
STATUS_TRUE
)
->
first
();
$randomDoctor
=
DoctorModel
::
inRandomOrder
()
->
where
In
(
'type'
,
$doctor_type
)
->
where
(
'status'
,
DoctorModel
::
STATUS_TRUE
)
->
first
();
}
}
if
(
!
$randomDoctor
)
{
if
(
!
$randomDoctor
)
{
...
...
app/Models/DoctorModel.php
View file @
9b588ecb
...
@@ -43,6 +43,18 @@ class DoctorModel extends Model
...
@@ -43,6 +43,18 @@ class DoctorModel extends Model
self
::
IS_AUTO_TRUE
=>
'success'
,
self
::
IS_AUTO_TRUE
=>
'success'
,
];
];
const
DOCTOR_TYPE_ALL
=
2
;
const
DOCTOR_TYPE_WM
=
0
;
const
DOCTOR_TYPE_TCM
=
1
;
// 性别-文字映射
const
DOCTOR_TYPE_MAP
=
[
self
::
DOCTOR_TYPE_ALL
=>
'全部'
,
self
::
DOCTOR_TYPE_WM
=>
'西药'
,
self
::
DOCTOR_TYPE_TCM
=>
'中药'
,
];
// 医师所属于的用户,一对一
// 医师所属于的用户,一对一
public
function
user
()
public
function
user
()
{
{
...
...
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