提交 bd826f48 编写于 作者: 李光春's avatar 李光春

- 小范围测试淘宝官方SDK

上级 25ce72a9
## v6.0.124 / 2020-11-19
- 小范围测试淘宝官方SDK
## v6.0.123 / 2020-11-19 ## v6.0.123 / 2020-11-19
- 测试淘宝官方SDK - 测试淘宝官方SDK
......
...@@ -25,7 +25,7 @@ use DtApp\ThinkLibrary\service\SystemService; ...@@ -25,7 +25,7 @@ use DtApp\ThinkLibrary\service\SystemService;
/** /**
* 定义当前版本 * 定义当前版本
*/ */
const VERSION = '6.0.123'; const VERSION = '6.0.124';
if (!function_exists('get_ip_info')) { if (!function_exists('get_ip_info')) {
/** /**
......
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
namespace DtApp\ThinkLibrary\service\taobao; namespace DtApp\ThinkLibrary\service\taobao;
require_once __DIR__ . '/bin/TopSdk.php';
use DtApp\ThinkLibrary\Service; use DtApp\ThinkLibrary\Service;
use TbkScInvitecodeGetRequest; use TbkScInvitecodeGetRequest;
use TbkScPublisherInfoGetRequest;
use TbkScPublisherInfoSaveRequest;
use TopClient; use TopClient;
/** /**
...@@ -64,7 +68,90 @@ class TaoBaoService extends Service ...@@ -64,7 +68,90 @@ class TaoBaoService extends Service
return $this; return $this;
} }
public function scInvitecodeGet($sessionKey): self /**
* ( 淘宝客-公用-私域用户备案 )
* 通过入参渠道管理或会员运营管理的邀请码,生成渠道id或会员运营id,完成渠道或会员的备案。
* https://open.taobao.com/api.htm?docId=37988&docType=2&scopeId=14474
* @param $sessionKey
* @return $this
*/
public function tbkScPublisherInfoSave($sessionKey): self
{
$c = new TopClient();
$c->appkey = $this->app_key;
$c->secretKey = $this->app_secret;
$req = new TbkScPublisherInfoSaveRequest();
if (isset($this->param['relation_from'])) {
$req->setRelationFrom($this->param['relation_from']);
}
if (isset($this->param['offline_scene'])) {
$req->setOfflineScene($this->param['offline_scene']);
}
if (isset($this->param['online_scene'])) {
$req->setOnlineScene($this->param['online_scene']);
}
if (isset($this->param['inviter_code'])) {
$req->setInviterCode($this->param['inviter_code']);
}
if (isset($this->param['info_type'])) {
$req->setInfoType($this->param['info_type']);
}
if (isset($this->param['note'])) {
$req->setNote($this->param['note']);
}
if (isset($this->param['register_info'])) {
$req->setRegisterInfo($this->param['register_info']);
}
$this->output = $c->execute($req, $sessionKey);
return $this;
}
/**
* ( 淘宝客-公用-私域用户备案信息查询 )
* 查询已生成的渠道id或会员运营id的相关信息。
* https://open.taobao.com/api.htm?docId=37989&docType=2&scopeId=14474
* @param $sessionKey
* @return $this
*/
public function tbkScPublisherInfoGet($sessionKey): self
{
$c = new TopClient();
$c->appkey = $this->app_key;
$c->secretKey = $this->app_secret;
$req = new TbkScPublisherInfoGetRequest();
if (isset($this->param['info_type'])) {
$req->setInfoType($this->param['info_type']);
}
if (isset($this->param['relation_id'])) {
$req->setRelationId($this->param['relation_id']);
}
if (isset($this->param['page_no'])) {
$req->setPageNo($this->param['page_no']);
}
if (isset($this->param['page_size'])) {
$req->setPageSize($this->param['page_size']);
}
if (isset($this->param['relation_app'])) {
$req->setRelationApp($this->param['relation_app']);
}
if (isset($this->param['special_id'])) {
$req->setSpecialId($this->param['special_id']);
}
if (isset($this->param['external_id'])) {
$req->setExternalId($this->param['external_id']);
}
$this->output = $c->execute($req, $sessionKey);
return $this;
}
/**
* ( 淘宝客-公用-私域用户邀请码生成 )
* 私域用户管理(即渠道管理或会员运营管理)功能中,通过此API可生成淘宝客自身的邀请码。
* https://open.taobao.com/api.htm?docId=38046&docType=2&scopeId=14474
* @param $sessionKey
* @return $this
*/
public function tbkScInvitecodeGet($sessionKey): self
{ {
$c = new TopClient(); $c = new TopClient();
$c->appkey = $this->app_key; $c->appkey = $this->app_key;
...@@ -79,7 +166,7 @@ class TaoBaoService extends Service ...@@ -79,7 +166,7 @@ class TaoBaoService extends Service
if (isset($this->param['code_type'])) { if (isset($this->param['code_type'])) {
$req->setCodeType($this->param['code_type']); $req->setCodeType($this->param['code_type']);
} }
$resp = $c->execute($req, $sessionKey); $this->output = $c->execute($req, $sessionKey);
return $this; return $this;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册