UserBank.php 850 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\shopro\controller;
  3. class UserBank extends Base
  4. {
  5. protected $noNeedLogin = [];
  6. protected $noNeedRight = ['*'];
  7. // 获取提现账户信息
  8. public function info()
  9. {
  10. $type = $this->request->get('type');
  11. try {
  12. $bankInfo = \addons\shopro\model\UserBank::info($type);
  13. } catch (\Exception $e) {
  14. $this->error($e->getMessage());
  15. }
  16. $this->success('提现账户', $bankInfo);
  17. }
  18. public function edit()
  19. {
  20. $params = $this->request->post();
  21. if ($params['type'] === 'alipay') {
  22. $params['bank_name'] = '支付宝账户';
  23. }
  24. // 表单验证
  25. $this->shoproValidate($params, get_class(), 'edit');
  26. $this->success('编辑成功', \addons\shopro\model\UserBank::edit($params));
  27. }
  28. }