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
3aedb8c6
authored
Nov 23, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加日志
parent
8f77d058
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
app/Api/Controllers/PrescriptionController.php
+2
-0
No files found.
app/Api/Controllers/PrescriptionController.php
View file @
3aedb8c6
...
@@ -198,10 +198,12 @@ public function create(Request $request)
...
@@ -198,10 +198,12 @@ public function create(Request $request)
->
groupBy
(
'doctor_id'
)
->
groupBy
(
'doctor_id'
)
->
pluck
(
'prescription_count'
,
'doctor_id'
);
->
pluck
(
'prescription_count'
,
'doctor_id'
);
Log
::
info
(
'医师开方统计:'
.
json_encode
(
$prescriptionCounts
)
.
'<==sql==>'
.
$prescriptionCounts
->
toSql
());
// 筛选未达到上限的医师
// 筛选未达到上限的医师
$availableDoctors
=
collect
(
$doctorIds
)
->
filter
(
function
(
$doctorId
)
use
(
$prescriptionCounts
,
$prescription_limit
)
{
$availableDoctors
=
collect
(
$doctorIds
)
->
filter
(
function
(
$doctorId
)
use
(
$prescriptionCounts
,
$prescription_limit
)
{
return
$prescriptionCounts
->
get
(
$doctorId
,
0
)
<
$prescription_limit
;
return
$prescriptionCounts
->
get
(
$doctorId
,
0
)
<
$prescription_limit
;
})
->
values
()
->
all
();
})
->
values
()
->
all
();
Log
::
info
(
'有效的医师:'
.
json_encode
(
$availableDoctors
));
// 随机取一个随机医师
// 随机取一个随机医师
$randomQuery
=
DoctorModel
::
query
()
->
where
(
'status'
,
DoctorModel
::
STATUS_TRUE
);
$randomQuery
=
DoctorModel
::
query
()
->
where
(
'status'
,
DoctorModel
::
STATUS_TRUE
);
if
(
count
(
$availableDoctors
)
>
0
)
{
if
(
count
(
$availableDoctors
)
>
0
)
{
...
...
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