|
|
@@ -60,13 +60,29 @@ class ProductOrder extends Model
|
|
|
//抢购下单:未选择地区购买
|
|
|
public static function setPopularNoAreaOrder($num, $orderId, $price, $productId, $uid, $typeId):bool
|
|
|
{
|
|
|
+ $data = [];
|
|
|
+ //抢购订单
|
|
|
+ $time = time();
|
|
|
+ $is_popular = ($typeId == self::Popular)? self::Paid : 0;
|
|
|
for ($i = 0; $i < $num; $i++) {
|
|
|
- $order_arr['price'] = $price;
|
|
|
- $order_arr['product_id']= $productId;
|
|
|
- $order_arr['area_id'] = 0;
|
|
|
- self::setCreateOrder($orderId, $order_arr, $typeId, $uid, 0, getOrderSN('R'.$i), 0, $price);
|
|
|
+ $data[] = [
|
|
|
+ 'order_id' => $orderId,
|
|
|
+ 'product_id' => $productId,
|
|
|
+ 'type_id' => $typeId,
|
|
|
+ 'status' => self::Paid,
|
|
|
+ 'area_id' => 0,
|
|
|
+ 'price' => $price,
|
|
|
+ 'popular_price' => $price,
|
|
|
+ 'fees' => 0,
|
|
|
+ 'num' => 1,
|
|
|
+ 'user_id' => $uid,
|
|
|
+ 'order_no' => getOrderSN('R'.$i),
|
|
|
+ 'is_popular' => $is_popular,
|
|
|
+ 'create_time' => $time,
|
|
|
+ 'update_time' => $time
|
|
|
+ ];
|
|
|
}
|
|
|
- return true;
|
|
|
+ return self::insertAll($data);
|
|
|
}
|
|
|
|
|
|
|