Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
95aec8ad
Commit
95aec8ad
authored
Apr 13, 2018
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加钱包服务
parent
689162d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
Wallet.php
src/ucenter/Wallet.php
+55
-0
No files found.
src/ucenter/Wallet.php
0 → 100644
View file @
95aec8ad
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2018/4/13
* Time: 14:58
*/
namespace
internalApi\ucenter
;
use
internalApi\base\Client
;
/**
* 用户钱包
* @package internalApi\ucenter
*/
class
Wallet
extends
Client
{
const
TURNOVER_TYPE_INCOME
=
'income'
;
//收入
const
TURNOVER_TYPE_EXPEND
=
'disbursement'
;
//支出
const
TURNOVER_TYPE_FREEZE
=
'freeze'
;
//冻结
const
TURNOVER_TYPE_UNFREEZE
=
'unfreeze'
;
//解冻
/**
* 获取用户钱包信息
*
* @param int $uid
* @return array|false 查询失败则返回false
*/
public
static
function
queryWallet
(
$uid
)
{
return
self
::
call
(
'wallet.queryWallet'
,
compact
(
'uid'
));
}
/**
* 创建钱包流水
*
* 输入对应操作类型 $type 参数即可操作用户钱包,将直接影响到余额
*
* @param int $uid
* @param string $type 流水类型,使用 Wallet::TURNOVER_TYPE_ 前缀常量
* @param float $amount 金额,单位:元。可精确到小数点后两位数,即分
* @param string $busNumber 业务关联编号,自定义
* @param int $busId 业务关联ID
* @param string $busRemark 业务流水备注
* @param int $busTypeId 业务类型ID,保留默认
* @return int|false 交易成功返回流水ID,失败返回 false
*/
public
static
function
turnover
(
$uid
,
$type
,
$amount
,
$busNumber
=
null
,
$busId
=
null
,
$busRemark
=
null
,
$busTypeId
=
15522201
)
{
return
self
::
call
(
'wallet.turnover'
,
compact
(
'uid'
,
'type'
,
'amount'
,
'amount'
,
'busNumber'
,
'busId'
,
'busRemark'
,
'busTypeId'
));
}
}
\ 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