PropertyOrderController.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\property;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\lists\property\PropertyOrderLists;
  17. use app\adminapi\logic\property\PropertyOrderLogic;
  18. use app\adminapi\validate\property\PropertyOrderValidate;
  19. use app\api\validate\ServiceOrderValidate;
  20. /**
  21. * PropertyOrder控制器
  22. * Class PropertyOrderController
  23. * @package app\adminapi\controller
  24. */
  25. class PropertyOrderController extends BaseAdminController
  26. {
  27. public array $notNeedLogin = ['placeOrder'];
  28. /**
  29. * @notes 获取列表
  30. * @return \think\response\Json
  31. * @author likeadmin
  32. * @date 2024/09/19 14:48
  33. */
  34. public function lists()
  35. {
  36. return $this->dataLists(new PropertyOrderLists());
  37. }
  38. /**
  39. * @notes 添加
  40. * @return \think\response\Json
  41. * @author likeadmin
  42. * @date 2024/09/19 14:48
  43. */
  44. public function add()
  45. {
  46. /*$params = (new PropertyOrderValidate())->post()->goCheck('add');
  47. $result = PropertyOrderLogic::add($params);
  48. if (true === $result) {
  49. return $this->success('添加成功', [], 1, 1);
  50. }
  51. return $this->fail(PropertyOrderLogic::getError());*/
  52. return $this->fail('无后台添加');
  53. }
  54. /**
  55. * @notes 编辑
  56. * @return \think\response\Json
  57. * @author likeadmin
  58. * @date 2024/09/19 14:48
  59. */
  60. public function edit()
  61. {
  62. $params = (new PropertyOrderValidate())->post()->goCheck('edit');
  63. $result = PropertyOrderLogic::edit($params);
  64. if (true === $result) {
  65. return $this->success('编辑成功', [], 1, 1);
  66. }
  67. return $this->fail(PropertyOrderLogic::getError());
  68. }
  69. /**
  70. * @notes 删除
  71. * @return \think\response\Json
  72. * @author likeadmin
  73. * @date 2024/09/19 14:48
  74. */
  75. public function delete()
  76. {
  77. $params = (new PropertyOrderValidate())->post()->goCheck('delete');
  78. PropertyOrderLogic::delete($params);
  79. return $this->success('删除成功', [], 1, 1);
  80. }
  81. /**
  82. * @notes 获取详情
  83. * @return \think\response\Json
  84. * @author likeadmin
  85. * @date 2024/09/19 14:48
  86. */
  87. public function detail()
  88. {
  89. $params = (new PropertyOrderValidate())->goCheck('detail');
  90. $result = PropertyOrderLogic::detail($params);
  91. return $this->data($result);
  92. }
  93. /**
  94. * @notes 客服下工单
  95. * @return \think\response\Json
  96. * @author likeadmin
  97. * @date 2024/09/19 14:48
  98. */
  99. public function placeOrder()
  100. {
  101. $serviceOrderParams = (new ServiceOrderValidate())->post()->goCheck('add');
  102. if (empty($serviceOrderParams['id'])){
  103. return $this->fail('物业单id不能为空');
  104. }
  105. $result = PropertyOrderLogic::placeOrder($serviceOrderParams);
  106. if (true === $result) {
  107. return $this->success('客服下单成功', [], 1, 1);
  108. }
  109. return $this->fail(PropertyOrderLogic::getError());
  110. }
  111. /**
  112. * @notes 客服取消订单
  113. * @return \think\response\Json
  114. */
  115. public function cancel()
  116. {
  117. $params = (new PropertyOrderValidate())->post()->goCheck('detail');
  118. $result = PropertyOrderLogic::cancel($params);
  119. if (true === $result) {
  120. return $this->success('取消成功', [], 1, 1);
  121. }
  122. return $this->fail(PropertyOrderLogic::getError());
  123. }
  124. }