|
|
@@ -37,7 +37,7 @@ class WelfareLoginc
|
|
|
->join('product_list b', "a.product_id = b.id", "left")
|
|
|
->field('a.*,b.is_area,'.$lan.'_name as name')
|
|
|
->where('a.product_id', $productId)->find();
|
|
|
- if($num > $result->stock) throw new Exception(__('库存不足'));
|
|
|
+ if(!$result || $num > $result->stock) throw new Exception(__('库存不足'));
|
|
|
if(empty($result->is_area)){
|
|
|
ProductOrder::setPopularNoAreaOrder($num, $result->id, $result->price, $result->product_id, $uid, ProductOrder::Newbie);
|
|
|
}else{
|