From 0aae9c624f21d388bc70d673908030b16278bdc8 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 25 Sep 2023 10:37:47 +0800 Subject: [PATCH] + Add params for story getPairs. --- module/story/model.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 93aef2a927..86a9d458f2 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -88,14 +88,17 @@ class storyModel extends model * Get story pairs. * * @param int $productID + * @param int $planID + * @param string $field * @access public * @return array */ - public function getPairs(int $productID = 0): array + public function getPairs(int $productID = 0, int $planID = 0, string $field = 'title'): array { - return $this->dao->select('id, title')->from(TABLE_STORY) + return $this->dao->select("id, {$field}")->from(TABLE_STORY) ->where('deleted')->eq('0') ->beginIF($productID)->andWhere('product')->eq($productID) + ->beginIF($planID)->andWhere("CONCAT(',', plan, ',')")->like("%,{$planID},%")->fi() ->fetchPairs(); }