debug
This commit is contained in:
@@ -36,6 +36,28 @@ class ChapterModel extends MongoModel
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param array $arrFilter
|
||||
* @return null|array
|
||||
*/
|
||||
public function getChapter(array $arrFilter): null|array
|
||||
{
|
||||
|
||||
$arrOptions = self::$arrChapterOptions;
|
||||
|
||||
$arrChapter = $this->getOne($arrFilter, $arrOptions);
|
||||
|
||||
if (!empty($arrChapter)) {
|
||||
applyToKeys($arrChapter, ['created_at', 'updated_at'], 'formatMongoDate');
|
||||
|
||||
$arrChapter['content'] = StorageCore::getInstance()->read($arrChapter['c_content_path']);
|
||||
}
|
||||
|
||||
return $arrChapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
@@ -110,13 +132,13 @@ class ChapterModel extends MongoModel
|
||||
['c_sort_num' => ['$lt' => $intCSortNum]],
|
||||
[
|
||||
'$and' => [
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$lt' => $intCPage]]
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$lt' => $intCPage]]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
['n_id' => $intNId]
|
||||
['n_id' => $intNId]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -125,7 +147,9 @@ class ChapterModel extends MongoModel
|
||||
'c_sort_num' => -1,
|
||||
'c_page' => -1,
|
||||
];
|
||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
|
||||
$arrChapterAll = $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
return $arrChapterAll[0] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +169,13 @@ class ChapterModel extends MongoModel
|
||||
['c_sort_num' => ['$gt' => $intCSortNum]],
|
||||
[
|
||||
'$and' => [
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$gt' => $intCPage]]
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$gt' => $intCPage]]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
['n_id' => $intNId]
|
||||
['n_id' => $intNId]
|
||||
]
|
||||
];
|
||||
|
||||
@@ -160,6 +184,8 @@ class ChapterModel extends MongoModel
|
||||
'c_sort_num' => 1,
|
||||
'c_page' => 1,
|
||||
];
|
||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
|
||||
$arrChapterAll = $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
return $arrChapterAll[0] ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user