Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
af70a603
Commit
af70a603
authored
Aug 07, 2018
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.2b3.cn/hdllbackend/services
parents
297763f9
3c108200
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
85 deletions
+33
-85
src/Buyer/Lib/BillInterface.php
+4
-33
src/BuyerDistribution/Enum/BuyerDistributionError.php
+0
-33
src/Common/Exception/ExceptionData.php
+8
-4
src/Seller/Lib/SellerFundInterface.php
+9
-15
src/SellerDistribution/Lib/SellerDistributionInterface.php
+12
-0
No files found.
src/Buyer
Distribution/Lib/BuyerDistribution
Interface.php
→
src/Buyer
/Lib/Bill
Interface.php
View file @
af70a603
...
@@ -6,48 +6,20 @@
...
@@ -6,48 +6,20 @@
* Time: 13:48
* Time: 13:48
*/
*/
namespace
Hdll\Services\Buyer
Distribution
\Lib
;
namespace
Hdll\Services\Buyer\Lib
;
use
Swoft\Core\ResultInterface
;
/**
/**
* @method ResultInterface deferAddSellerFreezeMoney(int $storeId,int $money)
* @method ResultInterface deferGetBuyerCommission(int $buyerId)
* @method ResultInterface deferGetSellerFund(int $storeId)
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* Interface AgencyInterface
* Interface AgencyInterface
* @package App\Lib
* @package App\Lib
*/
*/
interface
BuyerDistributionInterface
{
interface
BillInterface
{
/**
* 增加卖家冻结金额
* @param int $storeId
* @param int $money 冻结金额(千分)
* @return mixed
* @author Administrator
*/
public
function
addSellerFreezeMoney
(
int
$storeId
,
int
$money
);
/**
* 获取买家佣金数据
* @param int $buyerId
* @return mixed
* @author Administrator
*/
public
function
getBuyerCommission
(
int
$buyerId
);
/**
* 获取卖家资金数据
* @param int $storeId
* @return mixed
* @author Administrator
*/
public
function
getSellerFund
(
int
$storeId
);
/**
/**
* 保存账单数据
* 保存账单数据
* @param string $token
* @param int $order_id
* @param int $order_id
* @param int $buyer_id
* @param int $buyer_id
* @param int $store_id
* @param int $store_id
...
@@ -57,7 +29,6 @@ interface BuyerDistributionInterface{
...
@@ -57,7 +29,6 @@ interface BuyerDistributionInterface{
* @author Administrator
* @author Administrator
*/
*/
public
function
saveBill
(
public
function
saveBill
(
string
$token
,
int
$order_id
,
int
$order_id
,
int
$buyer_id
,
int
$buyer_id
,
int
$store_id
,
int
$store_id
,
...
...
src/BuyerDistribution/Enum/BuyerDistributionError.php
deleted
100644 → 0
View file @
297763f9
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace
Hdll\Services\Order\Enum
;
class
BuyerDistributionError
{
const
E101
=
[
'101'
,
'金额不能小于0'
];
const
E102
=
[
102
,
'该数据不属于您'
,
403
];
const
E103
=
[
103
,
'请勿重复创建'
,
403
];
const
E104
=
[
104
,
'该用户不存在或属于您的团队'
,
403
];
public
function
getError
(
$code
)
{
$reflect
=
new
\ReflectionClass
(
self
::
class
);
$arr
=
$reflect
->
getConstant
(
'E'
.
substr
(
$code
,
-
3
));
if
(
!
is_array
(
$arr
))
{
return
false
;
}
return
[
'code'
=>
$arr
[
0
],
'msg'
=>
$arr
[
1
],
'errorCode'
=>
$arr
[
2
],
];
}
}
\ No newline at end of file
src/Common/Exception/ExceptionData.php
View file @
af70a603
...
@@ -40,14 +40,18 @@ class ExceptionData
...
@@ -40,14 +40,18 @@ class ExceptionData
if
(
is_callable
([
$e
,
"getPath"
])
)
{
//自建异常类处理path
if
(
is_callable
([
$e
,
"getPath"
])
)
{
//自建异常类处理path
$data
[
'path'
]
=
json_decode
(
$e
->
getPath
(),
true
);
$data
[
'path'
]
=
json_decode
(
$e
->
getPath
(),
true
);
//获取调用堆栈信息
$info
=
debug_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
,
1
)[
0
];
//将此次异常信息入站
array_unshift
(
$data
[
'path'
],
'Service:'
.
APP_NAME
.
' file:'
.
$info
[
'file'
]
.
'('
.
$info
[
'line'
]
.
')'
);
}
else
{
//系统异常统一报500错误
}
else
{
//系统异常统一报500错误
$data
[
'code'
]
=
500
;
$data
[
'code'
]
=
500
;
//将此次异常信息入站
array_unshift
(
$data
[
'path'
],
'Service:'
.
APP_NAME
.
' file:'
.
$e
->
getFile
()
.
'('
.
$e
->
getLine
()
.
')'
);
}
}
//获取调用堆栈信息
$info
=
debug_backtrace
(
DEBUG_BACKTRACE_IGNORE_ARGS
,
1
)[
0
];
//将此次异常信息入站
array_unshift
(
$data
[
'path'
],
'Service:'
.
APP_NAME
.
' file:'
.
$info
[
'file'
]
.
'('
.
$info
[
'line'
]
.
')'
);
return
[
'msg'
=>
json_encode
(
$data
),
'code'
=>
$data
[
'code'
]];
return
[
'msg'
=>
json_encode
(
$data
),
'code'
=>
$data
[
'code'
]];
...
...
src/Seller/Lib/SellerFundInterface.php
View file @
af70a603
...
@@ -12,31 +12,24 @@ use Swoft\Core\ResultInterface;
...
@@ -12,31 +12,24 @@ use Swoft\Core\ResultInterface;
/**
/**
*
*
* @method ResultInterface deferWithdraw($sellerId, $money)
* @method ResultInterface deferGetFund($sellerId)
* @method ResultInterface deferWithdrawFail($sellerId, $money)
* Interface SellerInterface
* Interface SellerInterface
* @package App\Lib
* @package App\Lib
*/
*/
interface
SellerFundInterface
interface
SellerFundInterface
{
{
/**
* 提现
* @param $sellerId
* @param $money (分)
* @return mixed
* @author Administrator
*/
public
function
withdraw
(
$sellerId
,
$money
);
/**
/**
*
提现失败
*
* @param $sellerId
* @param $sellerId
* @param $money (分)
* @return mixed
* @return mixed
* totalFund 累计资金
* balanceFund 可提现金额
* commissionFund 需要支付的佣金
* expectFund 冻结金额
* totalWithdraw 累计提现
* @author Administrator
* @author Administrator
*/
*/
public
function
withdrawFail
(
$sellerId
,
$money
);
public
function
getFund
(
$sellerId
);
}
}
\ No newline at end of file
src/SellerDistribution/Lib/SellerDistributionInterface.php
View file @
af70a603
...
@@ -10,6 +10,7 @@ use Swoft\Core\ResultInterface;
...
@@ -10,6 +10,7 @@ use Swoft\Core\ResultInterface;
/**
/**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money)
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money)
* @method ResultInterface deferGetCommission($sellerId)
* Interface SellerDistributionInterface
* Interface SellerDistributionInterface
* @package App\Lib
* @package App\Lib
*/
*/
...
@@ -28,4 +29,14 @@ interface SellerDistributionInterface{
...
@@ -28,4 +29,14 @@ interface SellerDistributionInterface{
*/
*/
public
function
saveBill
(
$orderId
,
$sellerId
,
$money
);
public
function
saveBill
(
$orderId
,
$sellerId
,
$money
);
/**
* 获取佣金信息
* @param $sellerId
* @return mixed
* totalCommission 累计佣金
* balanceCommission 可提现佣金
* @author Administrator
*/
public
function
getCommission
(
$sellerId
);
}
}
\ 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