<?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($SgTr3, $coASI, $qOrzw = array()) { goto eyR07; rqDh_: ModelUtil::update('member_vip_order', array('id' => $SgTr3), array('status' => OrderStatus::COMPLETED)); goto T85TT; jyKD3: if (ModuleManager::getModuleConfig('Member', 'creditEnable', false)) { $dbXTE = MemberVipUtil::get($HsIf6['vipId']); if ($dbXTE['creditPresentEnable']) { MemberCreditUtil::change($HsIf6['memberUserId'], $dbXTE['creditPresentValue'], '会员VIP赠送积分'); } } goto K6hCt; eyR07: $HsIf6 = ModelUtil::get('member_vip_order', $SgTr3); goto xkyUO; T85TT: $chyCL = array(); goto vvNSz; xkyUO: if (empty($HsIf6)) { return; } goto rqDh_; SRE6N: MemberUtil::update($HsIf6['memberUserId'], $chyCL); goto jyKD3; vvNSz: $chyCL['vipId'] = $HsIf6['vipId']; goto QHVKs; QHVKs: $chyCL['vipExpire'] = $HsIf6['expire']; goto SRE6N; K6hCt: } public function createOrderForQuick($tdo8n, $qOrzw = array()) { goto uj05q; Me4J4: BizException::throwsIfEmpty('用户ID为空', $KJqKC); goto VcJM7; oQdu9: $MgvDM = $z4kS0['data']['price']; goto jDT4z; jDT4z: BizException::throwsIf('订单金额异常', $MgvDM < 0.01 || $MgvDM > 1000 * 10000); goto nSxxA; bv7Zi: $yQVVz = MemberVipUtil::get($JTwKA); goto yMkFU; zErJg: BizException::throwsIfEmpty('会员不存在', $g3uu_); goto J3TWW; hr8Vn: BizException::throwsIf($z4kS0['msg'], $z4kS0['code'] > 0); goto oQdu9; VcJM7: $JTwKA = $tdo8n['param']['vipId']; goto l6YGO; J3TWW: $z4kS0 = MemberVipUtil::calcPrice($g3uu_['vipId'], $g3uu_['vipExpire'], $JTwKA); goto hr8Vn; yMkFU: BizException::throwsIfEmpty('会员类型不存在', $yQVVz); goto Bpeh5; N1Pbj: return Response::generateSuccessData(array('bizId' => $HsIf6['id'], 'feeTotal' => $MgvDM, 'body' => '开通VIP', 'param' => array(), 'redirect' => modstart_web_url('member_vip'))); goto z8X9N; l6YGO: BizException::throwsIfEmpty('请选择会员类型', $JTwKA); goto bv7Zi; nSxxA: $HsIf6 = ModelUtil::insert('member_vip_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $KJqKC, 'vipId' => $yQVVz['id'], 'payFee' => $MgvDM, 'expire' => $z4kS0['data']['expire'], 'type' => $z4kS0['data']['type'])); goto N1Pbj; Bpeh5: $g3uu_ = MemberUtil::get($KJqKC); goto zErJg; uj05q: $KJqKC = $tdo8n['session']['memberUserId']; goto Me4J4; z8X9N: } }