SimpleGallery icon indicating copy to clipboard operation
SimpleGallery copied to clipboard

sql-запрос в sgLister

Open helgispbru opened this issue 2 years ago • 0 comments

При вызове sgLister из контроллера в виде:

$res = evo()->runSnippet('sgLister', [
  'parents' => 12345,
])

В базу идёт запрос в виде:

SELECT *
FROM ba_sg_images as `c`
WHERE `sg_isactive`=1 AND (`c`.`sg_rid` IN ('12345'))
GROUP BY `c`.`sg_id`
ORDER BY sg_index DESC

Хотя где where наверное должно быть WHERE c.sg_isactive=1 И где order by наверное так же надо.

Картинка: image

Второй запрос на картинке сделан с помощью DB::select для тестов.

$res = DB::table('sg_images')
  ->where('sg_rid', 12345)
  ->orderBy('sg_index', 'ASC')
  ->get();

evo 3

helgispbru avatar Sep 23 '22 07:09 helgispbru