简体   繁体   English

Sylius - [管理员] 如何编辑 indexAction 网格查询

[英]Sylius - [Admin] How to edit the indexAction grid query

I'm just trying to edit the indexAction in product controller doing some data filtering.我只是想编辑产品controller 中的indexAction进行一些数据过滤。 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,我数着抓住它, 在此处输入图像描述

What I need is, I want to add a WHERE condition to this query,我需要的是,我想在这个查询中添加一个WHERE条件,

Can you please guide me solve this issue你能指导我解决这个问题吗

You canextend the product repository and extend the createListQueryBuilder method to add your custom logic.您可以扩展产品存储库并扩展createListQueryBuilder方法以添加您的自定义逻辑。 If that is not enough, then you can create a new method, then override the admin product grid and change the repository method .如果这还不够,那么您可以创建一个新方法,然后覆盖管理产品网格并更改存储库方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM