mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-01-28 06:38:10 +00:00
修复tp5 Model更新函数返回信息没有是否更新成功信息
This commit is contained in:
parent
1f6d91b849
commit
e309a1bda9
@ -42,9 +42,11 @@ trait ModelTrait
|
||||
{
|
||||
$model = new self;
|
||||
if(!$field) $field = $model->getPk();
|
||||
return false !== $model->update($data,[$field=>$id]);
|
||||
// return false !== $model->update($data,[$field=>$id]);
|
||||
return 0 < $model->update($data,[$field=>$id])->result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询一条数据是否存在
|
||||
* @param $map
|
||||
|
||||
@ -1680,7 +1680,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
if (!empty($field)) {
|
||||
$model->allowField($field);
|
||||
}
|
||||
$result = $model->isUpdate(true)->save($data, $where);
|
||||
$model->result = $model->isUpdate(true)->save($data, $where);
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user