<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\PayCenter\Util; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\Response; use ModStart\Core\Util\RandomUtil; use ModStart\Core\Util\TimeUtil; use Module\PayCenter\Model\PayOrderQuick; use Module\PayCenter\Type\PayOrderQuickStatus; class PayOrderQuickUtil { public static function cleanHistory() { PayOrderQuick::query()->where('created_at', '<', date('Y-m-d H:i:s', time() - TimeUtil::PERIOD_DAY))->where(array('status' => PayOrderQuickStatus::CREATED))->delete(); } public static function create($qhsmj, $qOrzw, $xN9i3 = array()) { goto O6tH_; DJDHR: $HsIf6['session'] = json_encode($xN9i3, JSON_UNESCAPED_UNICODE); goto PyRiB; PyRiB: $HsIf6 = ModelUtil::insert('pay_order_quick', $HsIf6); goto QUg1q; GoDMM: $HsIf6['code'] = RandomUtil::string(10); goto qAAXU; I_F0e: $HsIf6['status'] = PayOrderQuickStatus::NEW_ORDER; goto dPwMO; BFbOl: $KfcNX = strtotime($HsIf6['expire']); goto k0BpB; O6tH_: $HsIf6 = array(); goto GoDMM; dCuU1: $HsIf6['expire'] = date('Y-m-d H:i:s', time() + TimeUtil::PERIOD_MINITE * 10); goto I_F0e; CITFG: $qZT4K = modstart_web_full_url('pay/quick/' . $KDkZr); goto ABgtJ; isa4N: $HsIf6['param'] = json_encode($qOrzw, JSON_UNESCAPED_UNICODE); goto DJDHR; dPwMO: $HsIf6['biz'] = $qhsmj; goto isa4N; qAAXU: $HsIf6['payType'] = null; goto dCuU1; QUg1q: $KDkZr = $HsIf6['id'] . '_' . $HsIf6['code']; goto CITFG; k0BpB: return Response::generateSuccessData(array('payUrl' => $qZT4K, 'watchUrl' => $corE_, 'payExpire' => $KfcNX, 'payExpireSeconds' => $KfcNX - time())); goto nmg9n; ABgtJ: $corE_ = modstart_web_full_url('api/pay/quick_watch', array('sn' => $KDkZr)); goto BFbOl; nmg9n: } }