From a5152dff4885ff9dc7b751e23e9b48e03f2e5c1e Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Mon, 26 Jun 2023 13:19:46 +0800 Subject: [PATCH] * Story list response time reduced by 67%. --- module/story/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 1a2f87bae7..0148c59f2d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4497,10 +4497,12 @@ class storyModel extends model global $app, $config; static $shadowProducts = array(); - if(empty($shadowProducts[$story->product])) + static $hasShadow = true; + if($hasShadow and empty($shadowProducts[$story->product])) { global $dbh; $stmt = $dbh->query('SELECT id FROM ' . TABLE_PRODUCT . " WHERE shadow = 1")->fetchAll(); + if(empty($stmt)) $hasShadow = false; foreach($stmt as $row) $shadowProducts[$row->id] = $row->id; }