删除不需要的代码

This commit is contained in:
shengchanzhe 2023-12-25 16:06:39 +08:00
parent 7a3903dfec
commit a20d9e9999

View File

@ -201,42 +201,7 @@ class StoreOtherOrderRepository extends BaseRepository
$order->transaction_id = $subOrders[$order->order_sn]['transaction_id'];
}
$presell = false;
//todo 等待付尾款
if ($order->activity_type == 2) {
$_make = app()->make(ProductPresellSkuRepository::class);
if ($order->orderProduct[0]['cart_info']['productPresell']['presell_type'] == 2) {
$order->status = 10;
$presell = true;
} else {
$_make->incCount($order->orderProduct[0]['activity_id'], $order->orderProduct[0]['product_sku'], 'two_pay');
}
$_make->incCount($order->orderProduct[0]['activity_id'], $order->orderProduct[0]['product_sku'], 'one_pay');
} else if ($order->activity_type == 4) {
$order->status = 9;
$order->save();
$group_buying_id = app()->make(ProductGroupBuyingRepository::class)->create(
$groupOrder->user,
$order->orderProduct[0]['cart_info']['activeSku']['product_group_id'],
$order->orderProduct[0]['activity_id'],
$order->order_id
);
$order->orderProduct[0]->activity_id = $group_buying_id;
$order->orderProduct[0]->save();
} else if ($order->activity_type == 3) {
//更新助力状态
app()->make(ProductAssistSetRepository::class)->changStatus($order->orderProduct[0]['activity_id']);
}
//更新委托订单处理
if ($order->activity_type == 99) {
$cartIdArray = explode(',', $order->cart_id);
$ecartList = Db::name('store_cart')->whereIn('cart_id', $cartIdArray)->select();
foreach ($ecartList as $ecart) {
if (!empty($ecart['source_id'])) {
Db::name('community')->where('community_id', $ecart['source_id'])->update(['entrust_order_id' => $order->order_id ?? 0]);
}
}
}
// 订单的类型 0 发货 1 自提
if ($order->order_type == 1 && $order->status != 10) {
$order->verify_code = $this->verifyCode();
@ -253,13 +218,6 @@ class StoreOtherOrderRepository extends BaseRepository
'user_type' => $storeOrderStatusRepository::U_TYPE_USER,
];
//TODO 成为推广员
foreach ($order->orderProduct as $product) {
if ($flag && $product['cart_info']['product']['is_gift_bag']) {
app()->make(UserRepository::class)->promoter($order->uid);
$flag = false;
}
}
if ($order->order_type == 0) {
//发起队列物流信息处理
//event('order.sendGoodsCode', $order);
@ -305,36 +263,7 @@ class StoreOtherOrderRepository extends BaseRepository
}
if (!$presell) {
if ($order['extension_one'] > 0) {
$finance[] = [
'order_id' => $order->order_id,
'order_sn' => $order->order_sn,
'user_info' => $groupOrder->user->nickname,
'user_id' => $uid,
'financial_type' => 'brokerage_one',
'financial_pm' => 0,
'type' => 1,
'number' => $order['extension_one'],
'mer_id' => $order->mer_id,
'financial_record_sn' => $financeSn . ($i++)
];
}
if ($order['extension_two'] > 0) {
$finance[] = [
'order_id' => $order->order_id,
'order_sn' => $order->order_sn,
'user_info' => $groupOrder->user->nickname,
'user_id' => $uid,
'financial_type' => 'brokerage_two',
'financial_pm' => 0,
'type' => 1,
'number' => $order['extension_two'],
'mer_id' => $order->mer_id,
'financial_record_sn' => $financeSn . ($i++)
];
}
if ($order['commission_rate'] > 0) {
$finance[] = [
'order_id' => $order->order_id,
@ -409,14 +338,8 @@ class StoreOtherOrderRepository extends BaseRepository
'id' => $order->order_id
]
], $order->mer_id);
//自动打印订单
$this->autoPrinter($order->order_id, $order->mer_id);
}
//分销判断
// if ($groupOrder->user->spread_uid) {
// Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_pay_num', 'inc' => 1]);
// Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->user->spread_uid, 'type' => 'spread_money', 'inc' => $groupOrder->pay_price]);
// }
app()->make(UserRepository::class)->update($groupOrder->uid, [
'pay_count' => Db::raw('pay_count+' . count($groupOrder->orderList)),
'pay_price' => Db::raw('pay_price+' . $groupOrder->pay_price),
@ -445,21 +368,6 @@ class StoreOtherOrderRepository extends BaseRepository
Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_money', 'inc' => $groupOrder->pay_price]);
Queue::push(UserBrokerageLevelJob::class, ['uid' => $groupOrder->uid, 'type' => 'pay_num', 'inc' => 1]);
app()->make(UserBrokerageRepository::class)->incMemberValue($groupOrder->uid, 'member_pay_num', $groupOrder->group_order_id);
$groupOrder = $groupOrder->toArray();
event('order.paySuccess', compact('groupOrder'));
//店内扫码支付
if (isset($groupOrder['micro_pay']) && $groupOrder['micro_pay'] == 1) {
$order = $this->dao->search(['uid' => $groupOrder->uid])->where('group_order_id', $groupOrder->group_order_id)->find();
$order->status = 2;
$order->verify_time = date('Y-m-d H:i:s');
$user = $order->user;
event('order.take.before', compact('order'));
Db::transaction(function () use ($order, $user) {
$this->takeAfter($order, $user);
$order->save();
});
event('order.take', compact('order'));
}
}