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

120 lines
2.9 KiB

  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\service\PaymentOrderService;
  4. use app\common\controller\Backend;
  5. /**
  6. * 付款账单管理
  7. *
  8. * @icon fa fa-circle-o
  9. */
  10. class PaymentOrder extends Backend
  11. {
  12. /**
  13. * PaymentOrder模型对象
  14. * @var \app\admin\model\PaymentOrder
  15. */
  16. protected $model = null;
  17. public function _initialize()
  18. {
  19. parent::_initialize();
  20. $this->model = new \app\admin\model\PaymentOrder;
  21. }
  22. public function import()
  23. {
  24. parent::import();
  25. }
  26. /**
  27. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  28. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  29. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  30. */
  31. /**
  32. * 保存记录
  33. * @return \think\response\Json
  34. */
  35. public function save(){
  36. $params=$this->request->post();
  37. $params['create_id']=$this->auth->id;
  38. $params['group_id']=$this->auth->getGroupId();
  39. $service = new PaymentOrderService();
  40. $result = $service->save($params);
  41. return json($result);
  42. }
  43. /**
  44. * 获取列表
  45. * @return \think\response\Json
  46. */
  47. public function getList(){
  48. $params=$this->request->post();
  49. $service = new PaymentOrderService();
  50. $result = $service->getList($params);
  51. return json($result);
  52. }
  53. /**
  54. * 状态设置
  55. * @return \think\response\Json
  56. */
  57. public function setStatus(){
  58. $params=$this->request->post();
  59. $service = new PaymentOrderService();
  60. $result = $service->setStatus($params['id'],$params['status']);
  61. return json($result);
  62. }
  63. /**
  64. * 添加到收款单
  65. * @return \think\response\Json
  66. */
  67. public function addOrderMain(){
  68. $params=$this->request->post();
  69. $service = new PaymentOrderService();
  70. $result = $service->addSubOrder($params);
  71. return json($result);
  72. }
  73. /**
  74. * 移除收购单
  75. * @return \think\response\Json
  76. */
  77. public function removeOrderMain(){
  78. $params=$this->request->post();
  79. $service = new PaymentOrderService();
  80. $result = $service->removeSubOrder($params);
  81. return json($result);
  82. }
  83. /**
  84. * 获取订单列表
  85. * @return \think\response\Json
  86. */
  87. public function getSubOrderList(){
  88. $params=$this->request->post();
  89. $service = new PaymentOrderService();
  90. $result = $service->getSubOrderList($params);
  91. return json($result);
  92. }
  93. /**
  94. * 删除收款单
  95. */
  96. public function delAll(){
  97. $params=$this->request->post();
  98. $service = new PaymentOrderService();
  99. $result = $service->delAll($params['id']);
  100. return json($result);
  101. }
  102. }