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

schel

Новичок
  
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

schel's Achievements

Newbie

Newbie (1/14)

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

Recent Badges

2

Reputation

  1. Добавьте в sql Запрос поле ваше в модели catalog\model\catalog\product.php в функции public function getProducts(
  2. то есть добавили подсчет комментов , (SELECT COUNT(*) FROM " . DB_PREFIX . "review WHERE " . DB_PREFIX . "review.product_id=p.product_id) AS rcount и потом сортировка по новому полю, здесь я его назвал rcount
  3. Прежде чем напиисать как, хотел протестировать у него в базе, в своей протестил. если еще кому понадобится $query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.viewed DESC LIMIT " . (int)$setting['limit']); заменить на $query = $this->db->query("SELECT p.product_id, (SELECT COUNT(*) FROM " . DB_PREFIX . "review WHERE " . DB_PREFIX . "review.product_id=p.product_id) AS rcount FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY rcount DESC LIMIT " . (int)$setting['limit']);
×
×
  • 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.