1
0

PropertyController.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace app\api\controller;
  3. use app\adminapi\validate\property\PropertyOrderValidate;
  4. use app\api\lists\property\PropertyCommissionLists;
  5. use app\api\lists\property\PropertyOrderLists;
  6. use app\api\lists\property\PropertySurplusLogLists;
  7. use app\api\logic\PropertyCommissionLogic;
  8. use app\api\logic\PropertyOrderLogic;
  9. use app\api\validate\PropertyValidate;
  10. use think\facade\Log;
  11. /**
  12. * 物业模块类
  13. */
  14. class PropertyController extends BaseApiController
  15. {
  16. public array $notNeedLogin = ['orderByQrcode'];
  17. /**
  18. * @notes 二维码扫码下物业单
  19. * @return \think\response\Json
  20. */
  21. public function orderByQrcode()
  22. {
  23. $params = (new PropertyOrderValidate())->post()->goCheck('add');
  24. $result = PropertyOrderLogic::add($params);
  25. if (true === $result) {
  26. return $this->success('下单成功', [], 1, 1);
  27. }
  28. return $this->fail(PropertyOrderLogic::getError());
  29. }
  30. /**
  31. * 提现申请
  32. * @return \think\response\Json
  33. */
  34. public function withdrawCash()
  35. {
  36. $params = (new PropertyValidate())->post()->goCheck('withdrawCash', [
  37. 'user_id' => $this->userId,
  38. 'user_info' => $this->userInfo
  39. ]);
  40. $result = PropertyCommissionLogic::withdrawCash($params);
  41. if (false === $result) {
  42. return $this->fail(PropertyCommissionLogic::getError());
  43. }
  44. return $this->success('申请成功,等待审核', [], 1, 1);
  45. }
  46. /**
  47. * 物业负责人资金账户信息
  48. * @return \think\response\Json
  49. */
  50. public function assetAccount()
  51. {
  52. $params = [
  53. 'user_id' => $this->userId,
  54. 'user_info' => $this->userInfo
  55. ];
  56. return $this->success('资金账户', PropertyCommissionLogic::assetAccount($params), 1, 1);
  57. }
  58. /**
  59. * 下单列表
  60. * @return \think\response\Json
  61. */
  62. public function orderLists()
  63. {
  64. return $this->dataLists(new PropertyOrderLists());
  65. }
  66. /**
  67. * 进出记录列表
  68. * @return \think\response\Json
  69. */
  70. public function surplusLists()
  71. {
  72. return $this->dataLists(new PropertySurplusLogLists());
  73. }
  74. /**
  75. * 分成列表
  76. * @return \think\response\Json
  77. */
  78. public function commissionLists()
  79. {
  80. return $this->dataLists(new PropertyCommissionLists());
  81. }
  82. }