ShippingTemplateRegionEntity.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. namespace app\entity\data\shipping;
  3. use app\entity\data\DataEntity;
  4. class ShippingTemplateRegionEntity extends DataEntity
  5. {
  6. public $shippingTemplateRegionId = 0; // 编号
  7. public $tempId = 0; // 模板ID
  8. public $cityId = ''; // 城市ID /id/id/id/
  9. public $cityIdList = []; // 城市ID []
  10. public $first = '0.00'; // 首件
  11. public $firstPrice = '0.00'; // 首件运费
  12. public $continue = '0.00'; // 续件
  13. public $continuePrice = '0.00'; // 续件运费
  14. /**
  15. * @return int
  16. */
  17. public function getShippingTemplateRegionId(): int
  18. {
  19. return $this->shippingTemplateRegionId;
  20. }
  21. /**
  22. * @param int $shippingTemplateRegionId
  23. * @return ShippingTemplateRegionEntity
  24. */
  25. public function setShippingTemplateRegionId(int $shippingTemplateRegionId): ShippingTemplateRegionEntity
  26. {
  27. $this->shippingTemplateRegionId = $shippingTemplateRegionId;
  28. return $this;
  29. }
  30. /**
  31. * @return int
  32. */
  33. public function getTempId(): int
  34. {
  35. return $this->tempId;
  36. }
  37. /**
  38. * @param int $tempId
  39. * @return ShippingTemplateRegionEntity
  40. */
  41. public function setTempId(int $tempId): ShippingTemplateRegionEntity
  42. {
  43. $this->tempId = $tempId;
  44. return $this;
  45. }
  46. /**
  47. * @return string
  48. */
  49. public function getCityId(): string
  50. {
  51. return $this->cityId;
  52. }
  53. /**
  54. * @param string $cityId
  55. * @return ShippingTemplateRegionEntity
  56. */
  57. public function setCityId(string $cityId): ShippingTemplateRegionEntity
  58. {
  59. $this->cityId = $cityId;
  60. $cityIdList = explode("/", $this->cityId);
  61. $cityIdList = array_filter($cityIdList); // 删除空元素
  62. $cityIdList = array_values($cityIdList); // 重建数组索引
  63. $this->setCityIdList($cityIdList);
  64. return $this;
  65. }
  66. /**
  67. * @return array
  68. */
  69. public function getCityIdList(): array
  70. {
  71. return $this->cityIdList;
  72. }
  73. /**
  74. * @param array $cityIdList
  75. * @return ShippingTemplateRegionEntity
  76. */
  77. public function setCityIdList(array $cityIdList): ShippingTemplateRegionEntity
  78. {
  79. $this->cityIdList = $cityIdList;
  80. return $this;
  81. }
  82. /**
  83. * @return string
  84. */
  85. public function getFirst(): string
  86. {
  87. return $this->first;
  88. }
  89. /**
  90. * @param string $first
  91. * @return ShippingTemplateRegionEntity
  92. */
  93. public function setFirst(string $first): ShippingTemplateRegionEntity
  94. {
  95. $this->first = $first;
  96. return $this;
  97. }
  98. /**
  99. * @return string
  100. */
  101. public function getFirstPrice(): string
  102. {
  103. return $this->firstPrice;
  104. }
  105. /**
  106. * @param string $firstPrice
  107. * @return ShippingTemplateRegionEntity
  108. */
  109. public function setFirstPrice(string $firstPrice): ShippingTemplateRegionEntity
  110. {
  111. $this->firstPrice = $firstPrice;
  112. return $this;
  113. }
  114. /**
  115. * @return string
  116. */
  117. public function getContinue(): string
  118. {
  119. return $this->continue;
  120. }
  121. /**
  122. * @param string $continue
  123. * @return ShippingTemplateRegionEntity
  124. */
  125. public function setContinue(string $continue): ShippingTemplateRegionEntity
  126. {
  127. $this->continue = $continue;
  128. return $this;
  129. }
  130. /**
  131. * @return string
  132. */
  133. public function getContinuePrice(): string
  134. {
  135. return $this->continuePrice;
  136. }
  137. /**
  138. * @param string $continuePrice
  139. * @return ShippingTemplateRegionEntity
  140. */
  141. public function setContinuePrice(string $continuePrice): ShippingTemplateRegionEntity
  142. {
  143. $this->continuePrice = $continuePrice;
  144. return $this;
  145. }
  146. }