<?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\PayCenter\Biz\AbstractPayCenterBiz; use Module\PayCenter\Type\PayType; 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($th9v_, $HiQpd, $uxJUJ = array()) { goto Mniek; maPfO: if ($toXYt['status'] !== OrderStatus::WAIT_PAY) { return; } goto yKV9v; Gpvd0: MemberMoneyUtil::change($toXYt['memberUserId'], $toXYt['money'], '钱包充值'); goto MDMfE; yKV9v: ModelUtil::update('member_money_charge_order', $th9v_, array('status' => OrderStatus::COMPLETED)); goto Gpvd0; Mniek: $toXYt = ModelUtil::get('member_money_charge_order', $th9v_); goto maPfO; MDMfE: } public function createOrderForQuick($W6GSj, $uxJUJ = array()) { goto BCoFu; SUBkd: $nlOSA = $W6GSj['session']['memberUserId']; goto sDX9j; BCoFu: BizException::throwsIf('钱包充值未开启', !modstart_config('Member_MoneyChargeEnable', false)); goto SUBkd; oR1_y: BizException::throwsIfEmpty('用户ID为空', $nlOSA); goto Rwo35; Rwo35: BizException::throwsIf('充值金额异常', $LKZdd < 0.01 || $LKZdd > 1000 * 10000); goto rDGni; sDX9j: $LKZdd = $W6GSj['param']['money']; goto oR1_y; rDGni: $toXYt = ModelUtil::insert('member_money_charge_order', array('status' => OrderStatus::WAIT_PAY, 'memberUserId' => $nlOSA, 'money' => $LKZdd)); goto vg5_y; vg5_y: return Response::generateSuccessData(array('bizId' => $toXYt['id'], 'feeTotal' => $LKZdd, 'body' => '钱包充值', 'param' => array(), 'redirect' => modstart_web_url('member_money'))); goto F09_C; F09_C: } }