feat(CapitalFlowLogic): 修改资金流水逻辑,增加支付类型判断
This commit is contained in:
parent
8f9ba883a2
commit
7e99a8afa9
@ -3,6 +3,7 @@
|
||||
namespace app\common\logic;
|
||||
|
||||
use app\common\enum\OrderEnum;
|
||||
use app\common\enum\PayEnum;
|
||||
use app\common\model\finance\CapitalFlow;
|
||||
|
||||
class CapitalFlowLogic extends BaseLogic
|
||||
@ -72,12 +73,12 @@ class CapitalFlowLogic extends BaseLogic
|
||||
$model->link_type = $linkType;
|
||||
$model->link_id = $linkId;
|
||||
$model->amount = $amount;
|
||||
if ($payType == OrderEnum::BALANCE_PAYMEN_NO) {
|
||||
$model->before_balance = $this->user['purchase_funds'];
|
||||
$model->balance = bcsub($this->user['purchase_funds'], $amount, 2);
|
||||
} else {
|
||||
$model->before_balance = $this->user['now_money'];
|
||||
$model->balance = bcsub($this->user['now_money'], $amount, 2);
|
||||
if ($payType == PayEnum::PURCHASE_FUNDS) {
|
||||
$model->before_balance = bcadd($this->user['purchase_funds'],$amount,2);
|
||||
$model->balance = $this->user['purchase_funds'];
|
||||
} elseif ($payType == PayEnum::BALANCE_PAY){
|
||||
$model->before_balance = bcadd($this->user['now_money'],$amount,2);
|
||||
$model->balance = $this->user['now_money'];
|
||||
}
|
||||
$model->create_time = date('Y-m-d H:i:s');
|
||||
$model->type = 'out';
|
||||
|
Loading…
x
Reference in New Issue
Block a user