We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tp5 最新版 数据集查询后 调用内置分页后 想修改分页过的数据 补充额外字段 可以用collection 的 offsetSet 方法
$productCategory = Db::name('ProductCategory')->alias('a')->field("a.id,a.category_name,a.discount,a.order_index,count(b.id) as product_num") ->join('kwy_product b', 'b.product_category_id =a.id', 'left')->where($where)->group("a.id")->order("a.order_index asc")->paginate(10); foreach($productCategory->all() as $key =>$val ){ $productCategory->offsetSet($key, array_merge($val, ['sex'=>1])); }
完成获取器的操作 以后可能支持分页类对象的each 方法修改数据
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tp5 最新版 数据集查询后 调用内置分页后 想修改分页过的数据 补充额外字段 可以用collection 的 offsetSet 方法
完成获取器的操作 以后可能支持分页类对象的each 方法修改数据
The text was updated successfully, but these errors were encountered: