QueryInterface.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php
  2. namespace logistics;
  3. use app\common\model\LogisticsCompany;
  4. use fast\Arr;
  5. abstract class QueryInterface{
  6. protected $no;
  7. protected $username;
  8. protected $phone;
  9. protected $fromMobile;
  10. protected $fromUsername;
  11. protected $extend=[];
  12. /** @var LogisticsCompany */
  13. protected $logistics;
  14. protected $fromArea;
  15. protected $toArea;
  16. protected $cargo;
  17. abstract public function query();
  18. abstract public function maptrack();
  19. abstract public function labelOrder();
  20. public function setNo($value){
  21. $this->no=$value;
  22. return $this;
  23. }
  24. public function setUserName($value){
  25. $this->username=$value;
  26. return $this;
  27. }
  28. public function setPhone($phone)
  29. {
  30. $this->phone = $phone;
  31. return $this;
  32. }
  33. /**
  34. * @return mixed
  35. */
  36. public function getNo()
  37. {
  38. return $this->no;
  39. }
  40. /**
  41. * @return mixed
  42. */
  43. public function getUsername()
  44. {
  45. return $this->username;
  46. }
  47. /**
  48. * @return mixed
  49. */
  50. public function getPhone()
  51. {
  52. return $this->phone;
  53. }
  54. /**
  55. * @param LogisticsCompany $logistics
  56. */
  57. public function setLogistics(LogisticsCompany $logistics)
  58. {
  59. $this->logistics = $logistics;
  60. return $this;
  61. }
  62. /**
  63. * @return LogisticsCompany
  64. */
  65. public function getLogistics($field=null)
  66. {
  67. if(is_null($field)) {
  68. return $this->logistics;
  69. }
  70. return Arr::get($this->logistics,$field);
  71. }
  72. public static function init():self{
  73. $provider=[
  74. 'kd100'=>Kd100::class,
  75. ];
  76. return new $provider['kd100'];
  77. }
  78. /**
  79. * @param array $extend
  80. */
  81. public function setExtend(array $extend)
  82. {
  83. $this->extend = $extend;
  84. return $this;
  85. }
  86. /**
  87. * @param mixed $fromArea
  88. */
  89. public function setFromArea($fromArea)
  90. {
  91. $this->fromArea = $fromArea;
  92. return $this;
  93. }
  94. /**
  95. * @return mixed
  96. */
  97. public function getFromArea()
  98. {
  99. return $this->fromArea;
  100. }
  101. /**
  102. * @param mixed $toArea
  103. */
  104. public function setToArea($toArea)
  105. {
  106. $this->toArea = $toArea;
  107. return $this;
  108. }
  109. /**
  110. * @return mixed
  111. */
  112. public function getToArea()
  113. {
  114. return $this->toArea;
  115. }
  116. /**
  117. * @param mixed $fromMobile
  118. */
  119. public function setFromMobile($fromMobile)
  120. {
  121. $this->fromMobile = $fromMobile;
  122. return $this;
  123. }
  124. /**
  125. * @param mixed $fromUsername
  126. */
  127. public function setFromUsername($fromUsername)
  128. {
  129. $this->fromUsername = $fromUsername;
  130. return $this;
  131. }
  132. /**
  133. * @return mixed
  134. */
  135. public function getFromMobile()
  136. {
  137. return $this->fromMobile;
  138. }
  139. /**
  140. * @return mixed
  141. */
  142. public function getFromUsername()
  143. {
  144. return $this->fromUsername;
  145. }
  146. /**
  147. * @param mixed $cargo
  148. */
  149. public function setCargo($cargo)
  150. {
  151. $this->cargo = $cargo;
  152. return $this;
  153. }
  154. /**
  155. * @return mixed
  156. */
  157. public function getCargo()
  158. {
  159. return $this->cargo;
  160. }
  161. protected $count=1;
  162. /**
  163. * @return int
  164. */
  165. public function getCount(): int
  166. {
  167. return $this->count;
  168. }
  169. /**
  170. * @param int $count
  171. */
  172. public function setCount($count)
  173. {
  174. $this->count = $count;
  175. return $this;
  176. }
  177. /** @var string */
  178. protected $orderNo;
  179. /**
  180. * @param string $orderNo
  181. */
  182. public function setOrderNo(string $orderNo)
  183. {
  184. $this->orderNo = $orderNo;
  185. return $this;
  186. }
  187. /**
  188. * @return string
  189. */
  190. public function getOrderNo(): string
  191. {
  192. return $this->orderNo;
  193. }
  194. }