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
9c0b22c2
Commit
9c0b22c2
authored
Apr 26, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update column
parent
6ea915a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
VisitStatisticsController.php
api/controllers/VisitStatisticsController.php
+12
-9
CoinDailyNumbers.php
common/models/psources/CoinDailyNumbers.php
+2
-2
CoinDailyTimes.php
common/models/psources/CoinDailyTimes.php
+2
-2
No files found.
api/controllers/VisitStatisticsController.php
View file @
9c0b22c2
...
...
@@ -19,23 +19,25 @@ class VisitStatisticsController extends BaseController
public
function
actionIndex
()
{
$dapp
=
Yii
::
$app
->
request
->
get
(
'dapp
'
,
''
);
$dapp
_name
=
Yii
::
$app
->
request
->
get
(
'dapp_name
'
,
''
);
$identify
=
Yii
::
$app
->
request
->
get
(
'identify'
,
''
);
$duration
=
Yii
::
$app
->
request
->
get
(
'duration'
,
''
);
$address
=
Yii
::
$app
->
request
->
get
(
'address'
,
''
);
$dapp_address
=
Yii
::
$app
->
request
->
get
(
'dapp_address'
,
''
);
$coins_address
=
Yii
::
$app
->
request
->
get
(
'coins_address'
,
''
);
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
''
);
if
(
empty
(
$dapp
)
||
empty
(
$identify
)
||
empty
(
$duration
)
||
empty
(
$
address
)
||
empty
(
$platform_id
)){
if
(
empty
(
$dapp
_name
)
||
empty
(
$identify
)
||
empty
(
$duration
)
||
empty
(
$dapp_address
)
||
empty
(
$coins_
address
)
||
empty
(
$platform_id
)){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'缺少必要的参数'
];
}
$isExistModel
=
CoinDailyStatistics
::
find
()
->
where
([
'identify'
=>
$identify
,
'platform_id'
=>
$platform_id
])
->
one
();
if
(
!
$isExistModel
)
{
$model
=
new
CoinDailyStatistics
();
$model
->
dapp
=
$dapp
;
$model
->
dapp_name
=
$dapp_name
;
$model
->
dapp_address
=
$dapp_address
;
$model
->
duration
=
$duration
;
$model
->
address
=
$address
;
$model
->
identify
=
$identify
;
$model
->
coins_address
=
$coins_address
;
$model
->
platform_id
=
$platform_id
;
$model
->
save
();
return
[
'code'
=>
0
,
'data'
=>
[],
'msg'
=>
'数据记录插入成功'
];
...
...
@@ -50,18 +52,19 @@ class VisitStatisticsController extends BaseController
public
function
actionDailyTimes
()
{
$dapp
=
Yii
::
$app
->
request
->
get
(
'dapp'
,
''
);
$address
=
Yii
::
$app
->
request
->
get
(
'address'
,
''
);
$dapp_name
=
Yii
::
$app
->
request
->
get
(
'dapp_name'
,
''
);
$dapp_address
=
Yii
::
$app
->
request
->
get
(
'dapp_address'
,
''
);
$coins_address
=
Yii
::
$app
->
request
->
get
(
'coins_address'
,
''
);
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
''
);
if
(
empty
(
$dapp
)
||
empty
(
$
address
)
||
empty
(
$platform_id
)){
if
(
empty
(
$dapp
_name
)
||
empty
(
$dapp_address
)
||
empty
(
$coins_
address
)
||
empty
(
$platform_id
)){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'缺少必要的参数'
];
}
$begin
=
date
(
"Y-m-d"
,
time
())
.
" 00:00:00"
;
$end
=
date
(
"Y-m-d"
,
time
())
.
" 23:59:59"
;
$isExist_coinDailyNumbers
=
CoinDailyNumbers
::
find
()
->
where
([
'dapp
'
=>
$dapp
,
'address'
=>
$
address
,
'platform_id'
=>
$platform_id
])
->
where
([
'dapp
_name'
=>
$dapp_name
,
'dapp_address'
=>
$dapp_address
,
'coins_address'
=>
$coins_
address
,
'platform_id'
=>
$platform_id
])
->
andWhere
([
'between'
,
'create_time'
,
$begin
,
$end
])
->
one
();
if
(
!
$isExist_coinDailyNumbers
){
...
...
common/models/psources/CoinDailyNumbers.php
View file @
9c0b22c2
...
...
@@ -25,14 +25,14 @@ class CoinDailyNumbers extends BaseActiveRecord
public
function
rules
()
{
return
[
[[
'dapp
'
,
'
address'
,
'platform_id'
],
'required'
],
[[
'dapp
_name'
,
'dapp_address'
,
'coins_
address'
,
'platform_id'
],
'required'
],
[[
'platform_id'
],
'match'
,
'pattern'
=>
'/^[0-9]+$/'
,
'message'
=>
'{attribute} 必须为数字'
],
];
}
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'dapp
'
,
'
address'
,
'platform_id'
],
self
::
SCENARIOS_CREATE
=>
[
'dapp
_name'
,
'dapp_address'
,
'coins_
address'
,
'platform_id'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
common/models/psources/CoinDailyTimes.php
View file @
9c0b22c2
...
...
@@ -25,14 +25,14 @@ class CoinDailyTimes extends BaseActiveRecord
public
function
rules
()
{
return
[
[[
'dapp
'
,
'
address'
,
'platform_id'
],
'required'
],
[[
'dapp
_name'
,
'dapp_address'
,
'coins_
address'
,
'platform_id'
],
'required'
],
[[
'platform_id'
],
'match'
,
'pattern'
=>
'/^[0-9]+$/'
,
'message'
=>
'{attribute} 必须为数字'
],
];
}
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'dapp
'
,
'
address'
,
'platform_id'
],
self
::
SCENARIOS_CREATE
=>
[
'dapp
_name'
,
'dapp_address'
,
'coins_
address'
,
'platform_id'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
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