SELECT SELECT U0 user_id FROM products_vips U0 WHERE U0 game_id produc

1
2
3
4
5
6
7
SELECT * (SELECT U0.`user_id` FROM `products_vips` U0 WHERE (U0.`game_id` = (`products_product`.`game_id`) AND U0.`user_id` = 38593023) LIMIT 1) AS `vips`,
CASE
WHEN `products_product`.`visibility` = 'v' THEN (SELECT U0.`user_id` FROM `products_vips` U0 WHERE (U0.`game_id` = (`products_product`.`game_id`) AND U0.`user_id` = 38593023) LIMIT 1) IS NOT NULL
WHEN `products_product`.`visibility` = 'i' THEN (SELECT U0.`user_id` FROM `products_vips` U0 WHERE (U0.`game_id` = (`products_product`.`game_id`) AND U0.`user_id` = 38593023) LIMIT 1) IS NULL
ELSE 1
END AS `visible`
FROM `products_product` ORDER BY `products_product`.`priority` DESC LIMIT 21; args=(38593023, 'v', 38593023, 'i', 38593023, True)