From 391b1b07270189538e07f1f55d04da24267a330d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 17 May 2021 17:05:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E5=91=98=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/controller/base/Upgrade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/data/controller/base/Upgrade.php b/app/data/controller/base/Upgrade.php index bf34f0976..2d95c527b 100644 --- a/app/data/controller/base/Upgrade.php +++ b/app/data/controller/base/Upgrade.php @@ -78,7 +78,9 @@ class Upgrade extends Controller { if ($this->request->isGet()) { $this->prizes = RebateService::PRIZES; - $vo['number'] = $vo['number'] ?? $this->app->db->name($this->table)->max('number') + 1; + if (!isset($vo['number'])) { + $vo['number'] = $this->app->db->name($this->table)->order('number desc')->value('number', -1) + 1; + } $vo['rebate_rule'] = str2arr($vo['rebate_rule'] ?? ''); } else { $vo['utime'] = time();