修复baseModel更新数据问题

This commit is contained in:
cano
2024-03-10 00:44:33 +08:00
parent aa40614965
commit 025dab4c2c
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}