i have 3 tables.
1) products table
id, product_name, seller_id, brand_name
2) products_quantity table
id, products_id, quantity,
price_per_bag etc.,
3) product_cat_values table
id,products_id,cat_type, cat_type_value etc.,
(Note: cat_type is a reference from multiple tables like color_types, property_types etc which will have multiple values for a single product )
Now i want to add filter queries. how can i query products_quantity and products_cat_values table from products table using notorm.
if i query using products_quantity table, i can use like this.
$w= "products.status=1";
$w = "AND ((brand_name = 'Tiger') AND (price_per_bag between 0 and 30))";
$result = $this->orm->products_quantity(array('products.status' => 1))->select("products.*, products_quantity.*")->where("$w");
The above code works well. but in this case, i cant add where conditions for product_cat_values table. For example, if i want to add cat_type=1 (for color) and cat_type_value=2(for blue) from product_cat_values table i cant do it in filter products.
I want to query from products table so that i can add conditions in where clause for all 3 tables. Please help to implement this process.