<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Core; use Illuminate\Support\Facades\Log; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\Response; use ModStart\Module\ModuleManager; use Module\Member\Api\Controller\MemberVipController; use Module\Member\Util\MemberCreditUtil; use Module\Member\Util\MemberUtil; use Module\Member\Util\MemberVipUtil; use Module\PayCenter\Biz\AbstractPayCenterBiz; use Module\Vendor\Type\OrderStatus; class MemberVipPayCenterBiz extends AbstractPayCenterBiz { const NAME = 'mMemberVip'; public function name() { return self::NAME; } public function title() { return '会员VIP'; } public function onPayed($XAAs3, $cThPi, $EPwwc = array()) { goto uZDFV; nAgkr: MemberUtil::update($KWG9l['memberUserId'], $EUGER); goto p6DPD; zi2vK: ModelUtil::update('member_vip_order', array('id' => $XAAs3), array('status' => OrderStatus::COMPLETED)); goto NynBk; lVyJ0: if (empty($KWG9l)) { return; } goto zi2vK; Mj4hd: $EUGER['vipExpire'] = $KWG9l['expire']; goto nAgkr; p6DPD: if (ModuleManager::getModuleConfig('Member', 'creditEnable', false)) { $Gx25f = MemberVipUtil::get($KWG9l['vipId']); if ($Gx25f['creditPresentEnable']) { MemberCreditUtil::change($KWG9l['memberUserId'], $Gx25f['creditPresentValue'], '会员VIP赠送积分'); } } goto HPb3l; CNvgh: $EUGER['vipId'] = $KWG9l['vipId']; goto Mj4hd; uZDFV: $KWG9l = ModelUtil::get('member_vip_order', $XAAs3); goto lVyJ0; NynBk: $EUGER = array(); goto CNvgh; HPb3l: } public function createOrderForQuick($BnixC, $EPwwc = array()) { goto JuHga; VoR8h: BizException::throwsIf('订单金额异常', $oLfec < 0.01 || $oLfec > 1000 * 10000); goto FOTPh; Zwc2F: $IjI3r = MemberVipUtil::get($AkQUn); goto mLCEw; CVQTo: $AkQUn = $BnixC['param']['vipId']; goto KJF49; RCu_O: BizException::throwsIf($wYwbH['msg'], $wYwbH['code'] > 0); goto iqX9C; JuHga: $d4RRw = $BnixC['session']['memberUserId']; goto Ee9qd; Ee9qd: BizException::throwsIfEmpty('用户ID为空', $d4RRw); goto CVQTo; SbTiX: $J09PA = MemberUtil::get($d4RRw); goto rGqZp; VFeZq: return Response::generateSuccessData(array('bizId' => $KWG9l['id'], 'feeTotal' => $oLfec, 'body' => '开通VIP', 'param' => array(), 'redirect' => modstart_web_url('member_vip'))); goto t3w7S; KJF49: BizException::throwsIfEmpty('请选择会员类型', $AkQUn); goto Zwc2F; iqX9C: $oLfec = $wYwbH['data']['price']; goto VoR8h; mLCEw: BizException::throwsIfEmpty('会员类型不存在', $IjI3r); goto SbTiX; rGqZp: BizException::throwsIfEmpty('会员不存在', $J09PA); goto M1AMV; M1AMV: $wYwbH = MemberVipUtil::calcPrice($J09PA['vipId'], $J09PA['vipExpire'], $AkQUn); goto RCu_O; FOTPh: $KWG9l = ModelUtil::insert('member_vip_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $d4RRw, 'vipId' => $IjI3r['id'], 'payFee' => $oLfec, 'expire' => $wYwbH['data']['expire'], 'type' => $wYwbH['data']['type'])); goto VFeZq; t3w7S: } }