From 0b4cbf8c2c65f6e7e81538bd4cd554bbf99ba380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B8=91=E8=B7=AF=E4=BA=BA?= <2278757482@qq.com> Date: Thu, 4 Feb 2021 18:01:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=89=E6=9C=88?= =?UTF-8?q?=E5=88=86=E8=A1=A8=E6=A8=A1=E5=9E=8B=E7=9A=84=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=88=E4=BB=BD=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/MonthModel.php | 4 ++-- app/Models/YearModel.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/MonthModel.php b/app/Models/MonthModel.php index e79223f..34b9eb9 100644 --- a/app/Models/MonthModel.php +++ b/app/Models/MonthModel.php @@ -16,8 +16,8 @@ class MonthModel extends Model { parent::__construct($attributes); - // 自动设置当月表名 - $this->setMonthTable(); + // 如果月份为空,那么需要设置当月表名 + if (empty($this->month)) $this->setMonthTable(); } public function getMonth(): string diff --git a/app/Models/YearModel.php b/app/Models/YearModel.php index 316ef1e..2329df1 100644 --- a/app/Models/YearModel.php +++ b/app/Models/YearModel.php @@ -11,8 +11,8 @@ class YearModel extends MonthModel public function __construct($data = []) { parent::__construct($data); - // 自动设置按月分表表名【默认以当前时间为准】 - $this->setMonthTable(); + // 如果月份为空,那么需要设置按月分表表名【默认以当前时间为准】 + if (empty($this->month)) $this->setMonthTable(); } /** -- Gitee From b854d1268253064d1dc50a6572c8166fd408be5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B8=91=E8=B7=AF=E4=BA=BA?= <2278757482@qq.com> Date: Thu, 4 Feb 2021 18:03:08 +0800 Subject: [PATCH 2/2] update --- app/Models/YearModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/YearModel.php b/app/Models/YearModel.php index 2329df1..9db7a50 100644 --- a/app/Models/YearModel.php +++ b/app/Models/YearModel.php @@ -11,7 +11,7 @@ class YearModel extends MonthModel public function __construct($data = []) { parent::__construct($data); - // 如果月份为空,那么需要设置按月分表表名【默认以当前时间为准】 + // 如果年份为空,那么需要设置按月分表表名【默认以当前时间为准】 if (empty($this->month)) $this->setMonthTable(); } -- Gitee