Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tjztj committed Aug 19, 2023
1 parent d957d48 commit 5e1c211
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/field/ListField.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class ListField extends ModelField

protected bool $canExcelImport=false;//不能使用excel导入数据
protected bool $canExport=false;//不能导出此字段数据
/**
* @var FieldCollection |ModelField[]
*/
protected FieldCollection $fields;//字段集合
protected $nullVal='null';//字段在数据库中为空时的值

Expand Down Expand Up @@ -122,6 +125,9 @@ public function setSaveVal(array $data,BaseModel $old): self
$fieldsObj=clone $this->fields;
$fieldsObj->setSave($v,$old);
$list[$k]=$fieldsObj->getSave();
foreach ($fieldsObj as $val){
unset($val->save);
}
}
if(empty($list)){
$this->save=$this->nullVal();
Expand Down

0 comments on commit 5e1c211

Please sign in to comment.