ApiPayment.Class.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * 支付方式
  4. * Created by PhpStorm.
  5. * User: XiaoMing
  6. * Date: 2019/12/4
  7. * Time: 15:17
  8. */
  9. namespace JinDouYun\Controller\System;
  10. use JinDouYun\Controller\BaseController;
  11. use Mall\Framework\Core\ErrorCode;
  12. use JinDouYun\Model\System\MEnterpriseBindPayment;
  13. class ApiPayment extends BaseController
  14. {
  15. private $objMEnterpriseBindPayment;
  16. /**
  17. * TemplateModule constructor.
  18. * @param bool $isCheckAcl
  19. * @param bool $isMustLogin
  20. */
  21. public function __construct($isCheckAcl = false, $isMustLogin = true)
  22. {
  23. parent::__construct($isCheckAcl, $isMustLogin);
  24. $this->objMEnterpriseBindPayment = new MEnterpriseBindPayment($this->onlineUserId, $this->onlineEnterpriseId);
  25. }
  26. /**
  27. * 获取企业配置的支付方式
  28. * @throws \Exception
  29. */
  30. public function getPaymentType()
  31. {
  32. $params = $this->request->getRawJson();
  33. $paramsData = [
  34. 'price' => isset($params['price']) ? $params['price'] : 0,//订单提交金额 银行打款的值
  35. ];
  36. $dbResult = $this->objMEnterpriseBindPayment->getPaymentType($paramsData);
  37. if ($dbResult->isSuccess()) {
  38. parent::sendOutput($dbResult->getData(), 0);
  39. }
  40. parent::sendOutput($dbResult->getData(), ErrorCode::$dberror);
  41. }
  42. }