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.

XhotelUpdateRequest.php 16 KiB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <?php
  2. /**
  3. * TOP API: taobao.xhotel.update request
  4. *
  5. * @author auto create
  6. * @since 1.0, 2017.08.31
  7. */
  8. namespace backend\modules\hotel\models\Ali;
  9. use common\models\commonModel;
  10. class XhotelUpdateRequest extends commonModel
  11. {
  12. // 阿里错误信息修改
  13. const ERROR_MSG=[
  14. 7=>'接口调用频繁,需要重新操作',
  15. 15=>'已直连酒店不能更改城市信息,需要更新城市信息需要先解除匹配',
  16. ];
  17. /**
  18. * 酒店地址。长度不能超过120
  19. **/
  20. public $address;
  21. /**
  22. * 预订须知。json字段描述:hotelInMountaintop 酒店位于山顶 1在山顶、0不在;needBoat 酒店需要坐船前往 1需要、0不需要;酒店位于景区内 1在景区、0不在;extraBed 加床收费;extraCharge 额外收费;arrivalTime 到店时间;extend 其他补充项
  23. **/
  24. public $bookingNotice;
  25. /**
  26. * 酒店品牌。取值为数字。枚举如下(只给出top30,如果不满足,请联系去啊接口人): ruJia("1", "rujiakuaijie", "如家快捷", 1), qiTian("2", "7 days", "7天连锁", 1), hanTing("3", "Hanting Inns & Hotels", "汉庭酒店", 1), geLinHaoTai("4", "Green Tree Inn", "格林豪泰", 1), jinJiang("5", "Jinjiang Inn", "锦江之星", 1), su8("6", "Super 8", "速8", 1), moTai("7", "Motel", "莫泰", 1), zhouji("8", "InterContinental", "洲际", 4), budint("9", "Pod Inn", "布丁", 1), jiuJiu("10", "jiujiuliansuo", "99连锁", 1), piaoHome("11", "Piao Home Inn", "飘HOME", 1), juzi("12", "Orange Hotels", "桔子酒店", 1), yibai("13", "yibai", "易佰", 1), weiyena("14","weiyena","维也纳",2), huangguanjiari("15", "huangguanjiari", "皇冠假日", 4), xidawu("16", "xidawu", "喜达屋", 3), chengshiBJ("17", "chengshibianjie", "城市便捷", 1), shagnKeYou("18", "shagnkeyou", "尚客优", 1), jinjiang("19", "jinjiang", "锦江酒店", 3), wendemu("20", "Hawthorn Suites", "温德姆", 4), yibisi("21", "Ibis Hotels", "宜必思", 1), wanhao("22", "JM Hoteles", "万豪", 4), yijia365("23", "yijia365", "驿家365", 1), shoulv("24", "shoulvjituan", "首旅建国", 3), kaiyuan("25", "New Century Hotel", "开元大酒店", 4), yagao("26", "yagao", "雅高", 3), daisi("27", "daisi", "戴斯", 3), jinling("28", "jinlingliansuo", "金陵", 4), xianggelila("29", "Shangri-La City Hotels", "香格里拉", 4), xierdun("30", "Hilton", "希尔顿", 4)
  27. **/
  28. public $brand;
  29. /**
  30. * 商业区(圈)长度不超过20字
  31. **/
  32. public $business;
  33. /**
  34. * 城市编码。参见:http://kezhan.trip.taobao.com/area.html,domestic为false时,输入对应国家的海外城市编码,可调用海外城市查询接口获取;(新增酒店时为必须)
  35. **/
  36. public $city;
  37. /**
  38. * domestic为true时,固定China; domestic为false时,必须传定义的海外国家编码值。参见:http://kezhan.trip.taobao.com/countrys.html
  39. **/
  40. public $country;
  41. /**
  42. * 逗号分隔的字符串 1visa;2万事达卡;3美国运通卡;4发现卡;5大来卡;6JCB卡;7银联卡
  43. **/
  44. public $creditCardTypes;
  45. /**
  46. * 装修时间,格式为2015-10-01
  47. **/
  48. public $decorateTime;
  49. /**
  50. * 酒店描述
  51. **/
  52. public $description;
  53. /**
  54. * 区域(县级市)编码。参见:http://kezhan.trip.taobao.com/area.html
  55. **/
  56. public $district;
  57. /**
  58. * 是否国内酒店。0:国内;1:国外
  59. **/
  60. public $domestic;
  61. /**
  62. * 不要使用
  63. **/
  64. public $extend;
  65. /**
  66. * 楼层信息
  67. **/
  68. public $floors;
  69. /**
  70. * (已废弃)请使用outer_id来标识要修改的酒店
  71. **/
  72. public $hid;
  73. /**
  74. * 酒店设施。json格式示例值:{"free Wi-Fi in all rooms":"true","massage":"true","meetingRoom":"true"}目前支持维护的设施枚举有:free Wi-Fi in all rooms 所有房间设有免费无线网络;meetingRoom 会议室;massage 按摩室;fitnessClub 健身房;bar 酒吧;cafe 咖啡厅;frontDeskSafe 前台贵重物品保险柜wifi 无线上网公共区域;casino 娱乐场/棋牌室;restaurant 餐厅;smoking area 吸烟区;Business Facilities 商务设施
  75. **/
  76. public $hotelFacilities;
  77. /**
  78. * 酒店入住政策(针对国际酒店,儿童及加床信息)格式:{"children_age_from":"2","children_age_to":"3","children_stay_free":"True","infant_age":"1","min_guest_age":"4"}
  79. **/
  80. public $hotelPolicies;
  81. /**
  82. * 纬度
  83. **/
  84. public $latitude;
  85. /**
  86. * 经度
  87. **/
  88. public $longitude;
  89. /**
  90. * 酒店名称;(新增酒店时为必须)
  91. **/
  92. public $name;
  93. /**
  94. * 卖家酒店英文名称
  95. **/
  96. public $nameE;
  97. /**
  98. * 开业时间,格式为2015-01-01
  99. **/
  100. public $openingTime;
  101. /**
  102. * 扩展信息的JSON。 orbitTrack 业务字段是指从飞猪到酒店说经过平台名以及方式的一个数组,按顺序,从飞猪,再经过若干平台,最后到酒店, platform是指定当前平台名,ways 是指通过哪种方式到该平台 其中,飞猪到下一个平台里, ways 字段只能是【直连】、【人工】两个方式之一; 从最后一个平台到酒店的ways字段只能是【电话】、【传真】、【人工】、【系统】之一; 第一个 飞猪平台 和 最后具体酒店是至少得填的
  103. **/
  104. public $orbitTrack;
  105. /**
  106. * 必传,酒店标识,商家酒店ID
  107. **/
  108. public $outer_id;
  109. /**
  110. * 酒店图片只支持远程图片,格式如下:[{"url":"http://123.jpg","ismain":"false","type":"大堂","attribute":"普通图"},{"url":"http://456.jpg","ismain":"true","type":"公共区域","attribute":"全景图"},{"url":"http://789.jpg","ismain":"false","type":"大堂","attribute":"普通图"}] 其中url是远程图片的访问地址,main是否为主图(主图只能有一个),attribute表示图片属性,取值范围只能是:[普通图, 平面图, 全景图] ,type表示图片类型,取值范围只能是:[周边, 外观, 商务中心, 健身房, 其他, 会议室, 餐厅, 浴室, 客房, 公共区域, 娱乐设施, 大堂, 泳池],图片数量最多10张。要求:无logo、水印、边框、人物,不模糊、重复、歪斜,房间图清晰,图片尺寸不小于300*225,不小于5M
  111. **/
  112. public $pics;
  113. /**
  114. * 坐标类型,现在支持:G – GoogleB – 百度A – 高德M – MapbarL – 灵图
  115. **/
  116. public $positionType;
  117. /**
  118. * 邮编
  119. **/
  120. public $postalCode;
  121. /**
  122. * 省份编码。参见:http://kezhan.trip.taobao.com/area.html,domestic为false时默认为0
  123. **/
  124. public $province;
  125. /**
  126. * 房间的基础设施。json格式示例值:{"bathtub":"true","bathPub":"true"}目前支持维护的设施枚举有:bathtub 独立卫浴;bathPub 公共卫浴
  127. **/
  128. public $roomFacilities;
  129. /**
  130. * 房间数 0~9999之内的数字
  131. **/
  132. public $rooms;
  133. /**
  134. * 酒店基础服务。json格式示例值:{"receiveForeignGuests":"true","morningCall":"true","breakfast":"true"}目前支持维护的设施枚举有:receiveForeignGuests 接待外宾;morningCall 叫醒服务; breakfast 早餐服务; airportShuttle 接机服务; luggageClaim 行李寄存; rentCar 租车; HourRoomService24 24小时客房服务; airportTransfer 酒店/机场接送; dryCleaning 干洗; expressCheckInCheckOut 快速入住/退房登记; custodyServices 保管服务
  135. **/
  136. public $service;
  137. /**
  138. * 该字段只有确定的时候,才允许填入。用于标示和淘宝酒店的匹配关系。目前尚未启动该字段。
  139. **/
  140. public $shid;
  141. /**
  142. * 酒店档次,星级。取值范围为1,1.5,2,2.5,3,3.5,4,4.5,5
  143. **/
  144. public $star;
  145. /**
  146. * 酒店状态 0:正常,-1:删除,-2:停售
  147. **/
  148. public $status;
  149. /**
  150. * 打标去标使用的 tagJson 字段
  151. **/
  152. public $tagJson;
  153. /**
  154. * 酒店电话。格式:国家代码(最长6位)#区号(最长4位)#电话(最长20位)。国家代码提示:中国大陆0086、香港00852、澳门00853、台湾00886
  155. **/
  156. public $tel;
  157. /**
  158. * 酒店曾用名
  159. **/
  160. public $usedName;
  161. /**
  162. * 系统商,一般情况不用,需申请使用
  163. **/
  164. public $vendor;
  165. public $apiParas = array();
  166. public function rules()
  167. {
  168. return [
  169. [['outer_id', 'name', 'address', 'tel', 'city', 'star'], 'required'],
  170. [['outer_id'], 'string', 'max' => 64],
  171. [['address'], 'string', 'max' => 120],
  172. [['tel'], 'string', 'max' => 30],
  173. [['status'], 'number', 'on' => 'update_hotel', 'message' => '酒店状态不正确'],
  174. [['status'], 'number', 'on' => 'add_hotel', 'message' => '酒店状态不正确']
  175. ];
  176. }
  177. public function setAttributes($values, $safeOnly = true)
  178. {
  179. if (is_array($values)) {
  180. $attributes = array_flip($safeOnly ? $this->safeAttributes() : $this->attributes());
  181. foreach ($values as $name => $value) {
  182. if (isset($attributes[$name])) {
  183. $this->apiParas[$name] = $value;
  184. } elseif ($safeOnly) {
  185. $this->onUnsafeAttribute($name, $value);
  186. }
  187. }
  188. }
  189. parent::setAttributes($values, $safeOnly);
  190. }
  191. public function setAddress($address)
  192. {
  193. $this->address = $address;
  194. $this->apiParas["address"] = $address;
  195. }
  196. public function getAddress()
  197. {
  198. return $this->address;
  199. }
  200. public function setBookingNotice($bookingNotice)
  201. {
  202. $this->bookingNotice = $bookingNotice;
  203. $this->apiParas["booking_notice"] = $bookingNotice;
  204. }
  205. public function getBookingNotice()
  206. {
  207. return $this->bookingNotice;
  208. }
  209. public function setBrand($brand)
  210. {
  211. $this->brand = $brand;
  212. $this->apiParas["brand"] = $brand;
  213. }
  214. public function getBrand()
  215. {
  216. return $this->brand;
  217. }
  218. public function setBusiness($business)
  219. {
  220. $this->business = $business;
  221. $this->apiParas["business"] = $business;
  222. }
  223. public function getBusiness()
  224. {
  225. return $this->business;
  226. }
  227. public function setCity($city)
  228. {
  229. $this->city = $city;
  230. $this->apiParas["city"] = $city;
  231. }
  232. public function getCity()
  233. {
  234. return $this->city;
  235. }
  236. public function setCountry($country)
  237. {
  238. $this->country = $country;
  239. $this->apiParas["country"] = $country;
  240. }
  241. public function getCountry()
  242. {
  243. return $this->country;
  244. }
  245. public function setCreditCardTypes($creditCardTypes)
  246. {
  247. $this->creditCardTypes = $creditCardTypes;
  248. $this->apiParas["credit_card_types"] = $creditCardTypes;
  249. }
  250. public function getCreditCardTypes()
  251. {
  252. return $this->creditCardTypes;
  253. }
  254. public function setDecorateTime($decorateTime)
  255. {
  256. $this->decorateTime = $decorateTime;
  257. $this->apiParas["decorate_time"] = $decorateTime;
  258. }
  259. public function getDecorateTime()
  260. {
  261. return $this->decorateTime;
  262. }
  263. public function setDescription($description)
  264. {
  265. $this->description = $description;
  266. $this->apiParas["description"] = $description;
  267. }
  268. public function getDescription()
  269. {
  270. return $this->description;
  271. }
  272. public function setDistrict($district)
  273. {
  274. $this->district = $district;
  275. $this->apiParas["district"] = $district;
  276. }
  277. public function getDistrict()
  278. {
  279. return $this->district;
  280. }
  281. public function setDomestic($domestic)
  282. {
  283. $this->domestic = $domestic;
  284. $this->apiParas["domestic"] = $domestic;
  285. }
  286. public function getDomestic()
  287. {
  288. return $this->domestic;
  289. }
  290. public function setExtend($extend)
  291. {
  292. $this->extend = $extend;
  293. $this->apiParas["extend"] = $extend;
  294. }
  295. public function getExtend()
  296. {
  297. return $this->extend;
  298. }
  299. public function setFloors($floors)
  300. {
  301. $this->floors = $floors;
  302. $this->apiParas["floors"] = $floors;
  303. }
  304. public function getFloors()
  305. {
  306. return $this->floors;
  307. }
  308. public function setHid($hid)
  309. {
  310. $this->hid = $hid;
  311. $this->apiParas["hid"] = $hid;
  312. }
  313. public function getHid()
  314. {
  315. return $this->hid;
  316. }
  317. public function setHotelFacilities($hotelFacilities)
  318. {
  319. $this->hotelFacilities = $hotelFacilities;
  320. $this->apiParas["hotel_facilities"] = $hotelFacilities;
  321. }
  322. public function getHotelFacilities()
  323. {
  324. return $this->hotelFacilities;
  325. }
  326. public function setHotelPolicies($hotelPolicies)
  327. {
  328. $this->hotelPolicies = $hotelPolicies;
  329. $this->apiParas["hotel_policies"] = $hotelPolicies;
  330. }
  331. public function getHotelPolicies()
  332. {
  333. return $this->hotelPolicies;
  334. }
  335. public function setLatitude($latitude)
  336. {
  337. $this->latitude = $latitude;
  338. $this->apiParas["latitude"] = $latitude;
  339. }
  340. public function getLatitude()
  341. {
  342. return $this->latitude;
  343. }
  344. public function setLongitude($longitude)
  345. {
  346. $this->longitude = $longitude;
  347. $this->apiParas["longitude"] = $longitude;
  348. }
  349. public function getLongitude()
  350. {
  351. return $this->longitude;
  352. }
  353. public function setName($name)
  354. {
  355. $this->name = $name;
  356. $this->apiParas["name"] = $name;
  357. }
  358. public function getName()
  359. {
  360. return $this->name;
  361. }
  362. public function setNameE($nameE)
  363. {
  364. $this->nameE = $nameE;
  365. $this->apiParas["name_e"] = $nameE;
  366. }
  367. public function getNameE()
  368. {
  369. return $this->nameE;
  370. }
  371. public function setOpeningTime($openingTime)
  372. {
  373. $this->openingTime = $openingTime;
  374. $this->apiParas["opening_time"] = $openingTime;
  375. }
  376. public function getOpeningTime()
  377. {
  378. return $this->openingTime;
  379. }
  380. public function setOrbitTrack($orbitTrack)
  381. {
  382. $this->orbitTrack = $orbitTrack;
  383. $this->apiParas["orbit_track"] = $orbitTrack;
  384. }
  385. public function getOrbitTrack()
  386. {
  387. return $this->orbitTrack;
  388. }
  389. public function setOuterId($outerId)
  390. {
  391. $this->outer_id = $outerId;
  392. $this->apiParas["outer_id"] = $outerId;
  393. }
  394. public function getOuterId()
  395. {
  396. return $this->outer_id;
  397. }
  398. public function setPics($pics)
  399. {
  400. $this->pics = $pics;
  401. $this->apiParas["pics"] = $pics;
  402. }
  403. public function getPics()
  404. {
  405. return $this->pics;
  406. }
  407. public function setPositionType($positionType)
  408. {
  409. $this->positionType = $positionType;
  410. $this->apiParas["position_type"] = $positionType;
  411. }
  412. public function getPositionType()
  413. {
  414. return $this->positionType;
  415. }
  416. public function setPostalCode($postalCode)
  417. {
  418. $this->postalCode = $postalCode;
  419. $this->apiParas["postal_code"] = $postalCode;
  420. }
  421. public function getPostalCode()
  422. {
  423. return $this->postalCode;
  424. }
  425. public function setProvince($province)
  426. {
  427. $this->province = $province;
  428. $this->apiParas["province"] = $province;
  429. }
  430. public function getProvince()
  431. {
  432. return $this->province;
  433. }
  434. public function setRoomFacilities($roomFacilities)
  435. {
  436. $this->roomFacilities = $roomFacilities;
  437. $this->apiParas["room_facilities"] = $roomFacilities;
  438. }
  439. public function getRoomFacilities()
  440. {
  441. return $this->roomFacilities;
  442. }
  443. public function setRooms($rooms)
  444. {
  445. $this->rooms = $rooms;
  446. $this->apiParas["rooms"] = $rooms;
  447. }
  448. public function getRooms()
  449. {
  450. return $this->rooms;
  451. }
  452. public function setService($service)
  453. {
  454. $this->service = $service;
  455. $this->apiParas["service"] = $service;
  456. }
  457. public function getService()
  458. {
  459. return $this->service;
  460. }
  461. public function setShid($shid)
  462. {
  463. $this->shid = $shid;
  464. $this->apiParas["shid"] = $shid;
  465. }
  466. public function getShid()
  467. {
  468. return $this->shid;
  469. }
  470. public function setStar($star)
  471. {
  472. $this->star = $star;
  473. $this->apiParas["star"] = $star;
  474. }
  475. public function getStar()
  476. {
  477. return $this->star;
  478. }
  479. public function setStatus($status)
  480. {
  481. $this->status = $status;
  482. $this->apiParas["status"] = $status;
  483. }
  484. public function getStatus()
  485. {
  486. return $this->status;
  487. }
  488. public function setTagJson($tagJson)
  489. {
  490. $this->tagJson = $tagJson;
  491. $this->apiParas["tag_json"] = $tagJson;
  492. }
  493. public function getTagJson()
  494. {
  495. return $this->tagJson;
  496. }
  497. public function setTel($tel)
  498. {
  499. $this->tel = $tel;
  500. $this->apiParas["tel"] = $tel;
  501. }
  502. public function getTel()
  503. {
  504. return $this->tel;
  505. }
  506. public function setUsedName($usedName)
  507. {
  508. $this->usedName = $usedName;
  509. $this->apiParas["used_name"] = $usedName;
  510. }
  511. public function getUsedName()
  512. {
  513. return $this->usedName;
  514. }
  515. public function setVendor($vendor)
  516. {
  517. $this->vendor = $vendor;
  518. $this->apiParas["vendor"] = $vendor;
  519. }
  520. public function getVendor()
  521. {
  522. return $this->vendor;
  523. }
  524. public function getApiMethodName()
  525. {
  526. return "taobao.xhotel.update";
  527. }
  528. public function getApiParas()
  529. {
  530. return $this->apiParas;
  531. }
  532. public function putOtherTextParam($key, $value) {
  533. $this->apiParas[$key] = $value;
  534. $this->$key = $value;
  535. }
  536. }