酒店预订平台
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.
 
 
 
 
 
 

87 lines
2.2 KiB

  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\model\Area;
  4. use app\admin\service\CfHotelInfoService;
  5. use app\common\controller\Backend;
  6. use think\Db;
  7. use think\exception\PDOException;
  8. use think\exception\ValidateException;
  9. /**
  10. * 配置-酒店详情
  11. *
  12. * @icon fa fa-circle-o
  13. */
  14. class CfHotelInfo extends Backend
  15. {
  16. /**
  17. * CfHotelInfo模型对象
  18. * @var \app\admin\model\CfHotelInfo
  19. */
  20. protected $model = null;
  21. public function _initialize()
  22. {
  23. parent::_initialize();
  24. $this->model = new \app\admin\model\CfHotelInfo;
  25. }
  26. public function import()
  27. {
  28. parent::import();
  29. }
  30. /**
  31. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  32. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  33. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  34. */
  35. public function getHotelList(){
  36. $name=$this->request->post('name');
  37. $keyValue=$this->request->post('keyValue');
  38. $result= $this->model->getList($name,$keyValue);
  39. if($keyValue){
  40. return json(['list' => $result]);
  41. }
  42. return json(['list' => $result]);
  43. }
  44. /****=========================================**/
  45. /**
  46. * 获取列表
  47. * @return \think\response\Json
  48. */
  49. public function getList(){
  50. $params=$this->request->post();
  51. $service = new CfHotelInfoService();
  52. return json($service->getList($params));
  53. }
  54. /**
  55. * 保存记录
  56. * @return \think\response\Json
  57. */
  58. public function save(){
  59. $params=$this->request->post();
  60. $params['create_id']=$this->auth->id;
  61. $params['group_id']=$this->auth->getGroupId();
  62. $service = new CfHotelInfoService();
  63. return json($service->save($params));
  64. }
  65. /**
  66. * 删除
  67. * @return \think\response\Json
  68. */
  69. public function delAll(){
  70. $params=$this->request->post();
  71. $service = new CfHotelInfoService();
  72. return json($service->del($params));
  73. }
  74. }