|
|
@@ -35,7 +35,7 @@ class WelfareLoginc
|
|
|
public static function setUserWelfareLos($uid, int $productId, $num, $tim, $lan, $typeId)
|
|
|
{
|
|
|
$result = ProductPopular::getPopularByTime($productId, $lan, $tim);
|
|
|
- if(!$result || $num > $result->stock) throw new Exception(__('库存不足'));
|
|
|
+ if(!$result || $num > ($result->init_num + $result->num)) throw new Exception(__('库存不足'));
|
|
|
|
|
|
//添加产品
|
|
|
self::setUserProductOrder($num, $result->is_area, $result->id, $result->price, $productId, $uid, $typeId);
|