$adzone_id, "activity_material_id"=>$activity_material_id ]; $res = $app->content->getActivityInfo($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["sub_msg"]); } return $res["data"]; } /** * 获取私域用户邀请码 * @param $codeType int 邀请码类型,1 - 渠道邀请,2 - 渠道裂变,3 -会员邀请 * @param int $relationId 渠道关系ID */ public static function getInviteCode($codeType, $relationId = 0) { $app = self::getApp(); $params = [ "relation_app"=>"common", "code_type"=>$codeType ]; if($relationId){ $params["relation_id"] = $relationId; } $res = $app->sc->getInviteCode($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["msg"]); } return $res["data"]; } /** * 渠道备案 * @param $inviteCode string 邀请码 * @param $infoType int 类型,必选 默认为1: */ public static function savePublisherInfo($inviteCode, $infoType) { $app = self::getApp(); $params = [ "inviter_code"=>$inviteCode, "info_type"=>$infoType ]; $res = $app->sc->savePublisherInfo($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["sub_msg"]); } return $res["data"]; } /** * 获取备案信息 * @param $infoType int 类型,必选 1:渠道信息;2:会员信息 * @param $id string 渠道或者会员ID * @param string $relationApp 默认common */ public static function getPublisherInfo($infoType,$id,$relationApp="common") { $app = self::getApp(); $params = [ "info_type"=>$infoType, "relation_app"=>$relationApp ]; switch ($infoType){ case 1: $params["relation_id"] = $id; break; case 2: $params["special_id"] = $id; break; } $res = $app->sc->getPublisherInfo($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["sub_msg"]); } return $res["data"]; } /** * 获取拉新用户订单 * @param $activityId string 活动ID * @param int $page int 第几页 */ public static function getNewOrder($activityId, $page = 1) { $app = self::getApp(); $params = [ "page_no"=>$page, "activity_id"=>$activityId ]; $res = $app->dg->getOrderNewUser($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["sub_msg"]); } return $res["results"]; } /** * 获取淘口令接口 * @param $url string 地址 */ public static function taokoulingCreate($url) { $app = self::getApp(); $params = [ "url"=>$url ]; $res = $app->tpwd->create($params); $res = json_decode(json_encode($res),true); if(isset($res["code"])){ throw new TaobaoException($res["sub_msg"]); } return $res["data"]; } }