<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Core; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\Response; use Module\Member\Util\MemberMoneyUtil; use Module\Member\Util\MemberUtil; use Module\PayCenter\Biz\AbstractPayCenterBiz; use Module\PayCenter\Type\PayType; use Module\Vendor\Provider\Notifier\NotifierProvider; use Module\Vendor\Type\OrderStatus; class MemberMoneyChargePayCenterBiz extends AbstractPayCenterBiz { const NAME = 'mMemberMoneyCharge'; public function name() { return self::NAME; } public function title() { return '用户钱包充值'; } public function disabledPayTypes() { return array(PayType::MEMBER_MONEY); } public function onPayed($pIZDs, $OUSS0, $w6bW5 = array()) { goto S_IN2; HuPrF: ModelUtil::update('member_money_charge_order', $pIZDs, array('status' => OrderStatus::COMPLETED)); goto SEGb3; QixH6: if ($v9Xk2['status'] !== OrderStatus::WAIT_PAY) { ModelUtil::transactionCommit(); return; } goto HuPrF; SEGb3: MemberMoneyUtil::change($v9Xk2['memberUserId'], $v9Xk2['money'], '钱包充值'); goto fT8CZ; Llw3C: $v9Xk2 = ModelUtil::getWithLock('member_money_charge_order', $pIZDs); goto QixH6; eY7Ye: NotifierProvider::notify('MemberMoneyCharge', '用户钱包充值成功', array('用户ID' => $QqUVI['id'], '用户昵称' => $QqUVI['nickname'], '用户名' => $QqUVI['username'], '充值金额' => $v9Xk2['money'])); goto nT4qK; fT8CZ: ModelUtil::transactionCommit(); goto eGgdC; S_IN2: ModelUtil::transactionBegin(); goto Llw3C; eGgdC: $QqUVI = MemberUtil::get($v9Xk2['memberUserId']); goto eY7Ye; nT4qK: } public function createOrderForQuick($BelaH, $w6bW5 = array()) { goto as3d6; DhisG: BizException::throwsIf('充值金额异常', $k92oI < 0.01 || $k92oI > 1000 * 10000); goto f1D4P; as3d6: BizException::throwsIf('钱包充值未开启', !modstart_config('Member_MoneyChargeEnable', false)); goto uxmjc; AFLkf: BizException::throwsIfEmpty('用户ID为空', $shbIl); goto DhisG; A6Lgm: $k92oI = $BelaH['param']['money']; goto AFLkf; uxmjc: $shbIl = $BelaH['session']['memberUserId']; goto A6Lgm; suMT2: return Response::generateSuccessData(array('bizId' => $v9Xk2['id'], 'feeTotal' => $k92oI, 'body' => '钱包充值', 'param' => array(), 'redirect' => modstart_web_url('member_money'))); goto VQ0tS; f1D4P: $v9Xk2 = ModelUtil::insert('member_money_charge_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $shbIl, 'money' => $k92oI)); goto suMT2; VQ0tS: } }