1
0

PropertyController.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 orderLists()
  51. {
  52. return $this->dataLists(new PropertyOrderLists());
  53. }
  54. /**
  55. * 进出记录列表
  56. * @return \think\response\Json
  57. */
  58. public function surplusLists()
  59. {
  60. return $this->dataLists(new PropertySurplusLogLists());
  61. }
  62. /**
  63. * 分成列表
  64. * @return \think\response\Json
  65. */
  66. public function commissionLists()
  67. {
  68. return $this->dataLists(new PropertyCommissionLists());
  69. }
  70. }