Code
1
INNER JOIN bundle_detail a0 ON ( a1.id = a0.bundle_id AND a1.from <= CURDATE( ) AND a1.to >= CURDATE( ) )
es gibt keinen Datensatz, welcher die Datumsbedingung erfüllt
INNER JOIN bundle_detail a0 ON ( a1.id = a0.bundle_id AND a1.from <= CURDATE( ) AND a1.to >= CURDATE( ) )
es gibt keinen Datensatz, welcher die Datumsbedingung erfüllt
IF( ISNULL( i.id ) , b.price, MIN( i.price ) ) AS `preis` ,
Wenn i.id NULL ist, soll b.price verwendet werden. Dieser ist aber u.U. auch NULL. Die WHERE bedingungen könnten aber dennoch passen. Was auch immer ... Ist nur ne Vermutung. ;-)
SELECT
`a`.`id` AS `id` ,
`a`.`store_id` AS `store` ,
`a1`.`name` AS `name` ,
`a1`.`id` AS `bundle` ,
`a`.`id` AS `product` ,
`i`.`id` AS `variation` ,
`b1`.`percent` AS `percent` ,
IF( ISNULL( i.id ) , b.price, MIN( i.price ) ) AS `preis` ,
`b`.`customer_group_id` AS `group` ,
`a1`.`smalltext` AS `kurztext` ,
`a1`.`text` AS `text` ,
`a1`.`image` AS `image` ,
`a1`.`alt` AS `alt`
FROM bundle a1
INNER JOIN bundle_detail a0 ON ( a1.id = a0.bundle_id AND a1.from <= CURDATE( ) AND a1.to >= CURDATE( ) )
INNER JOIN product a ON ( a0.product_id = a.id )
INNER JOIN product_price b ON ( a.id = b.product_id )
INNER JOIN bundle_group b1 ON ( b.customer_group_id = b1.customer_group_id AND a1.id = b1.bundle_id )
LEFT JOIN product_variation_group i ON ( a0.product_variation_id = i.product_variation_id AND b.customer_group_id = i.customer_group_id )
WHERE a.store_id =1
AND b.customer_group_id =1
AND a1.id =1
ORDER BY name ASCKann mir das jemand erklären wo da mein Denkfehler ist?