<?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($Dnlri, $KJ3xr, $ui5sr = array()) { goto g9u5Z; B3o1Q: $vTsmH = modstart_web_full_url('api/pay/quick_watch', array('sn' => $jxsQg)); goto DmR2A; NZgUh: $MZHZc['status'] = PayOrderQuickStatus::NEW_ORDER; goto CUF1r; EOAYY: $WHKmT = modstart_web_full_url('pay/quick/' . $jxsQg); goto B3o1Q; H0nht: $MZHZc['payType'] = null; goto HfzPA; kvR6M: $MZHZc = ModelUtil::insert('pay_order_quick', $MZHZc); goto bwuYl; g9u5Z: $MZHZc = array(); goto HlB6z; bwuYl: $jxsQg = $MZHZc['id'] . '_' . $MZHZc['code']; goto EOAYY; c3rMc: $MZHZc['param'] = json_encode($KJ3xr, JSON_UNESCAPED_UNICODE); goto kLL7C; kLL7C: $MZHZc['session'] = json_encode($ui5sr, JSON_UNESCAPED_UNICODE); goto kvR6M; CUF1r: $MZHZc['biz'] = $Dnlri; goto c3rMc; HlB6z: $MZHZc['code'] = RandomUtil::string(10); goto H0nht; JfBaB: return Response::generateSuccessData(array('payUrl' => $WHKmT, 'watchUrl' => $vTsmH, 'payExpire' => $UHOKU, 'payExpireSeconds' => $UHOKU - time())); goto x9ICX; HfzPA: $MZHZc['expire'] = date('Y-m-d H:i:s', time() + TimeUtil::PERIOD_MINITE * 10); goto NZgUh; DmR2A: $UHOKU = strtotime($MZHZc['expire']); goto JfBaB; x9ICX: } }