Results 25 comments of YanjingGuo

![image](https://user-images.githubusercontent.com/45870098/180899163-58c54694-dc9e-441b-9860-42823a3306bd.png) 这么写的,为了最后获取最新数据还要 find 一下

我以为更新后返回的是最新更新完成后的所有内容呢。而且这里应该是程序处理了吧,创建时间与更新时间返回的是格式化后的日期,删除时间返回的是时间戳,如何统一返回时间戳或格式化后的字符串? ![image](https://user-images.githubusercontent.com/45870098/180899556-9dd14d3b-46b8-4d8e-bb6b-bcf6c537a969.png) ![image](https://user-images.githubusercontent.com/45870098/180899603-3e411015-a081-4159-bab9-df4950ba367c.png)

> append不支持这样做,需要多个,就直接写在一个数组里 可以在模型里设置直接默认输出吗?

> 不支持,可以自己封装一个类似的东西,利用模型事件(查询后)。 每次查询后都会调用。 > > 这个东西我用了很多,对于关联操作,尽量不要调用,影响性能。 对于格式化处理这种可以用。 好的,感谢。我看模型有个 filed 属性可以控制写入的字段,以为也有个其他属性控制读取的字段呢。

![image](https://user-images.githubusercontent.com/45870098/169637833-3fd2cb6c-e509-4e51-b827-ad4579021f21.png)

无法直接更新 delete_time 吗?必须使用 restore() 更新 delete_time ?

> 无法直接更新 delete_time 吗?必须使用 restore() 更新 delete_time ? 使用 force() 强制更新也不行

> 看下我使用的 > > ``` > $data = model::onlyTrashed()->whereIn('id', $ids)->select(); > foreach ($data as $k) { > $k->restore(); > } > ``` 对,就是需要使用 restore 恢复软删除的,使用更新直接更新 delete_time 为 null 好像不管用。