feat(CommissionLogic): 根据订单类型和ID查询费用并记录用户余额收入

This commit is contained in:
mkm 2024-07-27 16:41:36 +08:00
parent 8d0b39c8e0
commit 8056fce1da

View File

@ -161,11 +161,11 @@ class CommissionLogic extends BaseLogic
public static function user($order, $type, $transaction_id, $uid = 0, $enum = 0)
{
$financeLogic = new StoreFinanceFlowLogic();
$fees=StoreFinanceFlowProduct::where('oid',$order['id'])->where('type',$type)->sum('number');
if ($fees > 0) {
$fees=StoreFinanceFlowProduct::where('oid',$order['id'])->where('type',$type)->field('sum(number) as fees,other_uid')->find();
if ($fees && $fees['fees'] > 0) {
//记录用户余额收入
$financeLogic->user['uid'] = $order['uid'];
$financeLogic->other_arr['vip_uid'] = $uid;
$financeLogic->other_arr['vip_uid'] = $fees['other_uid'];
$financeLogic->order = $order;
$financeLogic->in($transaction_id, $fees, $enum, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
$financeLogic->out($transaction_id, $fees, $enum, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);