25 lines
591 B
PHP
25 lines
591 B
PHP
<?php
|
|
|
|
namespace app\common\service\pay;
|
|
|
|
use app\common\logic\CapitalFlowLogic;
|
|
use app\common\model\user\User;
|
|
|
|
/**
|
|
* 余额支付
|
|
* Class BalancePay
|
|
* @package app\common\service\pay
|
|
*/
|
|
class BalancePay extends PayTool
|
|
{
|
|
|
|
public function refund($amount, $order)
|
|
{
|
|
$user = User::where('id', $order['uid'])->findOrEmpty();
|
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
|
$capitalFlowDao->userIncome('now_money_refund', 'system_back', $order['id'], $amount);
|
|
$user->now_money = bcadd($user['now_money'], $amount, 2);
|
|
$user->save();
|
|
}
|
|
|
|
} |