|
|
@ -64,6 +64,12 @@ class OrderService implements OrderServiceInterface |
|
|
*/ |
|
|
*/ |
|
|
protected $financialService; |
|
|
protected $financialService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Inject |
|
|
|
|
|
* @var AttachmentServiceInterface |
|
|
|
|
|
*/ |
|
|
|
|
|
protected $attachmentService; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @inheritDoc |
|
|
* @inheritDoc |
|
|
*/ |
|
|
*/ |
|
|
@ -302,7 +308,7 @@ class OrderService implements OrderServiceInterface |
|
|
} |
|
|
} |
|
|
//判断是否有购买多个特价商品
|
|
|
//判断是否有购买多个特价商品
|
|
|
$result = $this->purchaseLimitService->PurchaseLimit($orderGoods); |
|
|
$result = $this->purchaseLimitService->PurchaseLimit($orderGoods); |
|
|
if(!$result){ |
|
|
|
|
|
|
|
|
if($result > 0){ |
|
|
Db::rollBack(); |
|
|
Db::rollBack(); |
|
|
return '同一个订单不能购买多个特价商品'; |
|
|
return '同一个订单不能购买多个特价商品'; |
|
|
} |
|
|
} |
|
|
@ -972,22 +978,9 @@ class OrderService implements OrderServiceInterface |
|
|
$goods = OrderGoods::query()->whereIn('order_id', $orderChildIds)->select(['name', 'img'])->first(); |
|
|
$goods = OrderGoods::query()->whereIn('order_id', $orderChildIds)->select(['name', 'img'])->first(); |
|
|
$order['good_name'] = $goods->name; |
|
|
$order['good_name'] = $goods->name; |
|
|
// TODO 临时写死oss压缩类型
|
|
|
// TODO 临时写死oss压缩类型
|
|
|
$order['img'] = $this->switchImgToAliOss($goods->img); |
|
|
|
|
|
|
|
|
$order['img'] = $this->attachmentService->switchImgToAliOss($goods->img); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $orders; |
|
|
return $orders; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function switchImgToAliOss($path, $bucket = 'thumbnail_q50') |
|
|
|
|
|
{ |
|
|
|
|
|
if (strpos($path, 'http') === false || strpos($path, 'https') === false) { |
|
|
|
|
|
$path = 'https://img.lanzulive.com/' . $path; |
|
|
|
|
|
} else { |
|
|
|
|
|
$temp = explode('//', $path); |
|
|
|
|
|
$temp = explode('/', $temp[1]); |
|
|
|
|
|
unset($temp[0]); |
|
|
|
|
|
$path = 'https://img.lanzulive.com/' . implode('/', $temp); |
|
|
|
|
|
} |
|
|
|
|
|
return $path . '!' . $bucket; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |