From 025dab4c2c91b7973be9664314651df549bc82b0 Mon Sep 17 00:00:00 2001 From: cano Date: Sun, 10 Mar 2024 00:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DbaseModel=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + app/Models/Base/BaseModel.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7fe978f..b08ce80 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ yarn-error.log /.fleet /.idea /.vscode +test.php diff --git a/app/Models/Base/BaseModel.php b/app/Models/Base/BaseModel.php index d0575d3..9825f4a 100644 --- a/app/Models/Base/BaseModel.php +++ b/app/Models/Base/BaseModel.php @@ -43,7 +43,8 @@ class BaseModel extends Model if(!$col) $col = $this->primaryKey; $aItem = $this->checkColInFill($aItem); if (empty($aItem)) return false; - if (isset($aItem[$col])) return false; + if (!isset($aItem[$col])) return false; + if (empty($aItem[$col])) return false; return $this->newQuery()->where($col,$aItem[$col])->update($aItem); }