WithdrawController.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LikeShop有特色的全开源社交分销电商系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 商业用途务必购买系统授权,以免引起不必要的法律纠纷
  7. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  8. // | 微信公众号:好象科技
  9. // | 访问官网:http://www.likemarket.net
  10. // | 访问社区:http://bbs.likemarket.net
  11. // | 访问手册:http://doc.likemarket.net
  12. // | 好象科技开发团队 版权所有 拥有最终解释权
  13. // +----------------------------------------------------------------------
  14. // | Author: LikeShopTeam
  15. // +----------------------------------------------------------------------
  16. namespace app\shopapi\controller;
  17. use app\shopapi\logic\WithdrawLogic;
  18. use app\shopapi\validate\WithdrawValidate;
  19. /**
  20. * 提现控制器
  21. * Class WithdrawController
  22. * @package app\shopapi\controller
  23. */
  24. class WithdrawController extends BaseShopController
  25. {
  26. /**
  27. * @notes 获取提现配置
  28. * @return \think\response\Json
  29. * @author Tab
  30. * @date 2021/8/6 16:31
  31. */
  32. public function getConfig()
  33. {
  34. $result = WithdrawLogic::getConfig($this->userId,$this->userInfo['terminal']);
  35. return $this->data($result);
  36. }
  37. /**
  38. * @notes 提现申请
  39. * @return \think\response\Json
  40. * @author Tab
  41. * @date 2021/8/6 17:28
  42. */
  43. public function apply()
  44. {
  45. $params = (new WithdrawValidate())->post()->goCheck('apply', ['user_id' => $this->userId]);
  46. $params['user_id'] = $this->userId;
  47. $result = WithdrawLogic::apply($params);
  48. if($result !== false) {
  49. return $this->success('提现申请成功', ['id' => $result]);
  50. }
  51. return $this->fail(WithdrawLogic::getError());
  52. }
  53. /**
  54. * @notes 查看提现申请列表
  55. * @return \think\response\Json
  56. * @author Tab
  57. * @date 2021/8/6 18:42
  58. */
  59. public function lists()
  60. {
  61. return $this->dataLists();
  62. }
  63. /**
  64. * @notes 查看提现申请详情
  65. * @return \think\response\Json
  66. * @author Tab
  67. * @date 2021/8/6 19:03
  68. */
  69. public function detail()
  70. {
  71. $params = (new WithdrawValidate())->goCheck('detail');
  72. $result = WithdrawLogic::detail($params);
  73. return $this->data($result);
  74. }
  75. }