|
@@ -37,6 +37,12 @@ class Api extends Core
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # 获取分享的链接
|
|
|
|
+ public function getShare()
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
# 获取合集内容
|
|
# 获取合集内容
|
|
public function getInfo()
|
|
public function getInfo()
|
|
{
|
|
{
|
|
@@ -80,7 +86,7 @@ class Api extends Core
|
|
} else {
|
|
} else {
|
|
# 获取最新的章节页id
|
|
# 获取最新的章节页id
|
|
$page_where['info_id'] = $data['info']['id'];
|
|
$page_where['info_id'] = $data['info']['id'];
|
|
- $page_where = $this->getTimes($page_where);
|
|
|
|
|
|
+ $page_where = $this->getTimesId($page_where);
|
|
$page = Dever::db('collection/page')->child($page_where);
|
|
$page = Dever::db('collection/page')->child($page_where);
|
|
$parent_page_id = $page_id = 0;
|
|
$parent_page_id = $page_id = 0;
|
|
if ($page) {
|
|
if ($page) {
|
|
@@ -116,6 +122,8 @@ class Api extends Core
|
|
|
|
|
|
# 获取每个模块
|
|
# 获取每个模块
|
|
$data['items'] = Dever::load('collection/lib/content')->getList($this->id, $this->page_id);
|
|
$data['items'] = Dever::load('collection/lib/content')->getList($this->id, $this->page_id);
|
|
|
|
+ # 滑动到多少时,加载下一页
|
|
|
|
+ $data['total'] = count($data['items']) - 2;
|
|
|
|
|
|
|
|
|
|
$data['func'] = $this->getFunc();
|
|
$data['func'] = $this->getFunc();
|
|
@@ -190,7 +198,7 @@ class Api extends Core
|
|
}
|
|
}
|
|
|
|
|
|
# 获取合集下的分类
|
|
# 获取合集下的分类
|
|
- public function category()
|
|
|
|
|
|
+ public function getCategory()
|
|
{
|
|
{
|
|
$parent_page_id = $this->parent_page_id;
|
|
$parent_page_id = $this->parent_page_id;
|
|
$page_id = $this->page_id;
|
|
$page_id = $this->page_id;
|
|
@@ -198,8 +206,15 @@ class Api extends Core
|
|
$data['cate'] = Dever::db('collection/page')->main($where);
|
|
$data['cate'] = Dever::db('collection/page')->main($where);
|
|
if ($data['cate']) {
|
|
if ($data['cate']) {
|
|
$content = Dever::db('collection/content')->child($where);
|
|
$content = Dever::db('collection/content')->child($where);
|
|
|
|
+ $page = Dever::db('collection/page')->one($page_id);
|
|
|
|
+
|
|
|
|
+ # 步长
|
|
|
|
+ $data['num'] = 0;
|
|
|
|
+ if ($page && $page['desc']) {
|
|
|
|
+ $data['num'] = 1;
|
|
|
|
+ }
|
|
|
|
|
|
- $where = $this->getTimes($where);
|
|
|
|
|
|
+ $where = $this->getTimesId($where);
|
|
$data['child'] = Dever::db('collection/page')->child($where);
|
|
$data['child'] = Dever::db('collection/page')->child($where);
|
|
|
|
|
|
$data['show'] = array();
|
|
$data['show'] = array();
|
|
@@ -222,7 +237,7 @@ class Api extends Core
|
|
}
|
|
}
|
|
|
|
|
|
# 获取合集下的时光
|
|
# 获取合集下的时光
|
|
- public function times()
|
|
|
|
|
|
+ public function getTimes()
|
|
{
|
|
{
|
|
$where['info_id'] = $this->id;
|
|
$where['info_id'] = $this->id;
|
|
$data['cur'] = $this->times;
|
|
$data['cur'] = $this->times;
|
|
@@ -261,7 +276,7 @@ class Api extends Core
|
|
$where['page_id'] = $this->page_id;
|
|
$where['page_id'] = $this->page_id;
|
|
$where['times_id'] = $this->times;
|
|
$where['times_id'] = $this->times;
|
|
$where['content_id'] = Dever::input('content_id');
|
|
$where['content_id'] = Dever::input('content_id');
|
|
- $where['index'] = Dever::input('index');
|
|
|
|
|
|
+ $where['index'] = Dever::input('index', 0);
|
|
if ($record) {
|
|
if ($record) {
|
|
$where['where_id'] = $record['id'];
|
|
$where['where_id'] = $record['id'];
|
|
Dever::db('collection/user_record')->update($where);
|
|
Dever::db('collection/user_record')->update($where);
|
|
@@ -341,8 +356,8 @@ class Api extends Core
|
|
return $result;
|
|
return $result;
|
|
}
|
|
}
|
|
|
|
|
|
- # 获取时光
|
|
|
|
- private function getTimes($where)
|
|
|
|
|
|
+ # 获取时光id
|
|
|
|
+ private function getTimesId($where)
|
|
{
|
|
{
|
|
# 获取当前年份的最新的时光
|
|
# 获取当前年份的最新的时光
|
|
if (!$this->times) {
|
|
if (!$this->times) {
|