|
@@ -40,6 +40,11 @@ class Api extends Core
|
|
|
return $file['url'];
|
|
|
}
|
|
|
|
|
|
+ private function checkInfo()
|
|
|
+ {
|
|
|
+ return Dever::db('collection/info')->one($this->id);
|
|
|
+ }
|
|
|
+
|
|
|
# 获取分享的内容
|
|
|
public function getShare()
|
|
|
{
|
|
@@ -48,7 +53,7 @@ class Api extends Core
|
|
|
$index = Dever::input('index');
|
|
|
$content_id = Dever::input('content_id');
|
|
|
$data = array();
|
|
|
- $info = Dever::db('collection/info')->one($this->id);
|
|
|
+ $info = $this->checkInfo();
|
|
|
$data['info'] = $data['pic'] = $data['text'] = $data['share'] = array();
|
|
|
$data['info']['id'] = $content_id;
|
|
|
$data['info']['platform_name'] = $info['name'];
|
|
@@ -142,13 +147,25 @@ class Api extends Core
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
+ # 获取合集的基本信息
|
|
|
+ public function getConfig()
|
|
|
+ {
|
|
|
+ $config = Dever::load('main/api')->config();
|
|
|
+ $data['info'] = $this->checkInfo();
|
|
|
+ if (!$data['info']['logo']) {
|
|
|
+ $data['info']['logo'] = $config['system_logo'];
|
|
|
+ }
|
|
|
+
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
+
|
|
|
# 获取合集内容
|
|
|
public function getInfo()
|
|
|
{
|
|
|
# 是否已经购买
|
|
|
$data['is_buy'] = false;
|
|
|
|
|
|
- $data['info'] = Dever::db('collection/info')->one($this->id);
|
|
|
+ $data['info'] = $this->checkInfo();
|
|
|
if ($data['info']) {
|
|
|
$data['info']['user'] = array();
|
|
|
if ($data['info']['uid'] > 0) {
|
|
@@ -206,7 +223,7 @@ class Api extends Core
|
|
|
$data['times_id'] = $this->times;
|
|
|
# 获取用户信息
|
|
|
$data['user'] = $this->user;
|
|
|
- $data['info'] = Dever::db('collection/info')->one($this->id);
|
|
|
+ $data['info'] = $this->checkInfo();
|
|
|
# 获取按钮样式
|
|
|
$data['info']['button'] = $this->button($data['info']);
|
|
|
# 是否可以看
|
|
@@ -225,7 +242,7 @@ class Api extends Core
|
|
|
# 获取合集下的购买内容
|
|
|
public function getBuy()
|
|
|
{
|
|
|
- $data['info'] = Dever::db('collection/info')->one($this->id);
|
|
|
+ $data['info'] = $this->checkInfo();
|
|
|
$where['info_id'] = $this->id;
|
|
|
$data['buy'] = Dever::db('collection/buy')->getAll($where);
|
|
|
|