Nessuna descrizione

TbkOrderGetRequest.php 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /**
  3. * TOP API: taobao.tbk.order.get request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2018.10.24
  7. */
  8. class TbkOrderGetRequest
  9. {
  10. /**
  11. * 需返回的字段列表
  12. **/
  13. private $fields;
  14. /**
  15. * 订单数据统计类型,1: 2方订单,2: 3方订单,如果不设置,或者设置为1,表示2方订单
  16. **/
  17. private $orderCountType;
  18. /**
  19. * 订单查询类型,创建时间“create_time”,或结算时间“settle_time”。当查询渠道或会员运营订单时,建议入参创建时间“create_time”进行查询
  20. **/
  21. private $orderQueryType;
  22. /**
  23. * 订单场景类型,1:常规订单,2:渠道订单,3:会员运营订单,默认为1,通过设置订单场景类型,媒体可以查询指定场景下的订单信息,例如不设置,或者设置为1,表示查询常规订单,常规订单包含淘宝客所有的订单数据,含渠道,及会员运营订单,但不包含3方分成,及维权订单
  24. **/
  25. private $orderScene;
  26. /**
  27. * 第几页,默认1,1~100
  28. **/
  29. private $pageNo;
  30. /**
  31. * 页大小,默认20,1~100
  32. **/
  33. private $pageSize;
  34. /**
  35. * 订单查询时间范围,单位:秒,最小60,最大1200,如不填写,默认60。查询常规订单、三方订单、渠道,及会员订单时均需要设置此参数,直接通过设置page_size,page_no 翻页查询数据即可
  36. **/
  37. private $span;
  38. /**
  39. * 订单查询开始时间
  40. **/
  41. private $startTime;
  42. /**
  43. * 订单状态,1: 全部订单,3:订单结算,12:订单付款, 13:订单失效,14:订单成功; 订单查询类型为‘结算时间’时,只能查订单结算状态
  44. **/
  45. private $tkStatus;
  46. private $apiParas = array();
  47. public function setFields($fields)
  48. {
  49. $this->fields = $fields;
  50. $this->apiParas["fields"] = $fields;
  51. }
  52. public function getFields()
  53. {
  54. return $this->fields;
  55. }
  56. public function setOrderCountType($orderCountType)
  57. {
  58. $this->orderCountType = $orderCountType;
  59. $this->apiParas["order_count_type"] = $orderCountType;
  60. }
  61. public function getOrderCountType()
  62. {
  63. return $this->orderCountType;
  64. }
  65. public function setOrderQueryType($orderQueryType)
  66. {
  67. $this->orderQueryType = $orderQueryType;
  68. $this->apiParas["order_query_type"] = $orderQueryType;
  69. }
  70. public function getOrderQueryType()
  71. {
  72. return $this->orderQueryType;
  73. }
  74. public function setOrderScene($orderScene)
  75. {
  76. $this->orderScene = $orderScene;
  77. $this->apiParas["order_scene"] = $orderScene;
  78. }
  79. public function getOrderScene()
  80. {
  81. return $this->orderScene;
  82. }
  83. public function setPageNo($pageNo)
  84. {
  85. $this->pageNo = $pageNo;
  86. $this->apiParas["page_no"] = $pageNo;
  87. }
  88. public function getPageNo()
  89. {
  90. return $this->pageNo;
  91. }
  92. public function setPageSize($pageSize)
  93. {
  94. $this->pageSize = $pageSize;
  95. $this->apiParas["page_size"] = $pageSize;
  96. }
  97. public function getPageSize()
  98. {
  99. return $this->pageSize;
  100. }
  101. public function setSpan($span)
  102. {
  103. $this->span = $span;
  104. $this->apiParas["span"] = $span;
  105. }
  106. public function getSpan()
  107. {
  108. return $this->span;
  109. }
  110. public function setStartTime($startTime)
  111. {
  112. $this->startTime = $startTime;
  113. $this->apiParas["start_time"] = $startTime;
  114. }
  115. public function getStartTime()
  116. {
  117. return $this->startTime;
  118. }
  119. public function setTkStatus($tkStatus)
  120. {
  121. $this->tkStatus = $tkStatus;
  122. $this->apiParas["tk_status"] = $tkStatus;
  123. }
  124. public function getTkStatus()
  125. {
  126. return $this->tkStatus;
  127. }
  128. public function getApiMethodName()
  129. {
  130. return "taobao.tbk.order.get";
  131. }
  132. public function getApiParas()
  133. {
  134. return $this->apiParas;
  135. }
  136. public function check()
  137. {
  138. RequestCheckUtil::checkNotNull($this->fields,"fields");
  139. RequestCheckUtil::checkNotNull($this->startTime,"startTime");
  140. }
  141. public function putOtherTextParam($key, $value) {
  142. $this->apiParas[$key] = $value;
  143. $this->$key = $value;
  144. }
  145. }