<?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($th9v_, $HiQpd, $uxJUJ = array()) { goto sqcM1; iyzHT: $jNwg7['vipId'] = $toXYt['vipId']; goto o9OeS; NsxHw: if (empty($toXYt)) { return; } goto QkmyT; o9OeS: $jNwg7['vipExpire'] = $toXYt['expire']; goto ibuDr; sqcM1: $toXYt = ModelUtil::get('member_vip_order', $th9v_); goto NsxHw; QkmyT: ModelUtil::update('member_vip_order', array('id' => $th9v_), array('status' => OrderStatus::COMPLETED)); goto nbXYN; nbXYN: $jNwg7 = array(); goto iyzHT; ibuDr: MemberUtil::update($toXYt['memberUserId'], $jNwg7); goto Kyg17; Kyg17: if (ModuleManager::getModuleConfig('Member', 'creditEnable', false)) { $Krk3u = MemberVipUtil::get($toXYt['vipId']); if ($Krk3u['creditPresentEnable']) { MemberCreditUtil::change($toXYt['memberUserId'], $Krk3u['creditPresentValue'], '会员VIP赠送积分'); } } goto zfTky; zfTky: } public function createOrderForQuick($W6GSj, $uxJUJ = array()) { goto Fy7BV; P_0SU: $LKZdd = $zqE6E['data']['price']; goto OrSe9; SlHA2: $W6FTy = MemberVipUtil::get($Ds6bM); goto zmrUp; zmrUp: BizException::throwsIfEmpty('会员类型不存在', $W6FTy); goto NALY_; BSEiu: BizException::throwsIf($zqE6E['msg'], $zqE6E['code'] > 0); goto P_0SU; NALY_: $KAIwS = MemberUtil::get($nlOSA); goto tsaA4; EXmET: $zqE6E = MemberVipUtil::calcPrice($KAIwS['vipId'], $KAIwS['vipExpire'], $Ds6bM); goto BSEiu; Fy7BV: $nlOSA = $W6GSj['session']['memberUserId']; goto Sp2XO; HeYBG: BizException::throwsIfEmpty('请选择会员类型', $Ds6bM); goto SlHA2; l44eg: $toXYt = ModelUtil::insert('member_vip_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $nlOSA, 'vipId' => $W6FTy['id'], 'payFee' => $LKZdd, 'expire' => $zqE6E['data']['expire'], 'type' => $zqE6E['data']['type'])); goto pmpav; Jfh2R: $Ds6bM = $W6GSj['param']['vipId']; goto HeYBG; pmpav: return Response::generateSuccessData(array('bizId' => $toXYt['id'], 'feeTotal' => $LKZdd, 'body' => '开通VIP', 'param' => array(), 'redirect' => modstart_web_url('member_vip'))); goto goLc0; Sp2XO: BizException::throwsIfEmpty('用户ID为空', $nlOSA); goto Jfh2R; OrSe9: BizException::throwsIf('订单金额异常', $LKZdd < 0.01 || $LKZdd > 1000 * 10000); goto l44eg; tsaA4: BizException::throwsIfEmpty('会员不存在', $KAIwS); goto EXmET; goLc0: } }