You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

309 lines
6.7 KiB

  1. <?php
  2. /**
  3. * TOP API: taobao.xhotel.rate.update request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2017.09.05
  7. */
  8. namespace backend\modules\hotel\models\Ali;
  9. use common\models\commonModel;
  10. class XhotelRateUpdateRequest extends commonModel
  11. {
  12. const ERROR_MSG=[
  13. 7=>'接口调用频繁,需要重新操作',
  14. 15=>'价格超过范围, 价格范围(1~99999999)分',
  15. ];
  16. /**
  17. * 不推荐使用
  18. **/
  19. public $addBed;
  20. /**
  21. * 不推荐使用
  22. **/
  23. public $addBedPrice;
  24. /**
  25. * 不推荐使用(仅支持CNY)
  26. **/
  27. public $currencyCode;
  28. /**
  29. * 不推荐使用,请使用out_rid
  30. **/
  31. public $gid;
  32. /**
  33. * 每日价格和房价专有库存信息。A:use_room_inventory:是否使用room级别共享库存,可选值 true false 1、true时:使用room级别共享库存(即使用gid对应的XRoom中的inventory),rate_quota_map 的json 数据中不需要录入库存信息,录入的库存信息会忽略 2、false时:使用rate级别私有库存,此时要求价格和库存必填。B:date 日期必须为 T---T+180 日内的日期(T为当天),且不能重复C:price 价格 int类型 取值范围1-99999999 单位为分D:quota 库存 int 类型 取值范围 0-999(数量库存) 60000(状态库存关) 61000(状态库存开)
  34. **/
  35. public $inventory_price;
  36. /**
  37. * 不推荐使用
  38. **/
  39. public $jishiquerenTag;
  40. /**
  41. * 锁库存截止时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间)
  42. **/
  43. public $lockEndTime;
  44. /**
  45. * 锁库存开始时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间)
  46. **/
  47. public $lockStartTime;
  48. /**
  49. * 废弃
  50. **/
  51. public $name;
  52. /**
  53. * 商家房型ID
  54. **/
  55. public $out_rid;
  56. /**
  57. * 日历价格开关, date:开关状态控制的是那一天 rate_status:开关状态。0,关闭;1,打开
  58. **/
  59. public $rate_switch_cal;
  60. /**
  61. * 商家价格计划编码
  62. **/
  63. public $rateplan_code;
  64. /**
  65. * 不推荐使用,请使用rateplan_code
  66. **/
  67. public $rpid;
  68. /**
  69. * 不推荐使用
  70. **/
  71. public $shijiaTag;
  72. /**
  73. * 系统商,一般不用填写,使用需要申请
  74. **/
  75. public $vendor;
  76. public $apiParas = array();
  77. public function setAttributes($values, $safeOnly = true)
  78. {
  79. if (is_array($values)) {
  80. $attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());
  81. foreach ($values as $name => $value) {
  82. if (isset($attributes[$name])) {
  83. $this->apiParas[$name] = $value;
  84. } elseif ($safeOnly) {
  85. $this->onUnsafeAttribute($name, $value);
  86. }
  87. }
  88. }
  89. parent::setAttributes($values, $safeOnly);
  90. }
  91. public function rules()
  92. {
  93. return [
  94. [['rateplan_code', 'out_rid','inventory_price'], 'required'],
  95. [['rateplan_code'], 'string','max'=>50],
  96. [['out_rid'], 'string','max'=>12],
  97. [['rate_switch_cal'], 'safe'],
  98. ];
  99. }
  100. public function setAddBed($addBed)
  101. {
  102. $this->addBed = $addBed;
  103. $this->apiParas["add_bed"] = $addBed;
  104. }
  105. public function getAddBed()
  106. {
  107. return $this->addBed;
  108. }
  109. public function setAddBedPrice($addBedPrice)
  110. {
  111. $this->addBedPrice = $addBedPrice;
  112. $this->apiParas["add_bed_price"] = $addBedPrice;
  113. }
  114. public function getAddBedPrice()
  115. {
  116. return $this->addBedPrice;
  117. }
  118. public function setCurrencyCode($currencyCode)
  119. {
  120. $this->currencyCode = $currencyCode;
  121. $this->apiParas["currency_code"] = $currencyCode;
  122. }
  123. public function getCurrencyCode()
  124. {
  125. return $this->currencyCode;
  126. }
  127. public function setGid($gid)
  128. {
  129. $this->gid = $gid;
  130. $this->apiParas["gid"] = $gid;
  131. }
  132. public function getGid()
  133. {
  134. return $this->gid;
  135. }
  136. public function setInventoryPrice($inventoryPrice)
  137. {
  138. $this->inventory_price = $inventoryPrice;
  139. $this->apiParas["inventory_price"] = $inventoryPrice;
  140. }
  141. public function getInventoryPrice()
  142. {
  143. return $this->inventory_price;
  144. }
  145. public function setJishiquerenTag($jishiquerenTag)
  146. {
  147. $this->jishiquerenTag = $jishiquerenTag;
  148. $this->apiParas["jishiqueren_tag"] = $jishiquerenTag;
  149. }
  150. public function getJishiquerenTag()
  151. {
  152. return $this->jishiquerenTag;
  153. }
  154. public function setLockEndTime($lockEndTime)
  155. {
  156. $this->lockEndTime = $lockEndTime;
  157. $this->apiParas["lock_end_time"] = $lockEndTime;
  158. }
  159. public function getLockEndTime()
  160. {
  161. return $this->lockEndTime;
  162. }
  163. public function setLockStartTime($lockStartTime)
  164. {
  165. $this->lockStartTime = $lockStartTime;
  166. $this->apiParas["lock_start_time"] = $lockStartTime;
  167. }
  168. public function getLockStartTime()
  169. {
  170. return $this->lockStartTime;
  171. }
  172. public function setName($name)
  173. {
  174. $this->name = $name;
  175. $this->apiParas["name"] = $name;
  176. }
  177. public function getName()
  178. {
  179. return $this->name;
  180. }
  181. public function setOutRid($outRid)
  182. {
  183. $this->out_rid = $outRid;
  184. $this->apiParas["out_rid"] = $outRid;
  185. }
  186. public function getOutRid()
  187. {
  188. return $this->out_rid;
  189. }
  190. public function setRateSwitchCal($rateSwitchCal)
  191. {
  192. $this->rate_switch_cal = $rateSwitchCal;
  193. $this->apiParas["rate_switch_cal"] = $rateSwitchCal;
  194. }
  195. public function getRateSwitchCal()
  196. {
  197. return $this->rate_switch_cal;
  198. }
  199. public function setRateplanCode($rateplanCode)
  200. {
  201. $this->rateplan_code = $rateplanCode;
  202. $this->apiParas["rateplan_code"] = $rateplanCode;
  203. }
  204. public function getRateplanCode()
  205. {
  206. return $this->rateplan_code;
  207. }
  208. public function setRpid($rpid)
  209. {
  210. $this->rpid = $rpid;
  211. $this->apiParas["rpid"] = $rpid;
  212. }
  213. public function getRpid()
  214. {
  215. return $this->rpid;
  216. }
  217. public function setShijiaTag($shijiaTag)
  218. {
  219. $this->shijiaTag = $shijiaTag;
  220. $this->apiParas["shijia_tag"] = $shijiaTag;
  221. }
  222. public function getShijiaTag()
  223. {
  224. return $this->shijiaTag;
  225. }
  226. public function setVendor($vendor)
  227. {
  228. $this->vendor = $vendor;
  229. $this->apiParas["vendor"] = $vendor;
  230. }
  231. public function getVendor()
  232. {
  233. return $this->vendor;
  234. }
  235. public function getApiMethodName()
  236. {
  237. return "taobao.xhotel.rate.update";
  238. }
  239. public function getApiParas()
  240. {
  241. return $this->apiParas;
  242. }
  243. public function check()
  244. {
  245. RequestCheckUtil::checkMaxValue($this->addBed,2,"addBed");
  246. RequestCheckUtil::checkMinValue($this->addBed,1,"addBed");
  247. RequestCheckUtil::checkMaxLength($this->name,60,"name");
  248. RequestCheckUtil::checkMaxLength($this->outRid,128,"outRid");
  249. RequestCheckUtil::checkMaxLength($this->rateplanCode,50,"rateplanCode");
  250. RequestCheckUtil::checkMaxLength($this->vendor,50,"vendor");
  251. }
  252. public function putOtherTextParam($key, $value) {
  253. $this->apiParas[$key] = $value;
  254. $this->$key = $value;
  255. }
  256. }