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
9ff9cf3e
Commit
9ff9cf3e
authored
5 years ago
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整返回数据
parent
fb4759e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
PlatformCoinsController.php
api/controllers/PlatformCoinsController.php
+5
-4
VisitStatisticsController.php
api/controllers/VisitStatisticsController.php
+2
-2
CoinAppVersion.php
common/models/psources/CoinAppVersion.php
+2
-2
No files found.
api/controllers/PlatformCoinsController.php
View file @
9ff9cf3e
...
...
@@ -23,7 +23,7 @@ class PlatformCoinsController extends BaseController
$type
=
Yii
::
$app
->
request
->
post
(
'type'
,
''
);
if
(
empty
(
$platform_id
)
||
empty
(
$coins_address
)
||
empty
(
$type
)){
return
[
'code'
=>
-
1
,
'data'
=>
[]
,
'msg'
=>
'缺少必要的参数'
];
return
[
'code'
=>
-
1
,
'data'
=>
null
,
'msg'
=>
'缺少必要的参数'
];
}
$item_array
=
[];
...
...
@@ -38,14 +38,14 @@ class PlatformCoinsController extends BaseController
]
;
}
if
(
empty
(
$item_array
)){
return
[
'code'
=>
-
1
,
'data'
=>
[]
,
'msg'
=>
'数据重复插入'
];
return
[
'code'
=>
-
1
,
'data'
=>
null
,
'msg'
=>
'数据重复插入'
];
}
$result
=
CoinPlatformCoins
::
batchImport
(
$item_array
);
if
(
!
$result
){
return
[
'code'
=>
-
1
,
'data'
=>
[]
,
'msg'
=>
'数据导入失败'
];
return
[
'code'
=>
-
1
,
'data'
=>
null
,
'msg'
=>
'数据导入失败'
];
}
return
[
'code'
=>
0
,
'data'
=>
[]
,
'msg'
=>
'数据导入成功'
];
return
[
'code'
=>
0
,
'data'
=>
null
,
'msg'
=>
'数据导入成功'
];
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
api/controllers/VisitStatisticsController.php
View file @
9ff9cf3e
...
...
@@ -99,9 +99,9 @@ class VisitStatisticsController extends BaseController
$model_coinDailyTimes
=
new
CoinDailyTimes
();
$model_coinDailyTimes
->
setScenario
(
CoinDailyTimes
::
SCENARIOS_CREATE
);
if
(
$model_coinDailyTimes
->
load
(
Yii
::
$app
->
request
->
get
(),
''
)
&&
$model_coinDailyTimes
->
save
())
{
return
[
'code'
=>
0
,
'data'
=>
[]
,
'msg'
=>
'数据记录插入成功'
];
return
[
'code'
=>
0
,
'data'
=>
null
,
'msg'
=>
'数据记录插入成功'
];
}
else
{
return
[
'code'
=>
-
1
,
'data'
=>
[]
,
'msg'
=>
current
(
$model_coinDailyTimes
->
firstErrors
)];
return
[
'code'
=>
-
1
,
'data'
=>
null
,
'msg'
=>
current
(
$model_coinDailyTimes
->
firstErrors
)];
}
}
...
...
This diff is collapsed.
Click to expand it.
common/models/psources/CoinAppVersion.php
View file @
9ff9cf3e
...
...
@@ -45,8 +45,8 @@ class CoinAppVersion extends BaseActiveRecord
*/
public
static
function
getLastStable
(
$type
=
1
,
$platform_id
=
1
)
{
$max_version
=
self
::
find
()
->
where
([
'type'
=>
$type
,
'platform_id'
=>
$platform_id
])
->
max
(
'version
'
);
$data
=
self
::
find
()
->
where
([
'type'
=>
$type
,
'platform_id'
=>
$platform_id
,
'version
'
=>
$max_version
])
->
asArray
()
->
one
();
$max_version
_code
=
self
::
find
()
->
where
([
'type'
=>
$type
,
'platform_id'
=>
$platform_id
])
->
max
(
'version_code
'
);
$data
=
self
::
find
()
->
where
([
'type'
=>
$type
,
'platform_id'
=>
$platform_id
,
'version
_code'
=>
$max_version_code
])
->
asArray
()
->
one
();
return
$data
;
}
...
...
This diff is collapsed.
Click to expand it.
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