更新修改用户余额支付日志流水记录逻辑修改
This commit is contained in:
parent
84d056bfaf
commit
b67259a91e
@ -132,6 +132,10 @@ class OrderEnum
|
||||
const REFUND_STATUS_FINISH = 2;
|
||||
const CANCEL_SALE = 3;
|
||||
|
||||
//判断资金流水是否余额支付
|
||||
const BALANCE_PAYMEN_NO = 1;
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取支付类型
|
||||
* @param bool $value
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\common\logic;
|
||||
|
||||
use app\common\enum\OrderEnum;
|
||||
use app\common\model\finance\CapitalFlow;
|
||||
|
||||
class CapitalFlowLogic extends BaseLogic
|
||||
@ -55,21 +56,22 @@ class CapitalFlowLogic extends BaseLogic
|
||||
* @param $mark
|
||||
* @return mixed
|
||||
*/
|
||||
public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0)
|
||||
public function userExpense($store_id=0,$category, $linkType, $linkId, $amount, $mark = '',$payType=0)
|
||||
{
|
||||
$model = new CapitalFlow();
|
||||
$model->uid = $this->user['id'];
|
||||
$model->category = $category;
|
||||
$model->store_id = $store_id;
|
||||
$model->link_type = $linkType;
|
||||
$model->link_id = $linkId;
|
||||
$model->amount = $amount;
|
||||
// if($payType == 1){
|
||||
if($payType == OrderEnum::BALANCE_PAYMEN_NO){
|
||||
$model->before_balance = $this->user['now_money'];
|
||||
$model->balance = $this->user['now_money'];
|
||||
// }else{
|
||||
// $model->before_balance = $this->user['now_money'];
|
||||
// $model->balance = bcsub($this->user['now_money'], $amount, 2);
|
||||
// }
|
||||
}else{
|
||||
$model->before_balance = $this->user['now_money'];
|
||||
$model->balance = bcsub($this->user['now_money'], $amount, 2);
|
||||
}
|
||||
$model->create_time = date('Y-m-d H:i:s');
|
||||
$model->type = 'out';
|
||||
$model->title = $this->getTitle($category, $amount);
|
||||
|
@ -78,7 +78,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
$user->save();
|
||||
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order['pay_price']);
|
||||
$capitalFlowDao->userExpense($order['store_id'],'user_order_pay', 'order', $order['id'], $order['pay_price']);
|
||||
// self::afterPay($order);
|
||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||
@ -112,7 +112,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
$user->save();
|
||||
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price']);
|
||||
$capitalFlowDao->userExpense($order['store_id'],'user_order_purchase_pay', 'order', $order['id'], $order['pay_price'],'',1);
|
||||
if ($user['user_ship'] == 1) {
|
||||
VipLogic::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
||||
}
|
||||
@ -151,7 +151,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
} else {
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
//微信支付和用户余额无关
|
||||
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 1);
|
||||
$capitalFlowDao->userExpense($order['store_id'],'user_order_pay', 'order', $order['id'], $order->pay_price, '', 1);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user