1
0

PropertyOrderController.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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\PropertyOrderAnalysis;
  17. use app\adminapi\lists\property\PropertyOrderLists;
  18. use app\adminapi\logic\property\PropertyOrderLogic;
  19. use app\adminapi\validate\property\PropertyOrderValidate;
  20. use app\api\validate\ServiceOrderValidate;
  21. /**
  22. * PropertyOrder控制器
  23. * Class PropertyOrderController
  24. * @package app\adminapi\controller
  25. */
  26. class PropertyOrderController extends BaseAdminController
  27. {
  28. public array $notNeedLogin = ['placeOrder'];
  29. /**
  30. * @notes 获取列表
  31. * @return \think\response\Json
  32. * @author likeadmin
  33. * @date 2024/09/19 14:48
  34. */
  35. public function lists()
  36. {
  37. return $this->dataLists(new PropertyOrderLists());
  38. }
  39. /**
  40. * @notes 添加
  41. * @return \think\response\Json
  42. * @author likeadmin
  43. * @date 2024/09/19 14:48
  44. */
  45. public function add()
  46. {
  47. /*$params = (new PropertyOrderValidate())->post()->goCheck('add');
  48. $result = PropertyOrderLogic::add($params);
  49. if (true === $result) {
  50. return $this->success('添加成功', [], 1, 1);
  51. }
  52. return $this->fail(PropertyOrderLogic::getError());*/
  53. return $this->fail('无后台添加');
  54. }
  55. /**
  56. * @notes 编辑
  57. * @return \think\response\Json
  58. * @author likeadmin
  59. * @date 2024/09/19 14:48
  60. */
  61. public function edit()
  62. {
  63. $params = (new PropertyOrderValidate())->post()->goCheck('edit');
  64. $result = PropertyOrderLogic::edit($params);
  65. if (true === $result) {
  66. return $this->success('编辑成功', [], 1, 1);
  67. }
  68. return $this->fail(PropertyOrderLogic::getError());
  69. }
  70. /**
  71. * @notes 删除
  72. * @return \think\response\Json
  73. * @author likeadmin
  74. * @date 2024/09/19 14:48
  75. */
  76. public function delete()
  77. {
  78. $params = (new PropertyOrderValidate())->post()->goCheck('delete');
  79. PropertyOrderLogic::delete($params);
  80. return $this->success('删除成功', [], 1, 1);
  81. }
  82. /**
  83. * @notes 获取详情
  84. * @return \think\response\Json
  85. * @author likeadmin
  86. * @date 2024/09/19 14:48
  87. */
  88. public function detail()
  89. {
  90. $params = (new PropertyOrderValidate())->goCheck('detail');
  91. $result = PropertyOrderLogic::detail($params);
  92. return $this->data($result);
  93. }
  94. /**
  95. * @notes 客服下工单
  96. * @return \think\response\Json
  97. * @author likeadmin
  98. * @date 2024/09/19 14:48
  99. */
  100. public function placeOrder()
  101. {
  102. $serviceOrderParams = (new ServiceOrderValidate())->post()->goCheck('add');
  103. if (empty($serviceOrderParams['id'])){
  104. return $this->fail('物业单id不能为空');
  105. }
  106. $result = PropertyOrderLogic::placeOrder($serviceOrderParams);
  107. if (true === $result) {
  108. return $this->success('客服下单成功', [], 1, 1);
  109. }
  110. return $this->fail(PropertyOrderLogic::getError());
  111. }
  112. /**
  113. * @notes 客服取消订单
  114. * @return \think\response\Json
  115. */
  116. public function cancel()
  117. {
  118. $params = (new PropertyOrderValidate())->post()->goCheck('detail');
  119. $result = PropertyOrderLogic::cancel($params);
  120. if (true === $result) {
  121. return $this->success('取消成功', [], 1, 1);
  122. }
  123. return $this->fail(PropertyOrderLogic::getError());
  124. }
  125. /**
  126. * @notes 物业订单数据分析
  127. * @return \think\response\Json
  128. */
  129. public function propertyOrderAnalysis()
  130. {
  131. return $this->dataLists(new PropertyOrderAnalysis());
  132. }
  133. public function addCustomerLog()
  134. {
  135. $params = (new PropertyOrderValidate())->post()->goCheck('detail',[
  136. 'admin_id' => $this->adminId,
  137. ]);
  138. $result = PropertyOrderLogic::addCustomerLog($params);
  139. if (true === $result) {
  140. return $this->success('操作成功!', [], 1, 1);
  141. }
  142. return $this->fail(PropertyOrderLogic::getError());
  143. }
  144. }