<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Res\Core; use Carbon\Carbon; use Illuminate\Support\Facades\Log; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\Response; use Module\PayCenter\Biz\AbstractPayCenterBiz; use Module\Res\AssetAccess\AssetAccess; use Module\Res\AssetAccess\Type\AccessCreateFrom; use Module\Res\Util\ResAssetUtil; use Module\Res\Util\ResRewardUtil; use Module\Vendor\Type\OrderStatus; class ResPayCenterBiz extends AbstractPayCenterBiz { const NAME = 'res'; public function name() { return self::NAME; } public function title() { return '资源购买'; } public function onPayed($vfjVR, $HsIf6, $qOrzw = array()) { goto GYLvm; FU_L0: $zk4Tz = ModelUtil::get('res_asset', $HsIf6['assetId']); goto rDtBa; zS_zm: ModelUtil::update('res_asset_buy_order', $HsIf6['id'], array('status' => OrderStatus::COMPLETED, 'payTime' => Carbon::now())); goto gB2Ix; N6Slp: ResAssetUtil::updateDownloadCount($HsIf6['assetId']); goto mgQz2; rDtBa: if (empty($zk4Tz)) { return; } goto zS_zm; ESZQx: if (Response::isError($Tbn6c)) { Log::info('Res.ResPayCenterBiz.Error - ' . $Tbn6c['msg']); } goto N6Slp; gB2Ix: $Tbn6c = AssetAccess::buy($zk4Tz['title'], AccessCreateFrom::CREATE_FROM_MONEY, $zk4Tz, $HsIf6['memberUserId'], 'res_asset_access'); goto ESZQx; mgQz2: ResRewardUtil::update('Money:' . $HsIf6['id'], AccessCreateFrom::CREATE_FROM_MONEY, $zk4Tz); goto mXIGi; GYLvm: $HsIf6 = ModelUtil::get('res_asset_buy_order', $vfjVR); goto V0VqI; V0VqI: if (empty($HsIf6) || $HsIf6['status'] != OrderStatus::WAIT_PAY) { return; } goto FU_L0; mXIGi: } }