feat(StoreOrderController): 添加采购款支付处理逻辑
This commit is contained in:
parent
b5b364a3d1
commit
4b686647c4
@ -24,7 +24,7 @@ class UserValidate extends BaseValidate
|
|||||||
'nickname' => 'require',
|
'nickname' => 'require',
|
||||||
'account' => 'require',
|
'account' => 'require',
|
||||||
'password' => 'require',
|
'password' => 'require',
|
||||||
'mobile' => 'require|mobile',
|
'mobile' => 'require|unique:user',
|
||||||
'is_disable' => 'in:0,1',
|
'is_disable' => 'in:0,1',
|
||||||
'sex' => 'in:1,2',
|
'sex' => 'in:1,2',
|
||||||
'province' => 'require',
|
'province' => 'require',
|
||||||
|
@ -113,8 +113,8 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
|
|
||||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||||
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price']);
|
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price']);
|
||||||
if($user['user_ship'] == 1){
|
if ($user['user_ship'] == 1) {
|
||||||
VipLogic::dealVipAmount($order,PayEnum::PURCHASE_FUNDS);
|
VipLogic::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// self::afterPay($order);
|
// self::afterPay($order);
|
||||||
@ -306,18 +306,18 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$financeLogic->order = $order;
|
$financeLogic->order = $order;
|
||||||
$financeLogic->user = ['uid' => $order['uid']];
|
$financeLogic->user = ['uid' => $order['uid']];
|
||||||
// if ($order->pay_type != 9 || $order->pay_type != 10) {
|
// if ($order->pay_type != 9 || $order->pay_type != 10) {
|
||||||
$financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::USER_ORDER_PAY,$order['store_id'], $order['staff_id'], 0, $order['pay_type']); //用户订单支付
|
$financeLogic->in($transaction_id, $order['pay_price'], OrderEnum::USER_ORDER_PAY, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //用户订单支付
|
||||||
$count_frees = 0;
|
$count_frees = 0;
|
||||||
//商户应该获得的钱 每个商品的price-ot_price 利润
|
//商户应该获得的钱 每个商品的price-ot_price 利润
|
||||||
// if (isset($order->profit) && $order->profit > 0) {
|
// if (isset($order->profit) && $order->profit > 0) {
|
||||||
if($order['uid']>0){
|
if ($order['uid'] > 0) {
|
||||||
$user_number=bcmul($order['pay_price'], '0.10', 2);
|
$user_number = bcmul($order['pay_price'], '0.10', 2);
|
||||||
$sing = [
|
$sing = [
|
||||||
'uid' => $order['uid'],
|
'uid' => $order['uid'],
|
||||||
'order_id' => $order['order_id'],
|
'order_id' => $order['order_id'],
|
||||||
'title' => '购买商品获得兑换券',
|
'title' => '购买商品获得兑换券',
|
||||||
'store_id' => $order['store_id'],
|
'store_id' => $order['store_id'],
|
||||||
'number' =>$user_number,
|
'number' => $user_number,
|
||||||
];
|
];
|
||||||
$user_sing->save($sing);
|
$user_sing->save($sing);
|
||||||
User::where('id', $order['uid'])->inc('integral', $user_number)->update();
|
User::where('id', $order['uid'])->inc('integral', $user_number)->update();
|
||||||
@ -357,7 +357,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$financeLogic->in($transaction_id, $store_profit, OrderEnum::MERCHANT_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']); //平台手续费
|
$financeLogic->in($transaction_id, $store_profit, OrderEnum::MERCHANT_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']); //平台手续费
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($order['is_vip'] >= 1) {
|
// if ($order['is_vip'] >= 1) {
|
||||||
if ($order['spread_uid'] > 0) {
|
if ($order['spread_uid'] > 0) {
|
||||||
$financeLogic->other_arr['vip_uid'] = $order['spread_uid'];
|
$financeLogic->other_arr['vip_uid'] = $order['spread_uid'];
|
||||||
$fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2);
|
$fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2);
|
||||||
@ -427,7 +427,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$financeLogic->in($transaction_id, $fees, OrderEnum::OTHER_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']);
|
$financeLogic->in($transaction_id, $fees, OrderEnum::OTHER_ORDER_OBTAINS, $order['store_id'], 0, 0, $order['pay_type']);
|
||||||
$financeLogic->out($transaction_id, $fees, OrderEnum::OTHER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
|
$financeLogic->out($transaction_id, $fees, OrderEnum::OTHER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
$fees = bcsub($order['pay_price'], $count_frees, 2);
|
$fees = bcsub($order['pay_price'], $count_frees, 2);
|
||||||
//供应链订单获得
|
//供应链订单获得
|
||||||
if ($fees > 0) {
|
if ($fees > 0) {
|
||||||
|
@ -207,9 +207,11 @@ class StoreOrderController extends BaseAdminController
|
|||||||
if (!$order) {
|
if (!$order) {
|
||||||
return $this->fail('订单不存在或已支付');
|
return $this->fail('订单不存在或已支付');
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($pay_type) {
|
switch ($pay_type) {
|
||||||
|
case PayEnum::PURCHASE_FUNDS:
|
||||||
|
//采购款支付
|
||||||
|
PayNotifyLogic::handle('purchase_funds', $order['order_id'], ['uid' => $order['uid']]);
|
||||||
|
return $this->success('采购款支付成功', ['id' => $order['id']]);
|
||||||
case PayEnum::CASH_PAY:
|
case PayEnum::CASH_PAY:
|
||||||
//现金支付
|
//现金支付
|
||||||
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
PayNotifyLogic::handle('cash_pay', $order['order_id']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user