|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <?php
- /**
- * TOP API: taobao.xhotel.rate.update request
- *
- * @author auto create
- * @since 1.0, 2017.09.05
- */
- namespace backend\modules\hotel\models\Ali;
- use common\models\commonModel;
- class XhotelRateUpdateRequest extends commonModel
- {
- const ERROR_MSG=[
- 7=>'接口调用频繁,需要重新操作',
- 15=>'价格超过范围, 价格范围(1~99999999)分',
- ];
- /**
- * 不推荐使用
- **/
- public $addBed;
-
- /**
- * 不推荐使用
- **/
- public $addBedPrice;
-
- /**
- * 不推荐使用(仅支持CNY)
- **/
- public $currencyCode;
-
- /**
- * 不推荐使用,请使用out_rid
- **/
- public $gid;
-
- /**
- * 每日价格和房价专有库存信息。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(状态库存开)
- **/
- public $inventory_price;
-
- /**
- * 不推荐使用
- **/
- public $jishiquerenTag;
-
- /**
- * 锁库存截止时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间)
- **/
- public $lockEndTime;
-
- /**
- * 锁库存开始时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间)
- **/
- public $lockStartTime;
-
- /**
- * 废弃
- **/
- public $name;
-
- /**
- * 商家房型ID
- **/
- public $out_rid;
-
- /**
- * 日历价格开关, date:开关状态控制的是那一天 rate_status:开关状态。0,关闭;1,打开
- **/
- public $rate_switch_cal;
-
- /**
- * 商家价格计划编码
- **/
- public $rateplan_code;
-
- /**
- * 不推荐使用,请使用rateplan_code
- **/
- public $rpid;
-
- /**
- * 不推荐使用
- **/
- public $shijiaTag;
-
- /**
- * 系统商,一般不用填写,使用需要申请
- **/
- public $vendor;
-
- public $apiParas = array();
-
- public function setAttributes($values, $safeOnly = true)
- {
- if (is_array($values)) {
- $attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());
- foreach ($values as $name => $value) {
- if (isset($attributes[$name])) {
- $this->apiParas[$name] = $value;
- } elseif ($safeOnly) {
- $this->onUnsafeAttribute($name, $value);
- }
- }
- }
- parent::setAttributes($values, $safeOnly);
- }
-
- public function rules()
- {
- return [
- [['rateplan_code', 'out_rid','inventory_price'], 'required'],
- [['rateplan_code'], 'string','max'=>50],
- [['out_rid'], 'string','max'=>12],
- [['rate_switch_cal'], 'safe'],
- ];
- }
-
- public function setAddBed($addBed)
- {
- $this->addBed = $addBed;
- $this->apiParas["add_bed"] = $addBed;
- }
-
- public function getAddBed()
- {
- return $this->addBed;
- }
-
- public function setAddBedPrice($addBedPrice)
- {
- $this->addBedPrice = $addBedPrice;
- $this->apiParas["add_bed_price"] = $addBedPrice;
- }
-
- public function getAddBedPrice()
- {
- return $this->addBedPrice;
- }
-
- public function setCurrencyCode($currencyCode)
- {
- $this->currencyCode = $currencyCode;
- $this->apiParas["currency_code"] = $currencyCode;
- }
-
- public function getCurrencyCode()
- {
- return $this->currencyCode;
- }
-
- public function setGid($gid)
- {
- $this->gid = $gid;
- $this->apiParas["gid"] = $gid;
- }
-
- public function getGid()
- {
- return $this->gid;
- }
-
- public function setInventoryPrice($inventoryPrice)
- {
- $this->inventory_price = $inventoryPrice;
- $this->apiParas["inventory_price"] = $inventoryPrice;
- }
-
- public function getInventoryPrice()
- {
- return $this->inventory_price;
- }
-
- public function setJishiquerenTag($jishiquerenTag)
- {
- $this->jishiquerenTag = $jishiquerenTag;
- $this->apiParas["jishiqueren_tag"] = $jishiquerenTag;
- }
-
- public function getJishiquerenTag()
- {
- return $this->jishiquerenTag;
- }
-
- public function setLockEndTime($lockEndTime)
- {
- $this->lockEndTime = $lockEndTime;
- $this->apiParas["lock_end_time"] = $lockEndTime;
- }
-
- public function getLockEndTime()
- {
- return $this->lockEndTime;
- }
-
- public function setLockStartTime($lockStartTime)
- {
- $this->lockStartTime = $lockStartTime;
- $this->apiParas["lock_start_time"] = $lockStartTime;
- }
-
- public function getLockStartTime()
- {
- return $this->lockStartTime;
- }
-
- public function setName($name)
- {
- $this->name = $name;
- $this->apiParas["name"] = $name;
- }
-
- public function getName()
- {
- return $this->name;
- }
-
- public function setOutRid($outRid)
- {
- $this->out_rid = $outRid;
- $this->apiParas["out_rid"] = $outRid;
- }
-
- public function getOutRid()
- {
- return $this->out_rid;
- }
-
- public function setRateSwitchCal($rateSwitchCal)
- {
- $this->rate_switch_cal = $rateSwitchCal;
- $this->apiParas["rate_switch_cal"] = $rateSwitchCal;
- }
-
- public function getRateSwitchCal()
- {
- return $this->rate_switch_cal;
- }
-
- public function setRateplanCode($rateplanCode)
- {
- $this->rateplan_code = $rateplanCode;
- $this->apiParas["rateplan_code"] = $rateplanCode;
- }
-
- public function getRateplanCode()
- {
- return $this->rateplan_code;
- }
-
- public function setRpid($rpid)
- {
- $this->rpid = $rpid;
- $this->apiParas["rpid"] = $rpid;
- }
-
- public function getRpid()
- {
- return $this->rpid;
- }
-
- public function setShijiaTag($shijiaTag)
- {
- $this->shijiaTag = $shijiaTag;
- $this->apiParas["shijia_tag"] = $shijiaTag;
- }
-
- public function getShijiaTag()
- {
- return $this->shijiaTag;
- }
-
- public function setVendor($vendor)
- {
- $this->vendor = $vendor;
- $this->apiParas["vendor"] = $vendor;
- }
-
- public function getVendor()
- {
- return $this->vendor;
- }
-
- public function getApiMethodName()
- {
- return "taobao.xhotel.rate.update";
- }
-
- public function getApiParas()
- {
- return $this->apiParas;
- }
-
- public function check()
- {
-
- RequestCheckUtil::checkMaxValue($this->addBed,2,"addBed");
- RequestCheckUtil::checkMinValue($this->addBed,1,"addBed");
- RequestCheckUtil::checkMaxLength($this->name,60,"name");
- RequestCheckUtil::checkMaxLength($this->outRid,128,"outRid");
- RequestCheckUtil::checkMaxLength($this->rateplanCode,50,"rateplanCode");
- RequestCheckUtil::checkMaxLength($this->vendor,50,"vendor");
- }
-
- public function putOtherTextParam($key, $value) {
- $this->apiParas[$key] = $value;
- $this->$key = $value;
- }
- }
|