跳至内容

欢迎!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

此问题已终结
作为版主,您可以批准或拒绝该答案。
接受 拒绝
42 查看

Issues:

When i want to filter commission type = cobroke-commission, after i filter, it only come out one result, but the correct result should be two.

Result:

So, i try to write the query out to check the query

We can write the query before returning it, and the key point is that we need to add (string) to the $query because it ensures the query is properly converted to a string before execution.


Write File:

In the written file, we can see that the query consists of three WHERE clauses, but the third one is for sales_type, which we did not include in the filters.

Back in the frontend view, we can see that the sales type is already auto-selected even before we make a selection.

This is because the XML field does not have a default value or a header specified.

So, solution is adding a header to the xml field like:


Revised frontend view

Now, when we filter again, it should not have any issues


The query will no longer include the WHERE clause for sales type


Summary:

Setting a header for the filter XML field is important to avoid an extra WHERE clause in the query. It also enhances user experience by making the filter dropdown more user-friendly, especially when a header like '--Select Sales Type--' is provided.

形象
丢弃

您的回复

请大家尽量给个实质性的回答。如果您想回答这个问题或发表评论,只需 使用评论工具。请记住,您可以随时修改您的答案。 - 不用重复回答同样的问题。另外,请不要忘记投票 - 它确实有助于选择最好的问题和答案!

相关帖文 回复 查看 活动
0
2月 25
55
0
2月 25
45
0
1月 25
39
0
1月 25
57
0
3月 25
30