IsHwu.php 808 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * H5支付控制器
  4. *
  5. */
  6. namespace app\api\controller\v1;
  7. use app\api\controller\Api;
  8. use app\common\model\Setting;
  9. use think\Config;
  10. class IsHwu extends Api {
  11. public function _initialize()
  12. {
  13. parent::_initialize();
  14. }
  15. /**
  16. * 是否有开启h5支付
  17. */
  18. public function index()
  19. {
  20. $settingModel = new Setting;
  21. //有开启h5支付时,返回微信支付的referer
  22. if($settingModel::getSetting('IS_H5_PAY')==1){
  23. $this->jsonResult(['isEnable' => (int)$settingModel::getSetting('IS_H5_PAY'),'enable'=>Config::get('wxpay-h5')['referer']], 1);
  24. }
  25. else{
  26. $this->jsonResult(['isEnable' => (int)$settingModel::getSetting('IS_H5_PAY')], 1);
  27. }
  28. }
  29. }