PropertyController.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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\logic\ServiceOrderLogic;
  10. use app\api\validate\PropertyValidate;
  11. use app\api\validate\ServiceOrderValidate;
  12. use app\common\model\orders\RechargeOrder;
  13. use think\facade\Log;
  14. /**
  15. * 物业模块类
  16. */
  17. class PropertyController extends BaseApiController
  18. {
  19. public array $notNeedLogin = ['orderByQrcode'];
  20. /**
  21. * @notes 二维码扫码下物业单
  22. * @return \think\response\Json
  23. */
  24. public function orderByQrcode()
  25. {
  26. $params = (new PropertyOrderValidate())->post()->goCheck('add');
  27. $result = PropertyOrderLogic::add($params);
  28. if (true === $result) {
  29. return $this->success('下单成功', [], 1, 1);
  30. }
  31. return $this->fail(PropertyOrderLogic::getError());
  32. }
  33. /**
  34. * 提现申请
  35. * @return \think\response\Json
  36. */
  37. public function withdrawCash()
  38. {
  39. $params = (new PropertyValidate())->post()->goCheck('withdrawCash', [
  40. 'user_id' => $this->userId,
  41. 'user_info' => $this->userInfo
  42. ]);
  43. $result = PropertyCommissionLogic::withdrawCash($params);
  44. if (false === $result) {
  45. return $this->fail(PropertyCommissionLogic::getError());
  46. }
  47. return $this->success('申请成功,等待审核', [], 1, 1);
  48. }
  49. /**
  50. * 物业负责人资金账户信息
  51. * @return \think\response\Json
  52. */
  53. public function assetAccount()
  54. {
  55. $params = [
  56. 'user_id' => $this->userId,
  57. 'user_info' => $this->userInfo
  58. ];
  59. return $this->success('资金账户', PropertyCommissionLogic::assetAccount($params), 1, 1);
  60. }
  61. /**
  62. * 下单列表
  63. * @return \think\response\Json
  64. */
  65. public function orderLists()
  66. {
  67. return $this->dataLists(new PropertyOrderLists());
  68. }
  69. /**
  70. * 进出记录列表
  71. * @return \think\response\Json
  72. */
  73. public function surplusLists()
  74. {
  75. return $this->dataLists(new PropertySurplusLogLists());
  76. }
  77. /**
  78. * 分成列表
  79. * @return \think\response\Json
  80. */
  81. public function commissionLists()
  82. {
  83. return $this->dataLists(new PropertyCommissionLists());
  84. }
  85. /**
  86. * 订单支付详情
  87. * @return \think\response\Json
  88. */
  89. public function commissionOrderDetail()
  90. {
  91. $params = (new ServiceOrderValidate())->goCheck('detail');
  92. //获取订单用户信息
  93. $params['user_id'] = RechargeOrder::where('sn',$params['sn'])->value('user_id');
  94. $result = ServiceOrderLogic::orderPayInfo($params);
  95. if (false === $result) {
  96. return $this->fail(ServiceOrderLogic::getError());
  97. }
  98. return $this->data($result);
  99. }
  100. }