|
|
@@ -317,6 +317,13 @@ class StoreOrder extends BaseModel
|
|
|
$totalNum = 0;
|
|
|
$gainIntegral = 0;
|
|
|
foreach ($cartInfo as $cart) {
|
|
|
+ $product = StoreProduct::where('id', $cart['productInfo']['id'])->find();
|
|
|
+ if ($product['cate_id'] == 2){
|
|
|
+ if ($cart['cart_num'] > 1) return self::setErrorInfo('限购一个', true);
|
|
|
+ $orderId = StoreOrder::where('uid', $uid)->where('status', '>', 0)->column('id');
|
|
|
+ $orderCart = StoreOrderCartInfo::where([['oid', 'in', $orderId], ['product_id', '=', $product['id']]])->find();
|
|
|
+ if ($orderCart) return self::setErrorInfo('该礼包只能购买一次', true);
|
|
|
+ }
|
|
|
$cartIds[] = $cart['id'];
|
|
|
$totalNum += $cart['cart_num'];
|
|
|
if (!$seckill_id) $seckill_id = $cart['seckill_id'];
|
|
|
@@ -852,7 +859,7 @@ class StoreOrder extends BaseModel
|
|
|
$order->save();
|
|
|
if ($user['spread_uid']) self::superior_push($user['spread_uid']);
|
|
|
if ($user['level'] < 2) $user['level'] = 2;
|
|
|
- }else if ($product['id'] == 2){
|
|
|
+ }else if ($product['price'] == 399 and $product['cate_id'] == 2){
|
|
|
if ($user['spread_uid']) self::superior($user['spread_uid']);
|
|
|
if ($user['level'] < 1) $user['level'] = 1;
|
|
|
}
|