优惠券订单及其他脚本

TbkDgMaterialOptionalRequest.php 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.dg.material.optional request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2019.01.18
  7. */
  8. class TbkDgMaterialOptionalRequest
  9. {
  10. /**
  11. * mm_xxx_xxx_xxx的第三位
  12. **/
  13. private $adzoneId;
  14. /**
  15. * 后台类目ID,用,分割,最大10个,该ID可以通过taobao.itemcats.get接口获取到
  16. **/
  17. private $cat;
  18. /**
  19. * 设备号加密类型:MD5
  20. **/
  21. private $deviceEncrypt;
  22. /**
  23. * 设备号类型:IMEI,或者IDFA,或者UTDID
  24. **/
  25. private $deviceType;
  26. /**
  27. * 设备号加密后的值
  28. **/
  29. private $deviceValue;
  30. /**
  31. * KA媒体淘客佣金比率上限,如:1234表示12.34%
  32. **/
  33. private $endKaTkRate;
  34. /**
  35. * 折扣价范围上限,单位:元
  36. **/
  37. private $endPrice;
  38. /**
  39. * 淘客佣金比率上限,如:1234表示12.34%
  40. **/
  41. private $endTkRate;
  42. /**
  43. * 是否有优惠券,设置为true表示该商品有优惠券,设置为false或不设置表示不判断这个属性
  44. **/
  45. private $hasCoupon;
  46. /**
  47. * 好评率是否高于行业均值
  48. **/
  49. private $includeGoodRate;
  50. /**
  51. * 成交转化是否高于行业均值
  52. **/
  53. private $includePayRate30;
  54. /**
  55. * 退款率是否低于行业均值
  56. **/
  57. private $includeRfdRate;
  58. /**
  59. * ip参数影响邮费获取,如果不传或者传入不准确,邮费无法精准提供
  60. **/
  61. private $ip;
  62. /**
  63. * 是否海外商品,设置为true表示该商品是属于海外商品,设置为false或不设置表示不判断这个属性
  64. **/
  65. private $isOverseas;
  66. /**
  67. * 是否商城商品,设置为true表示该商品是属于淘宝商城商品,设置为false或不设置表示不判断这个属性
  68. **/
  69. private $isTmall;
  70. /**
  71. * 所在地
  72. **/
  73. private $itemloc;
  74. /**
  75. * 官方的物料Id(详细物料id见:https://tbk.bbs.taobao.com/detail.html?appId=45301&postId=8576096),不传时默认为2836
  76. **/
  77. private $materialId;
  78. /**
  79. * 是否包邮,true表示包邮,空或false表示不限
  80. **/
  81. private $needFreeShipment;
  82. /**
  83. * 是否加入消费者保障,true表示加入,空或false表示不限
  84. **/
  85. private $needPrepay;
  86. /**
  87. * 牛皮癣程度,取值:1:不限,2:无,3:轻微
  88. **/
  89. private $npxLevel;
  90. /**
  91. * 第几页,默认:1
  92. **/
  93. private $pageNo;
  94. /**
  95. * 页大小,默认20,1~100
  96. **/
  97. private $pageSize;
  98. /**
  99. * 链接形式:1:PC,2:无线,默认:1
  100. **/
  101. private $platform;
  102. /**
  103. * 查询词
  104. **/
  105. private $q;
  106. /**
  107. * 排序_des(降序),排序_asc(升序),销量(total_sales),淘客佣金比率(tk_rate), 累计推广量(tk_total_sales),总支出佣金(tk_total_commi),价格(price)
  108. **/
  109. private $sort;
  110. /**
  111. * 店铺dsr评分,筛选高于等于当前设置的店铺dsr评分的商品0-50000之间
  112. **/
  113. private $startDsr;
  114. /**
  115. * KA媒体淘客佣金比率下限,如:1234表示12.34%
  116. **/
  117. private $startKaTkRate;
  118. /**
  119. * 折扣价范围下限,单位:元
  120. **/
  121. private $startPrice;
  122. /**
  123. * 淘客佣金比率下限,如:1234表示12.34%
  124. **/
  125. private $startTkRate;
  126. private $apiParas = array();
  127. public function setAdzoneId($adzoneId)
  128. {
  129. $this->adzoneId = $adzoneId;
  130. $this->apiParas["adzone_id"] = $adzoneId;
  131. }
  132. public function getAdzoneId()
  133. {
  134. return $this->adzoneId;
  135. }
  136. public function setCat($cat)
  137. {
  138. $this->cat = $cat;
  139. $this->apiParas["cat"] = $cat;
  140. }
  141. public function getCat()
  142. {
  143. return $this->cat;
  144. }
  145. public function setDeviceEncrypt($deviceEncrypt)
  146. {
  147. $this->deviceEncrypt = $deviceEncrypt;
  148. $this->apiParas["device_encrypt"] = $deviceEncrypt;
  149. }
  150. public function getDeviceEncrypt()
  151. {
  152. return $this->deviceEncrypt;
  153. }
  154. public function setDeviceType($deviceType)
  155. {
  156. $this->deviceType = $deviceType;
  157. $this->apiParas["device_type"] = $deviceType;
  158. }
  159. public function getDeviceType()
  160. {
  161. return $this->deviceType;
  162. }
  163. public function setDeviceValue($deviceValue)
  164. {
  165. $this->deviceValue = $deviceValue;
  166. $this->apiParas["device_value"] = $deviceValue;
  167. }
  168. public function getDeviceValue()
  169. {
  170. return $this->deviceValue;
  171. }
  172. public function setEndKaTkRate($endKaTkRate)
  173. {
  174. $this->endKaTkRate = $endKaTkRate;
  175. $this->apiParas["end_ka_tk_rate"] = $endKaTkRate;
  176. }
  177. public function getEndKaTkRate()
  178. {
  179. return $this->endKaTkRate;
  180. }
  181. public function setEndPrice($endPrice)
  182. {
  183. $this->endPrice = $endPrice;
  184. $this->apiParas["end_price"] = $endPrice;
  185. }
  186. public function getEndPrice()
  187. {
  188. return $this->endPrice;
  189. }
  190. public function setEndTkRate($endTkRate)
  191. {
  192. $this->endTkRate = $endTkRate;
  193. $this->apiParas["end_tk_rate"] = $endTkRate;
  194. }
  195. public function getEndTkRate()
  196. {
  197. return $this->endTkRate;
  198. }
  199. public function setHasCoupon($hasCoupon)
  200. {
  201. $this->hasCoupon = $hasCoupon;
  202. $this->apiParas["has_coupon"] = $hasCoupon;
  203. }
  204. public function getHasCoupon()
  205. {
  206. return $this->hasCoupon;
  207. }
  208. public function setIncludeGoodRate($includeGoodRate)
  209. {
  210. $this->includeGoodRate = $includeGoodRate;
  211. $this->apiParas["include_good_rate"] = $includeGoodRate;
  212. }
  213. public function getIncludeGoodRate()
  214. {
  215. return $this->includeGoodRate;
  216. }
  217. public function setIncludePayRate30($includePayRate30)
  218. {
  219. $this->includePayRate30 = $includePayRate30;
  220. $this->apiParas["include_pay_rate_30"] = $includePayRate30;
  221. }
  222. public function getIncludePayRate30()
  223. {
  224. return $this->includePayRate30;
  225. }
  226. public function setIncludeRfdRate($includeRfdRate)
  227. {
  228. $this->includeRfdRate = $includeRfdRate;
  229. $this->apiParas["include_rfd_rate"] = $includeRfdRate;
  230. }
  231. public function getIncludeRfdRate()
  232. {
  233. return $this->includeRfdRate;
  234. }
  235. public function setIp($ip)
  236. {
  237. $this->ip = $ip;
  238. $this->apiParas["ip"] = $ip;
  239. }
  240. public function getIp()
  241. {
  242. return $this->ip;
  243. }
  244. public function setIsOverseas($isOverseas)
  245. {
  246. $this->isOverseas = $isOverseas;
  247. $this->apiParas["is_overseas"] = $isOverseas;
  248. }
  249. public function getIsOverseas()
  250. {
  251. return $this->isOverseas;
  252. }
  253. public function setIsTmall($isTmall)
  254. {
  255. $this->isTmall = $isTmall;
  256. $this->apiParas["is_tmall"] = $isTmall;
  257. }
  258. public function getIsTmall()
  259. {
  260. return $this->isTmall;
  261. }
  262. public function setItemloc($itemloc)
  263. {
  264. $this->itemloc = $itemloc;
  265. $this->apiParas["itemloc"] = $itemloc;
  266. }
  267. public function getItemloc()
  268. {
  269. return $this->itemloc;
  270. }
  271. public function setMaterialId($materialId)
  272. {
  273. $this->materialId = $materialId;
  274. $this->apiParas["material_id"] = $materialId;
  275. }
  276. public function getMaterialId()
  277. {
  278. return $this->materialId;
  279. }
  280. public function setNeedFreeShipment($needFreeShipment)
  281. {
  282. $this->needFreeShipment = $needFreeShipment;
  283. $this->apiParas["need_free_shipment"] = $needFreeShipment;
  284. }
  285. public function getNeedFreeShipment()
  286. {
  287. return $this->needFreeShipment;
  288. }
  289. public function setNeedPrepay($needPrepay)
  290. {
  291. $this->needPrepay = $needPrepay;
  292. $this->apiParas["need_prepay"] = $needPrepay;
  293. }
  294. public function getNeedPrepay()
  295. {
  296. return $this->needPrepay;
  297. }
  298. public function setNpxLevel($npxLevel)
  299. {
  300. $this->npxLevel = $npxLevel;
  301. $this->apiParas["npx_level"] = $npxLevel;
  302. }
  303. public function getNpxLevel()
  304. {
  305. return $this->npxLevel;
  306. }
  307. public function setPageNo($pageNo)
  308. {
  309. $this->pageNo = $pageNo;
  310. $this->apiParas["page_no"] = $pageNo;
  311. }
  312. public function getPageNo()
  313. {
  314. return $this->pageNo;
  315. }
  316. public function setPageSize($pageSize)
  317. {
  318. $this->pageSize = $pageSize;
  319. $this->apiParas["page_size"] = $pageSize;
  320. }
  321. public function getPageSize()
  322. {
  323. return $this->pageSize;
  324. }
  325. public function setPlatform($platform)
  326. {
  327. $this->platform = $platform;
  328. $this->apiParas["platform"] = $platform;
  329. }
  330. public function getPlatform()
  331. {
  332. return $this->platform;
  333. }
  334. public function setQ($q)
  335. {
  336. $this->q = $q;
  337. $this->apiParas["q"] = $q;
  338. }
  339. public function getQ()
  340. {
  341. return $this->q;
  342. }
  343. public function setSort($sort)
  344. {
  345. $this->sort = $sort;
  346. $this->apiParas["sort"] = $sort;
  347. }
  348. public function getSort()
  349. {
  350. return $this->sort;
  351. }
  352. public function setStartDsr($startDsr)
  353. {
  354. $this->startDsr = $startDsr;
  355. $this->apiParas["start_dsr"] = $startDsr;
  356. }
  357. public function getStartDsr()
  358. {
  359. return $this->startDsr;
  360. }
  361. public function setStartKaTkRate($startKaTkRate)
  362. {
  363. $this->startKaTkRate = $startKaTkRate;
  364. $this->apiParas["start_ka_tk_rate"] = $startKaTkRate;
  365. }
  366. public function getStartKaTkRate()
  367. {
  368. return $this->startKaTkRate;
  369. }
  370. public function setStartPrice($startPrice)
  371. {
  372. $this->startPrice = $startPrice;
  373. $this->apiParas["start_price"] = $startPrice;
  374. }
  375. public function getStartPrice()
  376. {
  377. return $this->startPrice;
  378. }
  379. public function setStartTkRate($startTkRate)
  380. {
  381. $this->startTkRate = $startTkRate;
  382. $this->apiParas["start_tk_rate"] = $startTkRate;
  383. }
  384. public function getStartTkRate()
  385. {
  386. return $this->startTkRate;
  387. }
  388. public function getApiMethodName()
  389. {
  390. return "taobao.tbk.dg.material.optional";
  391. }
  392. public function getApiParas()
  393. {
  394. return $this->apiParas;
  395. }
  396. public function check()
  397. {
  398. RequestCheckUtil::checkNotNull($this->adzoneId,"adzoneId");
  399. RequestCheckUtil::checkMaxValue($this->startDsr,50000,"startDsr");
  400. }
  401. public function putOtherTextParam($key, $value) {
  402. $this->apiParas[$key] = $value;
  403. $this->$key = $value;
  404. }
  405. }