Sylius - [Admin] 如何编辑 indexAction 网格查询 [英] Sylius - [Admin] How to edit the indexAction grid query

查看:37
本文介绍了Sylius - [Admin] 如何编辑 indexAction 网格查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想编辑 product 控制器中的 indexAction 进行一些数据过滤.我所做的是我在产品表和用户表中添加了新列作为 branch_code ,当每个用户登录系统时,他们根据他们的 branch_code 显示产品列表

I'm just trying to edit the indexAction in product controller doing some data filtering. what I did was I added new column as branch_code and in product table and the user table , when each user login to the system they show the product list according to the their branch_code

我只是想更改资源中的查询(请参阅附件).我数着抓住它,

I'm just trying to change query in resources (Please refer the attachment). and I count catch it,

我需要的是,我想在这个查询中添加一个WHERE条件,

What I need is, I want to add a WHERE condition to this query,

你能指导我解决这个问题吗

Can you please guide me solve this issue

推荐答案

您可以 扩展产品存储库 并扩展createListQueryBuilder 方法以添加您的自定义逻辑.如果这还不够,那么您可以创建一个新方法,然后 覆盖管理员产品网格并更改存储库方法.

You can extend the product repository and extend the createListQueryBuilder method to add your custom logic. If that is not enough, then you can create a new method, then override the admin product grid and change the repository method.

这篇关于Sylius - [Admin] 如何编辑 indexAction 网格查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆