Nenhuma Descrição

TbkItemGetRequest.php 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.item.get request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2016.07.25
  7. */
  8. class TbkItemGetRequest
  9. {
  10. /**
  11. * 后台类目ID,用,分割,最大10个,该ID可以通过taobao.itemcats.get接口获取到
  12. **/
  13. private $cat;
  14. /**
  15. * 折扣价范围上限,单位:元
  16. **/
  17. private $endPrice;
  18. /**
  19. * 淘客佣金比率下限,如:1234表示12.34%
  20. **/
  21. private $endTkRate;
  22. /**
  23. * 需返回的字段列表
  24. **/
  25. private $fields;
  26. /**
  27. * 是否海外商品,设置为true表示该商品是属于海外商品,设置为false或不设置表示不判断这个属性
  28. **/
  29. private $isOverseas;
  30. /**
  31. * 是否商城商品,设置为true表示该商品是属于淘宝商城商品,设置为false或不设置表示不判断这个属性
  32. **/
  33. private $isTmall;
  34. /**
  35. * 所在地
  36. **/
  37. private $itemloc;
  38. /**
  39. * 第几页,默认:1
  40. **/
  41. private $pageNo;
  42. /**
  43. * 页大小,默认20,1~100
  44. **/
  45. private $pageSize;
  46. /**
  47. * 链接形式:1:PC,2:无线,默认:1
  48. **/
  49. private $platform;
  50. /**
  51. * 查询词
  52. **/
  53. private $q;
  54. /**
  55. * 排序_des(降序),排序_asc(升序),销量(total_sales),淘客佣金比率(tk_rate), 累计推广量(tk_total_sales),总支出佣金(tk_total_commi)
  56. **/
  57. private $sort;
  58. /**
  59. * 折扣价范围下限,单位:元
  60. **/
  61. private $startPrice;
  62. /**
  63. * 淘客佣金比率上限,如:1234表示12.34%
  64. **/
  65. private $startTkRate;
  66. private $apiParas = array();
  67. public function setCat($cat)
  68. {
  69. $this->cat = $cat;
  70. $this->apiParas["cat"] = $cat;
  71. }
  72. public function getCat()
  73. {
  74. return $this->cat;
  75. }
  76. public function setEndPrice($endPrice)
  77. {
  78. $this->endPrice = $endPrice;
  79. $this->apiParas["end_price"] = $endPrice;
  80. }
  81. public function getEndPrice()
  82. {
  83. return $this->endPrice;
  84. }
  85. public function setEndTkRate($endTkRate)
  86. {
  87. $this->endTkRate = $endTkRate;
  88. $this->apiParas["end_tk_rate"] = $endTkRate;
  89. }
  90. public function getEndTkRate()
  91. {
  92. return $this->endTkRate;
  93. }
  94. public function setFields($fields)
  95. {
  96. $this->fields = $fields;
  97. $this->apiParas["fields"] = $fields;
  98. }
  99. public function getFields()
  100. {
  101. return $this->fields;
  102. }
  103. public function setIsOverseas($isOverseas)
  104. {
  105. $this->isOverseas = $isOverseas;
  106. $this->apiParas["is_overseas"] = $isOverseas;
  107. }
  108. public function getIsOverseas()
  109. {
  110. return $this->isOverseas;
  111. }
  112. public function setIsTmall($isTmall)
  113. {
  114. $this->isTmall = $isTmall;
  115. $this->apiParas["is_tmall"] = $isTmall;
  116. }
  117. public function getIsTmall()
  118. {
  119. return $this->isTmall;
  120. }
  121. public function setItemloc($itemloc)
  122. {
  123. $this->itemloc = $itemloc;
  124. $this->apiParas["itemloc"] = $itemloc;
  125. }
  126. public function getItemloc()
  127. {
  128. return $this->itemloc;
  129. }
  130. public function setPageNo($pageNo)
  131. {
  132. $this->pageNo = $pageNo;
  133. $this->apiParas["page_no"] = $pageNo;
  134. }
  135. public function getPageNo()
  136. {
  137. return $this->pageNo;
  138. }
  139. public function setPageSize($pageSize)
  140. {
  141. $this->pageSize = $pageSize;
  142. $this->apiParas["page_size"] = $pageSize;
  143. }
  144. public function getPageSize()
  145. {
  146. return $this->pageSize;
  147. }
  148. public function setPlatform($platform)
  149. {
  150. $this->platform = $platform;
  151. $this->apiParas["platform"] = $platform;
  152. }
  153. public function getPlatform()
  154. {
  155. return $this->platform;
  156. }
  157. public function setQ($q)
  158. {
  159. $this->q = $q;
  160. $this->apiParas["q"] = $q;
  161. }
  162. public function getQ()
  163. {
  164. return $this->q;
  165. }
  166. public function setSort($sort)
  167. {
  168. $this->sort = $sort;
  169. $this->apiParas["sort"] = $sort;
  170. }
  171. public function getSort()
  172. {
  173. return $this->sort;
  174. }
  175. public function setStartPrice($startPrice)
  176. {
  177. $this->startPrice = $startPrice;
  178. $this->apiParas["start_price"] = $startPrice;
  179. }
  180. public function getStartPrice()
  181. {
  182. return $this->startPrice;
  183. }
  184. public function setStartTkRate($startTkRate)
  185. {
  186. $this->startTkRate = $startTkRate;
  187. $this->apiParas["start_tk_rate"] = $startTkRate;
  188. }
  189. public function getStartTkRate()
  190. {
  191. return $this->startTkRate;
  192. }
  193. public function getApiMethodName()
  194. {
  195. return "taobao.tbk.item.get";
  196. }
  197. public function getApiParas()
  198. {
  199. return $this->apiParas;
  200. }
  201. public function check()
  202. {
  203. RequestCheckUtil::checkNotNull($this->fields,"fields");
  204. }
  205. public function putOtherTextParam($key, $value) {
  206. $this->apiParas[$key] = $value;
  207. $this->$key = $value;
  208. }
  209. }