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
d8e1223d
Commit
d8e1223d
authored
Nov 15, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
22beee32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
AppController.php
api/controllers/AppController.php
+24
-0
TradeController.php
api/controllers/TradeController.php
+49
-0
No files found.
api/controllers/AppController.php
View file @
d8e1223d
...
...
@@ -25,4 +25,27 @@ class AppController extends BaseController
$data
[
'version_code'
]
=
(
integer
)
$data
[
'version_code'
];
return
$data
;
}
public
function
actionNewUpdate
()
{
$type
=
\Yii
::
$app
->
request
->
post
(
'type'
,
1
);
$data
=
AppVersion
::
getLastStable
(
$type
);
if
(
$data
)
{
$logItems
=
json_decode
(
$data
[
'log'
]);
$logstr
=
''
;
foreach
(
$logItems
as
$item
){
if
(
$logstr
){
$logstr
.=
"
\n
"
.
$item
;
}
else
{
$logstr
=
$item
;
}
}
$data
[
'log'
]
=
$logstr
;
}
$data
[
'id'
]
=
(
integer
)
$data
[
'id'
];
$data
[
'status'
]
=
(
integer
)
$data
[
'status'
];
$data
[
'version_code'
]
=
(
integer
)
$data
[
'version_code'
];
return
$data
;
}
}
\ No newline at end of file
api/controllers/TradeController.php
0 → 100644
View file @
d8e1223d
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/11/14
* Time: 18:53
*/
namespace
api\controllers
;
use
api\base\BaseController
;
use
Yii
;
class
TradeController
extends
BaseController
{
/**
* 添加本地备注
*/
public
function
actionAddMemo
()
{
$request
=
Yii
::
$app
->
request
;
$hash
=
$request
->
post
(
'hash'
);
$memo
=
$request
->
post
(
'memo'
);
if
(
$hash
&&
$memo
){
Yii
::
$app
->
redis_app
->
hset
(
'trade_hash_memo'
,
$hash
,
$memo
);
return
[
'code'
=>
0
,
'data'
=>
[],
'msg'
=>
'本地备注添加成功'
];
}
else
{
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'交易hash值或者本地备注不能为空'
];
}
}
/**
* 查看本地备注
*/
public
function
actionGetMemo
()
{
$request
=
Yii
::
$app
->
request
;
$hash
=
$request
->
post
(
'hash'
);
if
(
$hash
){
$memo
=
Yii
::
$app
->
redis_app
->
hget
(
'trade_hash_memo'
,
$hash
);
return
[
'code'
=>
0
,
'data'
=>
$memo
];
}
else
{
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'交易hash值不能为空'
];
}
}
}
\ No newline at end of file
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