|
@@ -383,13 +383,13 @@ S;
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- //2.判断是否匹配上淘宝链接
|
|
|
|
- $res = preg_match("/https\:\/\/m\.tb\.cn/",$message["Content"],$match);
|
|
|
|
|
|
|
|
|
|
+ //3.判断是否匹配到维品会链接
|
|
|
|
+ $res = preg_match("/https\:\/\/m\.vip\.com/",$message["Content"],$match);
|
|
if($res){
|
|
if($res){
|
|
- $instance->info("匹配到淘宝链接");
|
|
|
|
|
|
+ $instance->info("匹配到维品会链接");
|
|
$goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
$goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
- $tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid);
|
|
|
|
|
|
+ $tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid,$goodsInfo["source"]);
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
$goodsPrice = $tuiguangRes["marketPrice"];
|
|
$goodsPrice = $tuiguangRes["marketPrice"];
|
|
$couponPrice = $tuiguangRes["couponInfo"]["fav"];
|
|
$couponPrice = $tuiguangRes["couponInfo"]["fav"];
|
|
@@ -403,8 +403,7 @@ S;
|
|
【券后价】:$afterCouponPrice 元
|
|
【券后价】:$afterCouponPrice 元
|
|
【返现金额】:$rebeatPrice 元
|
|
【返现金额】:$rebeatPrice 元
|
|
-------------------------
|
|
-------------------------
|
|
-复制这条信息:$url
|
|
|
|
-打开【手机淘宝】即可查看
|
|
|
|
|
|
+点击链接购买:$url
|
|
具体返现金额,以实际支付金额为准
|
|
具体返现金额,以实际支付金额为准
|
|
-------------------------
|
|
-------------------------
|
|
进入公众号=>我的=>钱包,可以1:1提现哦
|
|
进入公众号=>我的=>钱包,可以1:1提现哦
|
|
@@ -413,10 +412,10 @@ S;
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- //3.判断是否匹配到维品会链接
|
|
|
|
- $res = preg_match("/https\:\/\/m\.vip\.com/",$message["Content"],$match);
|
|
|
|
|
|
+ //3.判断是否匹配到京东链接
|
|
|
|
+ $res = preg_match("/https\:\/\/item\.m\.jd\.com/",$message["Content"],$match);
|
|
if($res){
|
|
if($res){
|
|
- $instance->info("匹配到维品会链接");
|
|
|
|
|
|
+ $instance->info("匹配到京东链接");
|
|
$goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
$goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
$tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid,$goodsInfo["source"]);
|
|
$tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid,$goodsInfo["source"]);
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
@@ -441,12 +440,42 @@ S;
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- //3.判断是否匹配到京东链接
|
|
|
|
- $res = preg_match("/https\:\/\/item\.m\.jd\.com/",$message["Content"],$match);
|
|
|
|
- if($res){
|
|
|
|
- $instance->info("匹配到京东链接");
|
|
|
|
- $goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
|
|
- $tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid,$goodsInfo["source"]);
|
|
|
|
|
|
+
|
|
|
|
+ //2.判断是否匹配上淘宝链接
|
|
|
|
+// $res = preg_match("/https\:\/\/m\.tb\.cn/",$message["Content"],$match);
|
|
|
|
+//
|
|
|
|
+// if($res){
|
|
|
|
+// $instance->info("匹配到淘宝链接");
|
|
|
|
+// $goodsInfo = JutuikeUtil::transferGoodsLink($message["Content"]);
|
|
|
|
+// $tuiguangRes = JutuikeUtil::convert($goodsInfo["goodsId"],$jutuikeSid);
|
|
|
|
+// $goodsTitle = $tuiguangRes["goodsName"];
|
|
|
|
+// $goodsPrice = $tuiguangRes["marketPrice"];
|
|
|
|
+// $couponPrice = $tuiguangRes["couponInfo"]["fav"];
|
|
|
|
+// $afterCouponPrice = $tuiguangRes["price"];
|
|
|
|
+// $rebeatPrice = round($tuiguangRes["commission"]*0.7,2);
|
|
|
|
+// $url = $tuiguangRes["url"];
|
|
|
|
+// $msg = <<<S
|
|
|
|
+//【 $goodsTitle 】
|
|
|
|
+//【原价】:$goodsPrice 元
|
|
|
|
+//【优惠券】:$couponPrice 元
|
|
|
|
+//【券后价】:$afterCouponPrice 元
|
|
|
|
+//【返现金额】:$rebeatPrice 元
|
|
|
|
+// -------------------------
|
|
|
|
+//复制这条信息:$url
|
|
|
|
+//打开【手机淘宝】即可查看
|
|
|
|
+//具体返现金额,以实际支付金额为准
|
|
|
|
+//-------------------------
|
|
|
|
+//进入公众号=>我的=>钱包,可以1:1提现哦
|
|
|
|
+//S;
|
|
|
|
+// $wenti = new Text($msg);
|
|
|
|
+// $app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
|
|
+// return;
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ //默认是认为淘宝链接
|
|
|
|
+ $instance->info("匹配到淘宝链接");
|
|
|
|
+ $goodsInfo = TaobaoLianMengUtil::taokoulingConvert($message["Content"]);
|
|
|
|
+ $tuiguangRes = JutuikeUtil::convert($goodsInfo["data"]["num_iid"],$jutuikeSid);
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
$goodsTitle = $tuiguangRes["goodsName"];
|
|
$goodsPrice = $tuiguangRes["marketPrice"];
|
|
$goodsPrice = $tuiguangRes["marketPrice"];
|
|
$couponPrice = $tuiguangRes["couponInfo"]["fav"];
|
|
$couponPrice = $tuiguangRes["couponInfo"]["fav"];
|
|
@@ -460,7 +489,8 @@ S;
|
|
【券后价】:$afterCouponPrice 元
|
|
【券后价】:$afterCouponPrice 元
|
|
【返现金额】:$rebeatPrice 元
|
|
【返现金额】:$rebeatPrice 元
|
|
-------------------------
|
|
-------------------------
|
|
-点击链接购买:$url
|
|
|
|
|
|
+复制这条信息:$url
|
|
|
|
+打开【手机淘宝】即可查看
|
|
具体返现金额,以实际支付金额为准
|
|
具体返现金额,以实际支付金额为准
|
|
-------------------------
|
|
-------------------------
|
|
进入公众号=>我的=>钱包,可以1:1提现哦
|
|
进入公众号=>我的=>钱包,可以1:1提现哦
|
|
@@ -468,7 +498,6 @@ S;
|
|
$wenti = new Text($msg);
|
|
$wenti = new Text($msg);
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
$app->customer_service->message($wenti)->to($officialOpenId)->send();
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
}catch (\Throwable $exception){
|
|
}catch (\Throwable $exception){
|
|
$instance->info("异常信息:".$exception->getMessage());
|
|
$instance->info("异常信息:".$exception->getMessage());
|
|
$wenti = new Text("请换个商品,该商品没有返利");
|
|
$wenti = new Text("请换个商品,该商品没有返利");
|