PayController.php 941 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. *
  5. * User: king/QQ:995265288
  6. * Date: 2018/6/12 下午4:30
  7. * Email: livsyitian@163.com
  8. */
  9. namespace app\backend\modules\withdraw\controllers;
  10. use app\backend\models\Withdraw;
  11. use app\common\exceptions\ShopException;
  12. use app\common\services\withdraw\PayedService;
  13. class PayController extends PreController
  14. {
  15. /**
  16. * 提现记录打款接口
  17. */
  18. public function index()
  19. {
  20. \Log::debug('提现记录打款接口++++++++++++++++++++');
  21. $result = (new PayedService($this->withdrawModel))->withdrawPay();
  22. return $result == true ? $this->successJson('打款成功') : $this->errorJson('打款失败,请刷新重试');
  23. }
  24. public function validatorWithdrawModel($withdrawModel)
  25. {
  26. if ($withdrawModel->status != Withdraw::STATUS_AUDIT) {
  27. throw new ShopException('状态错误,不符合打款规则!');
  28. }
  29. }
  30. }