完善小组采购,商户、分佣财务记录

This commit is contained in:
monanxiao 2023-03-15 16:38:51 +08:00
parent efb659107b
commit a111c728cf
2 changed files with 16 additions and 2 deletions

View File

@ -1154,7 +1154,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$_order = [ $_order = [
'cartInfo' => $merchantCart, 'cartInfo' => $merchantCart,
'activity_type' => $orderInfo['order_type'], 'activity_type' => $orderInfo['order_type'],
'commission_rate' => $makePrice, 'commission_rate' => $shareRate,
'order_type' => $merchantCart['order']['isTake'] ? 1 : 0, 'order_type' => $merchantCart['order']['isTake'] ? 1 : 0,
'is_virtual' => $order_model ? 1 : 0, 'is_virtual' => $order_model ? 1 : 0,
'order_sn' => $this->getNewOrderId() . ($k + 1), 'order_sn' => $this->getNewOrderId() . ($k + 1),

View File

@ -233,8 +233,11 @@ class StoreOrderRepository extends BaseRepository
//更新助力状态 //更新助力状态
app()->make(ProductAssistSetRepository::class)->changStatus($order->orderProduct[0]['activity_id']); app()->make(ProductAssistSetRepository::class)->changStatus($order->orderProduct[0]['activity_id']);
} }
// 订单的类型 0 发货 1 自提
if ($order->order_type == 1 && $order->status != 10) if ($order->order_type == 1 && $order->status != 10)
{
$order->verify_code = $this->verifyCode(); $order->verify_code = $this->verifyCode();
}
$order->save(); $order->save();
$orderStatus[] = [ $orderStatus[] = [
'order_id' => $order->order_id, 'order_id' => $order->order_id,
@ -250,6 +253,7 @@ class StoreOrderRepository extends BaseRepository
} }
} }
// 商户流水账单数据
$finance[] = [ $finance[] = [
'order_id' => $order->order_id, 'order_id' => $order->order_id,
'order_sn' => $order->order_sn, 'order_sn' => $order->order_sn,
@ -263,7 +267,17 @@ class StoreOrderRepository extends BaseRepository
'financial_record_sn' => $financeSn . ($i++) 'financial_record_sn' => $financeSn . ($i++)
]; ];
$_payPrice = bcsub($order->pay_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2); // 判断购买来源 小组采购或者普通购买
if($order['source'] == 1)
{
// 商户可获得金额 商户可得的钱 小组服务采购
$_payPrice = $order->pay_price;
}else{
// 商户可获得金额 减去佣金金额 == 商户可得的钱 分销推广或普通购买
$_payPrice = bcsub($order->pay_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2);
}
if ($presell) { if ($presell) {
if (isset($order->orderProduct[0]['cart_info']['presell_extension_one']) && $order->orderProduct[0]['cart_info']['presell_extension_one'] > 0) { if (isset($order->orderProduct[0]['cart_info']['presell_extension_one']) && $order->orderProduct[0]['cart_info']['presell_extension_one'] > 0) {
$_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_one'], 2); $_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_one'], 2);