<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Api\Controller; use Illuminate\Routing\Controller; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\InputPackage; use Module\Member\Auth\MemberUser; use Module\Member\Core\MemberMoneyChargePayCenterBiz; use Module\Member\Support\MemberLoginCheck; use Module\PayCenter\Support\PayCenterPerform; use Module\Vendor\Type\OrderStatus; class MemberMoneyChargeController extends Controller implements MemberLoginCheck { public function submit() { goto JVnqU; JVnqU: BizException::throwsIf('钱包充值未开启', !modstart_config('Member_MoneyChargeEnable', false)); goto WzJdP; WzJdP: $Nw6ws = InputPackage::buildFromInput(); goto em5m_; efZim: BizException::throwsIf('金额最少为0.01元', $oLfec < 0.01); goto dRE_D; dRE_D: BizException::throwsIf('金额最大为1,000,000元', $oLfec > 1000000); goto qq88i; CtbBo: return $c_u4c->performSubmitOrder(MemberMoneyChargePayCenterBiz::NAME, $KWG9l['id'], $KWG9l['money'], '钱包充值'); goto Ao69w; UlU2U: $c_u4c = app(PayCenterPerform::class); goto CtbBo; FNyB6: BizException::throwsIf('请安装 PayCenter 模块', !modstart_module_enabled('PayCenter')); goto UlU2U; qq88i: $KWG9l = ModelUtil::insert('member_money_charge_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => MemberUser::id(), 'money' => $oLfec)); goto FNyB6; em5m_: $oLfec = $Nw6ws->getDecimal('money'); goto efZim; Ao69w: } }