Withdraw.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\controller\apps\dealer;
  10. use app\store\controller\Controller;
  11. use app\store\model\dealer\Withdraw as WithdrawModel;
  12. /**
  13. * 分销商提现申请
  14. * Class Setting
  15. * @package app\store\controller\apps\dealer
  16. */
  17. class Withdraw extends Controller
  18. {
  19. /**
  20. * 提现记录列表
  21. * @param int $user_id
  22. * @param int $apply_status
  23. * @param int $pay_type
  24. * @param string $search
  25. * @return mixed
  26. * @throws \think\exception\DbException
  27. */
  28. public function index($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
  29. {
  30. $model = new WithdrawModel;
  31. return $this->fetch('index', [
  32. 'list' => $model->getList($user_id, $apply_status, $pay_type, $search)
  33. ]);
  34. }
  35. /**
  36. * 提现审核
  37. * @param $id
  38. * @return array
  39. * @throws \app\common\exception\BaseException
  40. * @throws \think\exception\DbException
  41. */
  42. public function submit($id)
  43. {
  44. $model = WithdrawModel::detail($id);
  45. if ($model->submit($this->postData('withdraw'))) {
  46. return $this->renderSuccess('操作成功');
  47. }
  48. return $this->renderError($model->getError() ?: '操作失败');
  49. }
  50. /**
  51. * 确认打款
  52. * @param $id
  53. * @return array
  54. * @throws \think\exception\DbException
  55. */
  56. public function money($id)
  57. {
  58. $model = WithdrawModel::detail($id);
  59. if ($model->money()) {
  60. return $this->renderSuccess('操作成功');
  61. }
  62. return $this->renderError($model->getError() ?: '操作失败');
  63. }
  64. /**
  65. * 分销商提现:微信支付企业付款
  66. * @param $id
  67. * @return array|bool
  68. * @throws \app\common\exception\BaseException
  69. * @throws \think\exception\DbException
  70. */
  71. public function wechat_pay($id)
  72. {
  73. $model = WithdrawModel::detail($id);
  74. if ($model->wechatPay()) {
  75. return $this->renderSuccess('操作成功');
  76. }
  77. return $this->renderError($model->getError() ?: '操作失败');
  78. }
  79. }