<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Shop\Listener; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Type\TypeUtil; use Module\PayCenter\Events\OrderPayedEvent; use Module\PayCenter\Type\PayType; use Module\Shop\Constant\PayConstant; use Module\Vendor\Provider\Notifier\NotifierProvider; use Module\Vendor\Type\OrderStatus; class ShopOrderPayListener { public function onOrderPayed(OrderPayedEvent $zt93p) { goto moWlJ; VdFaQ: switch ($g16tm) { case PayConstant::SHOP_ORDER: goto Ab0X1; BfqW4: $FYr9C = ModelUtil::getWithLock('order', $hbx5Z); goto hT6vV; G0jbu: NotifierProvider::notify('Shop_NewOrderPayed', '商城-新订单已支付', array('单号' => $FYr9C['sn'], '时间' => date('Y-m-d H:i:s'), '支付方式' => TypeUtil::name(PayType::class, $v9Xk2['payType']))); goto myvwp; myvwp: break; goto vhfjG; z3HvU: ModelUtil::transactionCommit(); goto RsA50; Ab0X1: ModelUtil::transactionBegin(); goto BfqW4; hT6vV: ModelUtil::update('order', array('id' => $hbx5Z), array('status' => OrderStatus::WAIT_SHIPPING, 'payType' => $v9Xk2['payType'], 'isPayed' => true)); goto z3HvU; RsA50: $Pgqog = ModelUtil::all('goods', array('orderId' => $hbx5Z)); goto P1gyX; P1gyX: foreach ($Pgqog as $YaV4m) { ModelUtil::increase('goods', array('id' => $YaV4m['goodsId']), 'soldCount', $YaV4m['amount']); } goto G0jbu; vhfjG: } goto kDtIX; Rs2GF: $v9Xk2 = $zt93p->order; goto VdFaQ; bvYDE: $hbx5Z = $zt93p->bizId; goto Rs2GF; moWlJ: $g16tm = $zt93p->biz; goto bvYDE; kDtIX: } public function subscribe($sWXb7) { $sWXb7->listen(OrderPayedEvent::class, '\\Module\\Shop\\Listener\\ShopOrderPayListener@onOrderPayed'); } }