Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
33e4ace6
Commit
33e4ace6
authored
Apr 02, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
cda4552e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
AirDropController.php
api/controllers/AirDropController.php
+3
-2
AirDropController.php
console/controllers/AirDropController.php
+32
-0
No files found.
api/controllers/AirDropController.php
View file @
33e4ace6
...
...
@@ -52,8 +52,6 @@ class AirDropController extends BaseController
$apply_record_model
->
update_time
=
$val
;
$apply_record_model
->
save
()
&&
$apply_record_model
->
id
=
0
;;
}
$transaction
->
commit
();
}
catch
(
Exception
$e
)
{
$transaction
->
rollback
();
...
...
@@ -65,6 +63,9 @@ class AirDropController extends BaseController
if
(
empty
(
$this
->
msg
))
{
$this
->
msg
=
'Validation failed.'
;
}
$redis
=
Yii
::
$app
->
redis_app
;
$redis
->
hmset
(
'airdrop:'
.
$data
[
'identifier'
],
'draw_success'
,
0
,
'income'
,
0
,
'reach_time'
,
0
);
goto
doEnd
;
}
...
...
console/controllers/AirDropController.php
View file @
33e4ace6
...
...
@@ -13,6 +13,38 @@ use common\models\psources\AirDropApplyTransferRecord;
class
AirDropController
extends
Controller
{
/**
* 统计每个树莓派达标次数,已领取,未领取
* @return
*/
public
function
actionStatistics
()
{
$expiry_date
=
date
(
"Y-m-d 00:00:00"
,
strtotime
(
"+1 day"
));
$apply
=
AirDrop
::
find
()
->
select
(
'id, identifier, finish_time'
)
->
where
([
'<'
,
'create_time'
,
$expiry_date
])
->
asArray
()
->
all
();
if
(
empty
(
$apply
)
||
empty
(
$apply
->
record
))
{
return
0
;
}
foreach
(
$apply
as
$val
)
{
$reach
=
AirDropApplyRecord
::
find
()
->
where
([
'apply_id'
=>
$val
[
'id'
],
'reach'
=>
AirDropApplyRecord
::
REACH_YES
])
->
sum
(
'reach'
);
$reach
=
empty
(
$reach
)
?
0
:
$reach
;
$draw
=
AirDropApplyRecord
::
find
()
->
where
([
'apply_id'
=>
$val
[
'id'
],
'draw_status'
=>
AirDropApplyRecord
::
STATUS_DRAW_SUEEESS
])
->
sum
(
'reach'
);
$draw
=
empty
(
$draw
)
?
0
:
$draw
;
$reach
=
AirDropApplyRecord
::
find
()
->
where
([
'apply_id'
=>
$val
[
'id'
],
'reach'
=>
AirDropApplyRecord
::
REACH_YES
])
->
sum
(
'reach'
);
$reach
=
empty
(
$reach
)
?
0
:
$reach
;
}
return
0
;
}
/**
* 获取矿工地址的对应的冷钱包地址
* @return
*/
...
...
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