modification
-
TP6修改查询数据数组时报错Indirect modification of overloaded element of think\Collection has no effect解决办法
TP6操作DB类查询数据库中查询到的数据,修改元素时,会报错:
1Indirect modification of overloaded element of think\Collection has no effect解决的办法简单,引用一下数据库查询到的数据即可。比如:
12$list = Db::table('bill_data')->where($where)->where('state','新增')->whereOr('delete_time','not null')->order('update_time desc')->limit(intval($from),intval($limit))->select();$list = $list->all();第二行就是,随后继续foreach等操作即可。