PropertyOrderController.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. }
  53. /**
  54. * @notes 编辑
  55. * @return \think\response\Json
  56. * @author likeadmin
  57. * @date 2024/09/19 14:48
  58. */
  59. public function edit()
  60. {
  61. $params = (new PropertyOrderValidate())->post()->goCheck('edit');
  62. $result = PropertyOrderLogic::edit($params);
  63. if (true === $result) {
  64. return $this->success('编辑成功', [], 1, 1);
  65. }
  66. return $this->fail(PropertyOrderLogic::getError());
  67. }
  68. /**
  69. * @notes 删除
  70. * @return \think\response\Json
  71. * @author likeadmin
  72. * @date 2024/09/19 14:48
  73. */
  74. public function delete()
  75. {
  76. $params = (new PropertyOrderValidate())->post()->goCheck('delete');
  77. PropertyOrderLogic::delete($params);
  78. return $this->success('删除成功', [], 1, 1);
  79. }
  80. /**
  81. * @notes 获取详情
  82. * @return \think\response\Json
  83. * @author likeadmin
  84. * @date 2024/09/19 14:48
  85. */
  86. public function detail()
  87. {
  88. $params = (new PropertyOrderValidate())->goCheck('detail');
  89. $result = PropertyOrderLogic::detail($params);
  90. return $this->data($result);
  91. }
  92. /**
  93. * @notes 客服下工单
  94. * @return \think\response\Json
  95. * @author likeadmin
  96. * @date 2024/09/19 14:48
  97. */
  98. public function placeOrder()
  99. {
  100. $serviceOrderParams = (new ServiceOrderValidate())->post()->goCheck('add');
  101. if (empty($serviceOrderParams['id'])){
  102. return $this->fail('物业单id不能为空');
  103. }
  104. $result = PropertyOrderLogic::placeOrder($serviceOrderParams);
  105. if (true === $result) {
  106. return $this->success('客服下单成功', [], 1, 1);
  107. }
  108. return $this->fail(PropertyOrderLogic::getError());
  109. }
  110. }