[TYPO3-mvc] Complex query just not working

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Tue Jul 12 02:58:06 CEST 2011


Hello folks,

I'm struggling to get this query going:
https://gist.github.com/1077139

When looking at the raw SQL statement,
the important part comes to this:
https://gist.github.com/1077140

The problem I see is in line 13
and in line 30. Instead of the INT
value I expect a NULL, because the
fields "excludedCategories" and
"excludedProducts" in the discount
record are _not_ set. So I'm wondering
why the mentioned values are _not_ NULL?

I want to achieve this:
"Select discounts for a given product,
where either the category of a product is
allowed or the product itself is allowed
but exclude products with disallowed categories
or directly disallowed products."

A discount consists of this fields:
* Name
* Rate
* includedCategories
* excludedCategories
* includedProducts
* excludedProducts

ExcludedCategories and ExcludedProducts should
always overwrite included* fields in the end and
"product" fields should always override "category" fields.

So this is the order if fields by relevance:

* Excluded products overwrite
* included products overwrite
* excluded categories overwrite
* included categories.

Hopefully this is clear enough.
I'm really struggling with this.

Thanks for your help!!

Regards,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list