debug
This commit is contained in:
@@ -70,4 +70,10 @@ class CategoryModel extends MongoModel
|
||||
{
|
||||
return self::$arrWomen;
|
||||
}
|
||||
|
||||
static public function getPinYinByZh(string $strZh)
|
||||
{
|
||||
$intKey = array_search($strZh, self::$arrCategory);
|
||||
return self::$arrCategoryPinYin[$intKey];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ class ChapterModel extends MongoModel
|
||||
$arrChapter['content'] = StorageCore::getInstance()->read($arrChapter['c_content_path']);
|
||||
}
|
||||
|
||||
|
||||
return $arrChapter;
|
||||
}
|
||||
|
||||
@@ -78,8 +77,6 @@ class ChapterModel extends MongoModel
|
||||
|
||||
$arrOptions['limit'] = $intCount;
|
||||
|
||||
$arrFilter = [];
|
||||
|
||||
$Cursor = $this->getCol()->find($arrFilter, $arrOptions);
|
||||
|
||||
$arrResult = iterator_to_array($Cursor);
|
||||
@@ -95,4 +92,74 @@ class ChapterModel extends MongoModel
|
||||
|
||||
return $arrResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param integer $intNId
|
||||
* @param integer $intCSortNum
|
||||
* @param integer $intCPage
|
||||
* @return null|array
|
||||
*/
|
||||
public function getPreChapter(int $intNId, int $intCSortNum, int $intCPage): null|array
|
||||
{
|
||||
$arrFilter = [
|
||||
'$and' => [
|
||||
[
|
||||
'$or' => [
|
||||
['c_sort_num' => ['$lt' => $intCSortNum]],
|
||||
[
|
||||
'$and' => [
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$lt' => $intCPage]]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
['n_id' => $intNId]
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
$arrSort = [
|
||||
'c_sort_num' => -1,
|
||||
'c_page' => -1,
|
||||
];
|
||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @param integer $intNId
|
||||
* @param integer $intCSortNum
|
||||
* @param integer $intCPage
|
||||
* @return null|array
|
||||
*/
|
||||
public function getNextChapter(int $intNId, int $intCSortNum, int $intCPage): null|array
|
||||
{
|
||||
$arrFilter = [
|
||||
'$and' => [
|
||||
[
|
||||
'$or' => [
|
||||
['c_sort_num' => ['$gt' => $intCSortNum]],
|
||||
[
|
||||
'$and' => [
|
||||
['c_sort_num' => ['$eq' => $intCSortNum]],
|
||||
['c_page' => ['$gt' => $intCPage]]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
['n_id' => $intNId]
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
$arrSort = [
|
||||
'c_sort_num' => 1,
|
||||
'c_page' => 1,
|
||||
];
|
||||
return $this->getChapterAll($arrFilter, 1, $arrSort);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,12 +102,13 @@ class NovelModel extends MongoModel
|
||||
foreach ($arrResult as &$arrItem) {
|
||||
|
||||
applyToKeys($arrItem, ['created_at', 'updated_at'], 'formatMongoDate');
|
||||
|
||||
}
|
||||
|
||||
return $arrResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user