<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Core; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\Response; use ModStart\Module\ModuleManager; use Module\Member\Events\MemberUserVipChangeEvent; 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($pIZDs, $OUSS0, $w6bW5 = array()) { goto HZK1c; Ug0KK: if (empty($QqUVI)) { return; } goto Fps6y; NgiLE: ModelUtil::update('member_vip_order', array('id' => $pIZDs), array('status' => OrderStatus::COMPLETED)); goto IjS2z; sp1Gb: if ($Gszjy['vipId'] != $QqUVI['vipId']) { MemberUserVipChangeEvent::fire($v9Xk2['memberUserId'], $QqUVI['vipId'], $Gszjy['vipId']); } goto LHomk; tbxqW: MemberUtil::update($v9Xk2['memberUserId'], $Gszjy); goto JbzGi; IjS2z: $QqUVI = MemberUtil::get($v9Xk2['memberUserId']); goto Ug0KK; JbzGi: if (ModuleManager::getModuleConfig('Member', 'creditEnable', false)) { $xuXAi = MemberVipUtil::get($v9Xk2['vipId']); if ($xuXAi['creditPresentEnable']) { MemberCreditUtil::change($v9Xk2['memberUserId'], $xuXAi['creditPresentValue'], '会员VIP赠送积分'); } } goto sp1Gb; iuPl3: if (empty($v9Xk2)) { return; } goto NgiLE; diaag: $Gszjy['vipId'] = $v9Xk2['vipId']; goto vGpRl; Fps6y: $Gszjy = array(); goto diaag; HZK1c: $v9Xk2 = ModelUtil::get('member_vip_order', $pIZDs); goto iuPl3; vGpRl: $Gszjy['vipExpire'] = $v9Xk2['expire']; goto tbxqW; LHomk: } public function createOrderForQuick($BelaH, $w6bW5 = array()) { goto lL9uc; KGM5F: BizException::throwsIfEmpty('会员不存在', $QqUVI); goto Qzv8w; byP7J: $v9Xk2 = ModelUtil::insert('member_vip_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $shbIl, 'vipId' => $VMzwF['id'], 'payFee' => $k92oI, 'expire' => $bdjvn['data']['expire'], 'type' => $bdjvn['data']['type'])); goto cP27x; V7qYM: BizException::throwsIfEmpty('会员类型不存在', $VMzwF); goto GAkqP; HPHnq: BizException::throwsIfEmpty('请选择会员类型', $n2ZWE); goto SvZMP; cP27x: return Response::generateSuccessData(array('bizId' => $v9Xk2['id'], 'feeTotal' => $k92oI, 'body' => '开通VIP', 'param' => array(), 'redirect' => modstart_web_url('member_vip'))); goto Rp29X; tDiQk: $n2ZWE = $BelaH['param']['vipId']; goto HPHnq; HwMiI: BizException::throwsIf($bdjvn['msg'], $bdjvn['code'] > 0); goto GFVkt; lL9uc: $shbIl = $BelaH['session']['memberUserId']; goto qsg9F; En3UX: BizException::throwsIf('订单金额异常', $k92oI < 0.01 || $k92oI > 1000 * 10000); goto byP7J; GAkqP: $QqUVI = MemberUtil::get($shbIl); goto KGM5F; Qzv8w: $bdjvn = MemberVipUtil::calcPrice($QqUVI['vipId'], $QqUVI['vipExpire'], $n2ZWE); goto HwMiI; SvZMP: $VMzwF = MemberVipUtil::get($n2ZWE); goto V7qYM; qsg9F: BizException::throwsIfEmpty('用户ID为空', $shbIl); goto tDiQk; GFVkt: $k92oI = $bdjvn['data']['price']; goto En3UX; Rp29X: } }