|
@@ -119,23 +119,23 @@ class DouYinService
|
|
|
|
|
|
|
|
public static function getProductParams($params)
|
|
public static function getProductParams($params)
|
|
|
{
|
|
{
|
|
|
- $goodsCategory = GoodsCategory::where('id',$params['goods_category_id']??0)->findOrEmpty();
|
|
|
|
|
- if($goodsCategory->isEmpty()){
|
|
|
|
|
|
|
+ $goods = Goods::where('id',$params['goods_id']??0)->findOrEmpty();
|
|
|
|
|
+ if($goods->isEmpty()){
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
- $goodsCategory = $goodsCategory->toArray();
|
|
|
|
|
|
|
+ $goods = $goods->toArray();
|
|
|
return [
|
|
return [
|
|
|
"account_id" => '7511543640776017961',
|
|
"account_id" => '7511543640776017961',
|
|
|
"product" => [
|
|
"product" => [
|
|
|
"out_id" => $params['goods_id']??0,
|
|
"out_id" => $params['goods_id']??0,
|
|
|
- "product_name" => $params['goods_name']??'无',
|
|
|
|
|
|
|
+ "product_name" => $goods['goods_name']??'无',
|
|
|
"product_type" => 22,
|
|
"product_type" => 22,
|
|
|
"category_id" => 6004003,
|
|
"category_id" => 6004003,
|
|
|
"category_full_name" => "其他维修服务",
|
|
"category_full_name" => "其他维修服务",
|
|
|
"biz_line" => 5,
|
|
"biz_line" => 5,
|
|
|
"account_name" => "亿蜂快修·武汉市",
|
|
"account_name" => "亿蜂快修·武汉市",
|
|
|
//{\"params\":\"{\"spuId\":\"xxxxx\",\"skuId\":\"xxxxxx\"}\",\"path\":\"pages/any/path\",\"app_id\":\"xxxxx\"}
|
|
//{\"params\":\"{\"spuId\":\"xxxxx\",\"skuId\":\"xxxxxx\"}\",\"path\":\"pages/any/path\",\"app_id\":\"xxxxx\"}
|
|
|
- "out_url" => json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_category_id'=>$params['goods_category_id']??0])]),
|
|
|
|
|
|
|
+ "out_url" => json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_id'=>$params['goods_id']??0])]),
|
|
|
"pois" =>[
|
|
"pois" =>[
|
|
|
[
|
|
[
|
|
|
"poi_id" => "7511543640776017961"
|
|
"poi_id" => "7511543640776017961"
|
|
@@ -144,9 +144,9 @@ class DouYinService
|
|
|
"product_ext" => [
|
|
"product_ext" => [
|
|
|
"auto_online" => true,
|
|
"auto_online" => true,
|
|
|
"display_price"=> ["low_price" => 30,"high_price" => 300],
|
|
"display_price"=> ["low_price" => 30,"high_price" => 300],
|
|
|
- "test_extra"=> ["test_flag" => true,"uids" => ["1548********2888"]]
|
|
|
|
|
|
|
+ "test_extra"=> ["test_flag" => true,"uids" => ["15482888"]]
|
|
|
],
|
|
],
|
|
|
- "attr_key_value_map" => self::getAttrKeyValueMapParams('product',$goodsCategory),
|
|
|
|
|
|
|
+ "attr_key_value_map" => self::getAttrKeyValueMapParams('product',$goods),
|
|
|
"sold_end_time" => time() + 180 * 86400,
|
|
"sold_end_time" => time() + 180 * 86400,
|
|
|
"sold_start_time" => time()
|
|
"sold_start_time" => time()
|
|
|
]
|
|
]
|
|
@@ -196,14 +196,14 @@ class DouYinService
|
|
|
"auto_renew"=>true,
|
|
"auto_renew"=>true,
|
|
|
"can_no_use_date" => json_encode(["enable"=>false]),
|
|
"can_no_use_date" => json_encode(["enable"=>false]),
|
|
|
"Description" => json_encode([]),
|
|
"Description" => json_encode([]),
|
|
|
- "image_list" => json_encode([["url"=>$params['picture']??'']]),
|
|
|
|
|
|
|
+ "image_list" => json_encode([["url"=>$params['goods_image']??'']]),
|
|
|
"limit_use_rule" => json_encode(["is_limit_use"=>true, "use_num_per_consume"=>1]),
|
|
"limit_use_rule" => json_encode(["is_limit_use"=>true, "use_num_per_consume"=>1]),
|
|
|
- "Notification" => json_encode([["title"=>$params['name']??'',"content"=>$params['name']??'']]),
|
|
|
|
|
|
|
+ "Notification" => json_encode([["title"=>$params['goods_name']??'',"content"=>$params['goods_name']??'']]),
|
|
|
"RefundPolicy"=> "2",
|
|
"RefundPolicy"=> "2",
|
|
|
"refund_need_merchant_confirm"=> true,
|
|
"refund_need_merchant_confirm"=> true,
|
|
|
"show_channel"=> 1,
|
|
"show_channel"=> 1,
|
|
|
"superimposed_discounts"=> false,
|
|
"superimposed_discounts"=> false,
|
|
|
- "trade_url"=> json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_category_id'=>$params['id']??0])]),
|
|
|
|
|
|
|
+ "trade_url"=> json_encode(['app_id'=>config('douyin.appId'),'path'=>'pages/detail','params'=>json_encode(['goods_id'=>$params['id']??0])]),
|
|
|
"use_date"=> json_encode(["use_date_type"=>2, "day_duration"=>15]),
|
|
"use_date"=> json_encode(["use_date_type"=>2, "day_duration"=>15]),
|
|
|
"use_time"=> json_encode(["use_time_type"=>1]),
|
|
"use_time"=> json_encode(["use_time_type"=>1]),
|
|
|
//"user_num_limit"=> ,
|
|
//"user_num_limit"=> ,
|