Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪伟伟
data-collect
Commits
de649a99
Commit
de649a99
authored
Jan 18, 2024
by
汪伟伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
30a1c57d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
app/Admin/Extensions/Tools/BatchReceiveAction.php
+1
-1
app/Admin/Extensions/Tools/ReceiveAction.php
+5
-0
No files found.
app/Admin/Extensions/Tools/BatchReceiveAction.php
View file @
de649a99
...
@@ -35,7 +35,7 @@ class BatchReceiveAction extends BatchAction
...
@@ -35,7 +35,7 @@ class BatchReceiveAction extends BatchAction
// 获取选中的ID数组
// 获取选中的ID数组
$keys
=
$this
->
getKey
();
$keys
=
$this
->
getKey
();
$user
=
\Admin
::
user
();
$user
=
\Admin
::
user
();
$counts
=
TasksReceive
::
query
()
->
where
(
'user_id'
,
$user
->
id
)
->
where
(
'status'
,
0
)
->
count
();
$counts
=
TasksReceive
::
query
()
->
where
(
'user_id'
,
$user
->
id
)
->
where
In
(
'status'
,[
0
,
2
]
)
->
count
();
if
(
count
(
$keys
)
+
$counts
>
10
){
if
(
count
(
$keys
)
+
$counts
>
10
){
return
$this
->
response
()
->
error
(
'最多只能领取十个任务'
);
return
$this
->
response
()
->
error
(
'最多只能领取十个任务'
);
}
}
...
...
app/Admin/Extensions/Tools/ReceiveAction.php
View file @
de649a99
...
@@ -54,6 +54,11 @@ class ReceiveAction extends RowAction
...
@@ -54,6 +54,11 @@ class ReceiveAction extends RowAction
$exists
=
TasksReceive
::
query
()
->
where
(
'task_id'
,
$id
)
->
where
(
'user_id'
,
$user
->
id
)
->
exists
();
$exists
=
TasksReceive
::
query
()
->
where
(
'task_id'
,
$id
)
->
where
(
'user_id'
,
$user
->
id
)
->
exists
();
$task
=
Task
::
query
()
->
find
(
$id
);
$task
=
Task
::
query
()
->
find
(
$id
);
$counts
=
TasksReceive
::
query
()
->
where
(
'user_id'
,
$user
->
id
)
->
whereIn
(
'status'
,[
0
,
2
])
->
count
();
if
(
$counts
>
9
){
return
$this
->
response
()
->
error
(
'最多只能领取十个任务'
);
}
if
(
!
$exists
&&
$task
->
num
>
0
){
if
(
!
$exists
&&
$task
->
num
>
0
){
$receive
=
TasksReceive
::
query
()
->
create
([
$receive
=
TasksReceive
::
query
()
->
create
([
'task_id'
=>
$id
,
'task_id'
=>
$id
,
...
...
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