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

126 lines
3.4 KiB

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