* [task#141199,done,1h] Compatible with multiple products.
This commit is contained in:
@@ -637,18 +637,18 @@ class productModel extends model
|
||||
* 获取需求列表。
|
||||
* Get stories.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $branch
|
||||
* @param string $browseType bymodule|unclosed|allstory|assignedtome|openedbyme|reviewbyme|draftstory|reviewedbyme|assignedbyme|closedbyme|activestory|changingstory|reviewingstory|willclose|closedstory
|
||||
* @param int $queryID
|
||||
* @param int $moduleID
|
||||
* @param string $type requirement|story
|
||||
* @param string $sort
|
||||
* @param object $pager
|
||||
* @param int|array $productID
|
||||
* @param string $branch
|
||||
* @param string $browseType bymodule|unclosed|allstory|assignedtome|openedbyme|reviewbyme|draftstory|reviewedbyme|assignedbyme|closedbyme|activestory|changingstory|reviewingstory|willclose|closedstory
|
||||
* @param int $queryID
|
||||
* @param int $moduleID
|
||||
* @param string $type requirement|story
|
||||
* @param string $sort
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStories(int $productID, string $branch, string $browseType, int $queryID, int $moduleID, string $type = 'story', string $sort = 'id_desc', object|null$pager = null): array
|
||||
public function getStories(int|array $productID, string $branch, string $browseType, int $queryID, int $moduleID, string $type = 'story', string $sort = 'id_desc', object|null$pager = null): array
|
||||
{
|
||||
if(commonModel::isTutorialMode()) return $this->loadModel('tutorial')->getStories();
|
||||
|
||||
|
||||
+11
-11
@@ -2308,7 +2308,7 @@ class storyModel extends model
|
||||
/**
|
||||
* Get stories list of a product.
|
||||
*
|
||||
* @param string|int $productID
|
||||
* @param string|int|array $productID
|
||||
* @param array|string|int $branch
|
||||
* @param array|string $moduleIdList
|
||||
* @param array|string $status
|
||||
@@ -2321,7 +2321,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductStories(string|int $productID = 0, array|string|int $branch = 0, array|string $moduleIdList = '', array|string $status = 'all', string $type = 'story', string $orderBy = 'id_desc', bool $hasParent = true, array|string $excludeStories = '', object|null $pager = null): array
|
||||
public function getProductStories(string|int|array $productID = 0, array|string|int $branch = 0, array|string $moduleIdList = '', array|string $status = 'all', string $type = 'story', string $orderBy = 'id_desc', bool $hasParent = true, array|string $excludeStories = '', object|null $pager = null): array
|
||||
{
|
||||
if(commonModel::isTutorialMode()) return $this->loadModel('tutorial')->getStories();
|
||||
$showGrades = isset($this->config->{$type}->showGrades) ? $this->config->{$type}->showGrades : null;
|
||||
@@ -2596,7 +2596,7 @@ class storyModel extends model
|
||||
/**
|
||||
* Get stories by a field.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int|array $productID
|
||||
* @param int|string $branch
|
||||
* @param string|array $modules
|
||||
* @param string $fieldName
|
||||
@@ -2608,7 +2608,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByField(int $productID, int|string $branch, string|array $modules, string $fieldName, string $fieldValue, string $type = 'story', string $orderBy = '', object|null $pager = null, string $operator = 'equal'): array
|
||||
public function getByField(int|array $productID, int|string $branch, string|array $modules, string $fieldName, string $fieldValue, string $type = 'story', string $orderBy = '', object|null $pager = null, string $operator = 'equal'): array
|
||||
{
|
||||
if(!$this->loadModel('common')->checkField(TABLE_STORY, $fieldName) and $fieldName != 'reviewBy' and $fieldName != 'assignedBy') return array();
|
||||
|
||||
@@ -2656,16 +2656,16 @@ class storyModel extends model
|
||||
/**
|
||||
* Get to be closed stories.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param string $modules
|
||||
* @param string $type requirement|story
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param int|array $productID
|
||||
* @param int $branch
|
||||
* @param string $modules
|
||||
* @param string $type requirement|story
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function get2BeClosed(int $productID, int|string $branch, string|array $modules, string $type = 'story', string $orderBy = '', object|null $pager = null): array
|
||||
public function get2BeClosed(int|array $productID, int|string $branch, string|array $modules, string $type = 'story', string $orderBy = '', object|null $pager = null): array
|
||||
{
|
||||
$showGrades = isset($this->config->{$type}->showGrades) ? $this->config->{$type}->showGrades : null;
|
||||
if($showGrades)
|
||||
|
||||
@@ -189,12 +189,12 @@ class storyTao extends storyModel
|
||||
* 根据产品 ID 列表和分支参数,构建查询条件。
|
||||
* Build products condition.
|
||||
*
|
||||
* @param string|int $productIdList
|
||||
* @param string|int|array $productIdList
|
||||
* @param array|string|int $branch
|
||||
* @access protected
|
||||
* @return string
|
||||
*/
|
||||
protected function buildProductsCondition(string|int $productIdList, array|string|int $branch = 'all'): string
|
||||
protected function buildProductsCondition(string|int|array $productIdList, array|string|int $branch = 'all'): string
|
||||
{
|
||||
/* 如果查询所有分支,直接用 idList 条件。 */
|
||||
if(empty($productIdList)) $productIdList = '0';
|
||||
|
||||
Reference in New Issue
Block a user