|
|
@@ -521,6 +521,7 @@ class Su extends BaseController
|
|
521
|
521
|
// }
|
|
522
|
522
|
$pid = '';
|
|
523
|
523
|
$url = $this->request->params(['couponUrl']);
|
|
|
524
|
+ $is_mp = $this->request->param('is_mp',0);
|
|
524
|
525
|
$apiName = 'suning.netalliance.unioninfomation.get';
|
|
525
|
526
|
$name = "getUnionInfomation";
|
|
526
|
527
|
$request = ['goodsCode' => $id];
|
|
|
@@ -558,13 +559,18 @@ class Su extends BaseController
|
|
558
|
559
|
// Log::info($result);
|
|
559
|
560
|
$result['detail'] = $detail;
|
|
560
|
561
|
//商品和券二合一
|
|
561
|
|
- $result['url'] = $this->toOneUrl($uid, $result['productUrl'], $url['couponUrl'] ?? '');
|
|
|
562
|
+ if($is_mp == 1){
|
|
|
563
|
+ $result['url'] = $this->toMpOneUrl($uid, $result['productUrl'], $url['couponUrl'] ?? '');
|
|
|
564
|
+ }else{
|
|
|
565
|
+ $result['url'] = $this->toOneUrl($uid, $result['productUrl'], $url['couponUrl'] ?? '');
|
|
|
566
|
+ }
|
|
562
|
567
|
return app('json')->success('获取苏宁商品详情成功', $result);
|
|
563
|
568
|
}
|
|
564
|
569
|
|
|
565
|
570
|
//获取商品详情
|
|
566
|
571
|
public function h5GetDetail($goodsId, $userId = 0)
|
|
567
|
572
|
{
|
|
|
573
|
+ $is_mp = $this->request->param('is_mp',0);
|
|
568
|
574
|
$apiName = 'suning.netalliance.unioninfomation.get';
|
|
569
|
575
|
$name = "getUnionInfomation";
|
|
570
|
576
|
$request = ['goodsCode' => $goodsId];
|
|
|
@@ -576,7 +582,11 @@ class Su extends BaseController
|
|
576
|
582
|
$commission = $result['prePayCommission'] ?: 0;
|
|
577
|
583
|
$yanglao = $commission ? app()->make(ProductRepository::class)
|
|
578
|
584
|
->yanglaojin(0, $commission) : 0;
|
|
579
|
|
- $changUrl = $this->toOneUrl($userId, $result['productUrl'], $result['couponUrl'] ?? '');
|
|
|
585
|
+ if($is_mp == 1){
|
|
|
586
|
+ $changUrl = $this->toMpOneUrl($userId, $result['productUrl'], $result['couponUrl'] ?? '');
|
|
|
587
|
+ }else{
|
|
|
588
|
+ $changUrl = $this->toOneUrl($userId, $result['productUrl'], $result['couponUrl'] ?? '');
|
|
|
589
|
+ }
|
|
580
|
590
|
return ['code' => 1, 'yanglao' => $yanglao, 'url' => $changUrl];
|
|
581
|
591
|
}
|
|
582
|
592
|
|
|
|
@@ -616,6 +626,25 @@ class Su extends BaseController
|
|
616
|
626
|
return $result['sn_responseContent']['sn_body']['getExtensionlink']['shortLink'] ?? '';
|
|
617
|
627
|
}
|
|
618
|
628
|
|
|
|
629
|
+ /*
|
|
|
630
|
+ * 商品和券二合一转链接口(小程序)
|
|
|
631
|
+ $productUrl 商品url
|
|
|
632
|
+ $couponUrl 优惠券url
|
|
|
633
|
+ $pid 用户苏宁工具商pid
|
|
|
634
|
+ */
|
|
|
635
|
+ public function toMpOneUrl($userId, $productUrl, $couponUrl = '')
|
|
|
636
|
+ {
|
|
|
637
|
+ $apiName = 'suning.netalliance.appletextensionlink.get';
|
|
|
638
|
+ $name = "getAppletextensionlink";
|
|
|
639
|
+ $request = [
|
|
|
640
|
+ 'productUrl' => $productUrl,
|
|
|
641
|
+ 'subUser' => $userId,//子会员编号
|
|
|
642
|
+ ];
|
|
|
643
|
+ $couponUrl && $request['quanUrl'] = $couponUrl;
|
|
|
644
|
+ $result = $this->getUrlResult($apiName, $request, $name);
|
|
|
645
|
+ return $result['sn_responseContent']['sn_body']['getAppletextensionlink']['appletExtendUrl'] ?? '';
|
|
|
646
|
+ }
|
|
|
647
|
+
|
|
619
|
648
|
|
|
620
|
649
|
/*城市编码*/
|
|
621
|
650
|
public
|