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.
 
 
 
 
 
 

74 lines
2.9 KiB

  1. <?php
  2. /**
  3. * TOP API: taobao.xhotel.rates.increment request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2017.05.03
  7. */
  8. namespace backend\modules\hotel\models\Ali;
  9. use common\models\commonModel;
  10. class XhotelRatesIncrementRequest extends commonModel
  11. {
  12. const ERROR_MSG=[
  13. 7=>'接口调用频繁,需要重新操作',
  14. 15=>'阿里后台rpid是否存在且价格不能设置为0',
  15. ];
  16. /**
  17. * 批量修改价格和房价专有库存信息,json格式,可同时修改多套房型+价格计划的价格:A:use_room_inventory:是否使用房型共享库存,可选值 true false 1、true时:使用房型共享库存 2、false时:使用房价专有库存,此时要求房价专有库存必填。B:date 日期必须为 T---T+180 日内的日期(T为当天),不能重复。 C:price 价格 int类型 取值范围1-99999999 单位为分D:quota 房价专有库存 int 类型 取值范围 0-999(数量库存) 60000(状态库存关) 61000(状态库存开) E:status 价格开关,0为关,1为开。lock_start_time为锁库存开始时间,lock_end_time为锁库存结束时间,如果当前时间在这个时间范围内,那么不允许修改库存。示例值:(1)[{"out_rid":"ABCDE_123","rateplan_code":"ABCDE_WHL01","vendor":"","lock_start_time":"","lock_end_time":"","data":{"use_room_inventory":false,"inventory_price":[{"date":2013-11-18,"quota":1,"price":1000,"status":1},{"date":2013-11-19,"quota":1,"price":1000,"status":0}]}},{"out_rid":"ABCDE_234","rateplan_code":"ABCDE_WHL01","vendor":"","data":{"use_room_inventory":false,"inventory_price":[{"date":2013-11-18,"quota":1,"price":1000,"status":1},{"date":2013-11-19,"quota":1,"price":1000,"status":0}]}}]
  18. **/
  19. public $rate_inventory_price_map;
  20. public $apiParas = array();
  21. public function setAttributes($values, $safeOnly = true)
  22. {
  23. if (is_array($values)) {
  24. $attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());
  25. foreach ($values as $name => $value) {
  26. if (isset($attributes[$name])) {
  27. $this->apiParas[$name] = $value;
  28. } elseif ($safeOnly) {
  29. $this->onUnsafeAttribute($name, $value);
  30. }
  31. }
  32. }
  33. parent::setAttributes($values, $safeOnly);
  34. }
  35. public function rules()
  36. {
  37. return [
  38. [['rate_inventory_price_map'], 'required']
  39. ];
  40. }
  41. public function setRateInventoryPriceMap($rateInventoryPriceMap)
  42. {
  43. $this->rate_inventory_price_map = $rateInventoryPriceMap;
  44. $this->apiParas["rate_inventory_price_map"] = $rateInventoryPriceMap;
  45. }
  46. public function getRateInventoryPriceMap()
  47. {
  48. return $this->rate_inventory_price_map;
  49. }
  50. public function getApiMethodName()
  51. {
  52. return "taobao.xhotel.rates.increment";
  53. }
  54. public function getApiParas()
  55. {
  56. return $this->apiParas;
  57. }
  58. public function putOtherTextParam($key, $value) {
  59. $this->apiParas[$key] = $value;
  60. $this->$key = $value;
  61. }
  62. }