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
a7152986
Commit
a7152986
authored
Nov 12, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
各种接口
parent
568d7a0f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
0 deletions
+139
-0
TrusteeShipService.php
common/service/trusteeship/TrusteeShipService.php
+31
-0
UserController.php
wallet/controllers/UserController.php
+108
-0
No files found.
common/service/trusteeship/TrusteeShipService.php
View file @
a7152986
...
...
@@ -38,8 +38,13 @@ class TrusteeShipService
}
if
(
!
empty
(
$params
))
{
if
(
'GET'
==
strtoupper
(
$method
))
{
$ch
->
setGetParams
(
$params
);
}
if
(
'POST'
==
strtoupper
(
$method
))
{
$ch
->
setPostParams
(
$params
);
}
}
$result
=
$ch
->
$method
(
$this
->
urlBuild
(
$uri
),
false
);
if
(
!
$result
)
{
...
...
@@ -73,5 +78,31 @@ class TrusteeShipService
return
$this
->
send
(
"GET"
,
$uri
,
$params
);
}
public
function
getManualList
(
$params
=
[])
{
$uri
=
'backend/user/manual-real-list'
;
return
$this
->
send
(
"GET"
,
$uri
,
$params
);
}
public
function
verifyReal
(
$params
=
[])
{
$uri
=
'backend/user/verify-real'
;
return
$this
->
send
(
"POST"
,
$uri
,
$params
);
}
public
function
refuseReal
(
$params
=
[])
{
$uri
=
'backend/user/refuse-real'
;
return
$this
->
send
(
"POST"
,
$uri
,
$params
);
}
public
function
revokeReal
(
$params
=
[])
{
$uri
=
'backend/user/revoke-real'
;
return
$this
->
send
(
"POST"
,
$uri
,
$params
);
}
}
wallet/controllers/UserController.php
View file @
a7152986
...
...
@@ -175,4 +175,111 @@ class UserController extends BaseController
return
[
'code'
=>
1
,
'data'
=>
$result
[
'msg'
],
'msg'
=>
'success'
];
}
/**
* 人工实名全部列表
*/
public
function
actionManualList
()
{
$current_platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
if
(
1
===
$current_platform_id
)
{
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
1
);
$platform_id
=
empty
(
$platform_id
)
?
1
:
$platform_id
;
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
])){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'此钱包节点尚未开通'
];
}
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$page
=
Yii
::
$app
->
request
->
get
(
'page'
,
1
);
$size
=
Yii
::
$app
->
request
->
get
(
'size'
,
15
);
$status
=
Yii
::
$app
->
request
->
get
(
'status'
,
''
);
$search
=
Yii
::
$app
->
request
->
get
(
'search'
,
''
);
$start_time
=
Yii
::
$app
->
request
->
get
(
'start_time'
,
''
);
$end_time
=
Yii
::
$app
->
request
->
get
(
'end_time'
,
''
);
$params
=
[
'page'
=>
$page
,
'size'
=>
$size
,
'status'
=>
$status
,
'search'
=>
$search
,
'start_time'
=>
$start_time
,
'end_time'
=>
$end_time
];
$time
=
time
();
$appKey
=
isset
(
$node_params
[
'appKey'
])
?
$node_params
[
'appKey'
]
:
null
;
$appSecret
=
isset
(
$node_params
[
'appSecret'
])
?
$node_params
[
'appSecret'
]
:
null
;
$signature
=
self
::
getSign
(
$params
,
$appKey
,
$appSecret
,
$time
);
$headers
=
[
'FZM-Wallet-Signature'
=>
$signature
,
'FZM-Wallet-Timestamp'
=>
$time
,
'FZM-Wallet-AppKey'
=>
$appKey
,
'FZM-Wallet-AppIp'
=>
Yii
::
$app
->
request
->
userIP
];
$service
=
new
TrusteeShipService
(
$node_params
,
$headers
);
$result
=
$service
->
getManualList
(
$params
);
if
(
200
!==
$result
[
'code'
])
{
return
[
'code'
=>
$result
[
'code'
],
'data'
=>
[],
'msg'
=>
$result
[
'msg'
]];
}
return
[
'code'
=>
1
,
'data'
=>
$result
[
'msg'
],
'msg'
=>
'success'
];
}
public
function
actionVerify
()
{
$current_platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
if
(
1
===
$current_platform_id
)
{
$platform_id
=
Yii
::
$app
->
request
->
get
(
'platform_id'
,
1
);
$platform_id
=
empty
(
$platform_id
)
?
1
:
$platform_id
;
}
else
{
$platform_id
=
Yii
::
$app
->
request
->
getPlatformId
();
}
if
(
!
isset
(
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
])){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'此钱包节点尚未开通'
];
}
$node_params
=
Yii
::
$app
->
params
[
'trusteeship'
][
'node_'
.
$platform_id
];
$post
=
Yii
::
$app
->
request
->
post
();
$uid
=
isset
(
$post
[
'uid'
])
?
$post
[
'uid'
]
:
null
;
$action
=
isset
(
$post
[
'action'
])
?
$post
[
'action'
]
:
null
;
if
(
false
==
$uid
||
false
==
$action
){
return
[
'code'
=>
-
1
,
'data'
=>
[],
'msg'
=>
'参数错误'
];
}
$params
=
[
'uid'
=>
$uid
,
];
$time
=
time
();
$appKey
=
isset
(
$node_params
[
'appKey'
])
?
$node_params
[
'appKey'
]
:
null
;
$appSecret
=
isset
(
$node_params
[
'appSecret'
])
?
$node_params
[
'appSecret'
]
:
null
;
$signature
=
self
::
getSign
(
$params
,
$appKey
,
$appSecret
,
$time
);
$headers
=
[
'FZM-Wallet-Signature'
=>
$signature
,
'FZM-Wallet-Timestamp'
=>
$time
,
'FZM-Wallet-AppKey'
=>
$appKey
,
'FZM-Wallet-AppIp'
=>
Yii
::
$app
->
request
->
userIP
];
$service
=
new
TrusteeShipService
(
$node_params
,
$headers
);
if
(
'verify'
==
strtolower
(
$action
))
{
$result
=
$service
->
verifyReal
(
$params
);
}
if
(
'refuse'
==
strtolower
(
$action
))
{
$result
=
$service
->
refuseReal
(
$params
);
}
if
(
'revoke'
==
strtolower
(
$action
))
{
$result
=
$service
->
revokeReal
(
$params
);
}
if
(
200
!==
$result
[
'code'
])
{
return
[
'code'
=>
$result
[
'code'
],
'data'
=>
[],
'msg'
=>
$result
[
'msg'
]];
}
return
[
'code'
=>
1
,
'data'
=>
$result
[
'msg'
],
'msg'
=>
'success'
];
}
}
\ 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