_confirmHandle('tb');
break;
case 'tk':
$url = "asset/cash-out";
$message = $this->_confirmHandle('tk');
break;
default:
throw new MinerException('无效参数');
}
} catch (MinerException $e) {
$error = "【error】 {$e->getMessage()}";
} catch (\yii\db\Exception $e) {
$error = "【DB错误】 {$e->getMessage()}";
}
return $this->render('confirm', [
'url' => $url,
'message' => $message,
'error' => $error
]);
}
/**
* _confirmHandle
* @param $key
* @return string
* @throws MinerException
*/
private function _confirmHandle($key)
{
$char = $key == 'tk' ? '提款' : '提币';
$sign = $key == 'tk' ? "####################" : "***************************";
$request = Yii::$app->request;
$count = $request->get('count');
$maxId = $request->get('maxId');
$minId = $minTemp = $request->get('minId');
if (!is_numeric($count) || !is_numeric($maxId)) {
throw new MinerException('错误的请求参数');
}
$cache = Cache::getData("weChat_{$key}_max");
if ($cache > $minId && $cache < $maxId) {
$minId = $cache;
}
if (is_numeric($cache) && $maxId <= $cache) {
$str = "
"
. "