Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

RabbitAlgedo

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

RabbitAlgedo's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter

Recent Badges

0

Reputation

  1. В модели есть запрос public function getMinPriceFromCategory($category_id) { $query = $this->db->query("SELECT LEAST(p.price,IFNULL(ps.price, p.price)) min_price FROM `" . DB_PREFIX . "category` c RIGHT JOIN `" . DB_PREFIX . "product_to_category` p2c ON p2c.category_id = c.category_id RIGHT JOIN `" . DB_PREFIX . "product` p ON p2c.product_id = p.product_id LEFT JOIN `" . DB_PREFIX . "product_special` ps ON p.product_id = ps.product_id AND ps.date_end >= NOW() AND ps.date_start <= NOW() WHERE c.category_id = " . (int)$category_id . " AND p.status = 1 AND c.status = 1 ORDER BY min_price LIMIT 0,1 "); if ($query->num_rows) { return $query->row['min_price']; } else { return 0; } } Всё работает, выводит мин. цену, но без учёта скидки/акции - как это можно запросить? Помогите с ответом, или подскажите где прочитать, все топики перерыл, как англоязычные так и наши...
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.