退款金额问题处理

直播间商品回显
活动商品不检查普通商品的限购
拆单问题处理
This commit is contained in:
evoxwht 2023-03-24 17:25:54 +08:00
parent fd2f6b3a23
commit c65839b57e
4 changed files with 13 additions and 5 deletions

View File

@ -190,7 +190,8 @@ class RefundOrder extends AuthController
$refund_data['open_id'] = $wechatUserServices->uidToOpenid((int)$order['uid'], 'routine') ?? '';
$refund_data['refund_no'] = $orderRefund['order_id'];
//修改订单退款状态
$data['refund_price'] = $data['refunded_price'];
// $data['refund_price'] = $data['refunded_price'];
unset($data['refund_price']);
if ($this->services->agreeRefund($id, $refund_data)) {
$this->services->update($id, $data);
return app('json')->success(400149);

View File

@ -40,6 +40,10 @@ class LiveRoomServices extends BaseServices
$where['is_del'] = 0;
[$page, $limit] = $this->getPageValue();
$list = $this->dao->getList($where, '*', [], $page, $limit);
$liveProductServices = app()->make(LiveRoomGoodsServices::class);
foreach ($list as &$item) {
$item['product_ids'] = array_column($liveProductServices->selectList(['live_room_id' => $item['id']])->toArray(), 'live_goods_id');
}
$count = $this->dao->count($where);
return compact('count', 'list');
}

View File

@ -232,8 +232,10 @@ class StoreCartServices extends BaseServices
public function setCart(int $uid, int $product_id, int $cart_num = 1, string $product_attr_unique = '', int $type = 0, bool $new = true, int $combination_id = 0, int $seckill_id = 0, int $bargain_id = 0, int $advance_id = 0)
{
if ($cart_num < 1) $cart_num = 1;
//检查限购
$this->checkLimit($uid, $product_id, $cart_num, $new);
if ($type == 0) {
//检查限购
$this->checkLimit($uid, $product_id, $cart_num, $new);
}
//检测库存限量
[$attrInfo, $product_attr_unique, $bargainPriceMin, $cart_num, $productInfo] = $this->checkProductStock($uid, $cart_num, $product_attr_unique, $type, $product_id, $seckill_id, $bargain_id, $combination_id, $advance_id);
if ($new) {
@ -702,8 +704,8 @@ class StoreCartServices extends BaseServices
}
} else if ($limitInfo['limit_type'] == 2) {
$cartNum = $this->dao->sum(['uid' => $uid, 'product_id' => $product_id], 'cart_num');
$orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'pid' => 0], 'cart_num');
$orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'pid' => 0], 'refund_num');
$orderPayNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'cart_num');
$orderRefundNum = $orderCartServices->sum(['uid' => $uid, 'product_id' => $product_id, 'split_status' => 0], 'refund_num');
$orderNum = $orderPayNum - $orderRefundNum;
if (($num + $orderNum + $cartNum) > $limitInfo['limit_num']) {
throw new ApiException(410240, ['limit' => $limitInfo['limit_num'], 'pay_num' => $orderNum]);

View File

@ -160,6 +160,7 @@ class StoreOrderSplitServices extends BaseServices
'cart_info' => json_encode($_info),
];
}
$storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['surplus_num' => 0, 'split_status' => 2]);
}
if ($orderInfo['pid'] > 0 && $key == 'other') {