|
|
@@ -53,28 +53,28 @@ class ProductOrder extends Model
|
|
|
|
|
|
|
|
|
//抢购下单:未选择地区购买
|
|
|
- public static function setPopularNoAreaOrder($num, $order_id, $price, $product_id, $uid):bool
|
|
|
+ public static function setPopularNoAreaOrder($num, $orderId, $price, $productId, $uid, $typeId):bool
|
|
|
{
|
|
|
for ($i = 0; $i < $num; $i++) {
|
|
|
$order_arr['price'] = $price;
|
|
|
- $order_arr['product_id']= $product_id;
|
|
|
+ $order_arr['product_id']= $productId;
|
|
|
$order_arr['area_id'] = 0;
|
|
|
- self::setCreateOrder($order_id, $order_arr, self::Popular, $uid, 0, getOrderSN('R'), 0, $price);
|
|
|
+ self::setCreateOrder($orderId, $order_arr, $typeId, $uid, 0, getOrderSN('R'), 0, $price);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
|
|
//抢购下单:选择地区购买
|
|
|
- public static function setPopularAreaOrder($areaArr, $order_id, $price, $product_id, $uid):bool
|
|
|
+ public static function setPopularAreaOrder($areaArr, $orderId, $price, $productId, $uid, $typeId):bool
|
|
|
{
|
|
|
$result = true;
|
|
|
foreach ($areaArr as $item) {
|
|
|
// 生成订单
|
|
|
$order_arr['price'] = $price;
|
|
|
- $order_arr['product_id']= $product_id;
|
|
|
+ $order_arr['product_id']= $productId;
|
|
|
$order_arr['area_id'] = $item;
|
|
|
- self::setCreateOrder($order_id, $order_arr, self::Popular, $uid, 0, getOrderSN('R'), 0, $price);
|
|
|
+ self::setCreateOrder($orderId, $order_arr, $typeId, $uid, 0, getOrderSN('R'), 0, $price);
|
|
|
}
|
|
|
//修改区域状态
|
|
|
$count = ProductArea::whereIn('id', $areaArr)->setField('status', ProductLists::STOP);
|