|
|
@@ -37,12 +37,12 @@ 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($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{
|
|
|
$areaArr = ProductArea::where('product_id', $productId)->where('status', ProductArea::NORMAL)->orderRaw('RAND()')->limit($num)->column('id');
|
|
|
- ProductOrder::setPopularAreaOrder($areaArr, $result->id, $result->price, $result->product_id, $uid, ProductOrder::Popular);
|
|
|
+ ProductOrder::setPopularAreaOrder($areaArr, $result->id, $result->price, $result->product_id, $uid, ProductOrder::Newbie);
|
|
|
}
|
|
|
return ['start_time'=>$tim, 'name'=>$result->name, 'num'=>$num];
|
|
|
}
|