Cash.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\shop\controller\plus\agent;
  3. use app\shop\controller\Controller;
  4. use app\shop\model\plus\agent\Cash as CashModel;
  5. /**
  6. * 提现申请制器
  7. */
  8. class Cash extends Controller
  9. {
  10. /**
  11. * 提现记录列表
  12. */
  13. public function index($user_id = null, $apply_status = -1, $pay_type = -1, $search = '')
  14. {
  15. $model = new CashModel;
  16. $list = $model->getList($user_id, $apply_status, $pay_type, $search);
  17. return $this->renderSuccess('', compact('list'));
  18. }
  19. /**
  20. * 提现审核
  21. */
  22. public function submit($id)
  23. {
  24. $model = CashModel::detail($id);
  25. if ($model->submit($this->postData())) {
  26. return $this->renderSuccess('操作成功');
  27. }
  28. return $this->renderError($model->getError() ?: '操作失败');
  29. }
  30. /**
  31. * 确认打款
  32. */
  33. public function money($id)
  34. {
  35. $model = CashModel::detail($id);
  36. if ($model->money()) {
  37. return $this->renderSuccess('操作成功');
  38. }
  39. return $this->renderError($model->getError() ?: '操作失败');
  40. }
  41. /**
  42. * 分销商提现:微信支付企业付款
  43. */
  44. public function wechat_pay($id)
  45. {
  46. $model = CashModel::detail($id);
  47. if ($model->wechatPay()) {
  48. return $this->renderSuccess('操作成功');
  49. }
  50. return $this->renderError($model->getError() ?: '操作失败');
  51. }
  52. }