<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Faka\Listener; use ModStart\Core\Dao\ModelUtil; use Module\Faka\Constant\FakaConstant; use Module\Faka\Job\ProductOrderProcessorJob; use Module\Faka\Type\ProductDeliverType; use Module\Faka\Type\ProductOrderProcessStatus; use Module\Faka\Type\ProductOrderStatus; use Module\PayCenter\Events\OrderPayedEvent; class FakaPayListener { public function onOrderPayed(OrderPayedEvent $Z8J51) { goto TTIcs; TTIcs: $Dnlri = $Z8J51->biz; goto twQi_; twQi_: $dY0xr = $Z8J51->bizId; goto Czg3P; Czg3P: switch ($Dnlri) { case FakaConstant::PAY_ORDER: goto kEtYU; sQN2a: ModelUtil::update('faka_product_order', array('id' => $dY0xr), array('status' => ProductOrderStatus::PAYED)); goto BVSBI; go5dv: if (empty($MZHZc)) { return; } goto vWrfF; vWrfF: $Wmda_ = ModelUtil::get('faka_product', $MZHZc['productId']); goto sQN2a; BVSBI: $jGqlN = ModelUtil::insert('faka_product_order_processor', array('deliverType' => $Wmda_['deliverType'], 'orderId' => $MZHZc['id'], 'processStatus' => ProductOrderProcessStatus::WAIT_PROCESS)); goto e7joc; e7joc: if ($Wmda_['deliverType'] == ProductDeliverType::AUTO) { ProductOrderProcessorJob::create($jGqlN['id']); } goto lT4GQ; kEtYU: $MZHZc = ModelUtil::get('faka_product_order', $dY0xr); goto go5dv; lT4GQ: break; goto yTWdk; yTWdk: } goto dosFF; dosFF: } public function subscribe($WNxvc) { $WNxvc->listen(OrderPayedEvent::class, '\\' . __CLASS__ . '@onOrderPayed'); } }