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