|
@@ -9,7 +9,7 @@ class Source extends Core
|
|
|
{
|
|
|
$channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
|
|
|
# 获取频道信息
|
|
|
- $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
+ $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
|
|
|
$data['channel'] = [
|
|
|
'id' => $channel['id'],
|
|
@@ -43,8 +43,8 @@ class Source extends Core
|
|
|
$source = Dever::input('source', 'is_numeric', '页面来源');
|
|
|
# 搜索历史
|
|
|
$data['history'] = [];
|
|
|
- if ($this->place['uid']) {
|
|
|
- $data['history'] = Dever::db('puser/search')->select(['uid' => $this->place['uid'], 'channel_id' => $channel_id], ['limit' => 10]);
|
|
|
+ if ($this->place->uid) {
|
|
|
+ $data['history'] = Dever::db('puser/search')->select(['uid' => $this->place->uid, 'channel_id' => $channel_id], ['limit' => 10]);
|
|
|
}
|
|
|
|
|
|
# 热门搜索
|
|
@@ -58,14 +58,14 @@ class Source extends Core
|
|
|
$search = Dever::input('search', 'is_string', '搜索词');
|
|
|
$channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
|
|
|
$source = Dever::input('source', 'is_numeric', '页面来源');
|
|
|
- $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
+ $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
$channel['score'] = Dever::load(\Pscore\Lib\Info::class)->get($channel['score_id']);
|
|
|
$channel['scope'] = '1,' . $channel['id'];
|
|
|
- $data['list'] = Dever::load(Psource\Lib\Info::class)->getList($channel, false, 10);
|
|
|
+ $data['list'] = Dever::load(\Psource\Lib\Info::class)->getList($channel, false, 10);
|
|
|
|
|
|
- if ($this->place['uid']) {
|
|
|
+ if ($this->place->uid) {
|
|
|
# 记录历史
|
|
|
- $history = ['uid' => $this->place['uid'], 'channel_id' => $channel_id, 'source' => $source, 'search' => $search];
|
|
|
+ $history = ['uid' => $this->place->uid, 'channel_id' => $channel_id, 'source' => $source, 'search' => $search];
|
|
|
$info = Dever::db('puser/search')->find($history);
|
|
|
if (!$info) {
|
|
|
$history['num'] = 1;
|
|
@@ -74,7 +74,7 @@ class Source extends Core
|
|
|
Dever::db('puser/search')->update($info['id'], ['num' => ['+', 1]]);
|
|
|
}
|
|
|
Dever::db('psource/search')->update(['channel_id' => $channel_id, 'value' => $search], ['num' => ['+', 1]]);
|
|
|
- Dever::load(\Pscore\Lib\Log::class)->action('搜索')->add($this->place['uid']);
|
|
|
+ Dever::load(\Pscore\Lib\Log::class)->action('搜索')->add($this->place->uid);
|
|
|
}
|
|
|
|
|
|
# 搜索页轮播图、搜索页信息流
|
|
@@ -89,7 +89,7 @@ class Source extends Core
|
|
|
{
|
|
|
$channel_id = Dever::input('channel_id', 'is_numeric', '频道ID');
|
|
|
# 获取频道信息
|
|
|
- $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
+ $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($channel_id);
|
|
|
|
|
|
$data['channel'] = [
|
|
|
'id' => $channel['id'],
|
|
@@ -115,7 +115,7 @@ class Source extends Core
|
|
|
$show = Dever::input('show');
|
|
|
$cate_id = Dever::input('id', 'is_numeric', '分类ID');
|
|
|
$cate = Dever::load(\Psource\Lib\Cate::class)->getInfo($cate_id);
|
|
|
- $data['list'] = Dever::load(Psource\Lib\Info::class)->getList($cate, false, 10);
|
|
|
+ $data['list'] = Dever::load(\Psource\Lib\Info::class)->getList($cate, false, 10);
|
|
|
if ($show == 2) {
|
|
|
# 仅展示分类列表
|
|
|
return $data;
|
|
@@ -126,7 +126,7 @@ class Source extends Core
|
|
|
'desc' => $cate['desc'],
|
|
|
];
|
|
|
|
|
|
- $channel = Dever::load(Psource\Lib\Channel::class)->getInfo($cate['channel_id']);
|
|
|
+ $channel = Dever::load(\Psource\Lib\Channel::class)->getInfo($cate['channel_id']);
|
|
|
|
|
|
$data['channel'] = [
|
|
|
'id' => $channel['id'],
|
|
@@ -158,8 +158,8 @@ class Source extends Core
|
|
|
public function info()
|
|
|
{
|
|
|
$source_id = Dever::input('id', 'is_numeric', '资源ID');
|
|
|
- $info = Dever::load(Psource\Lib\Info::class)->getInfo($source_id);
|
|
|
- $data['user'] = $this->place['user'];
|
|
|
+ $info = Dever::load(\Psource\Lib\Info::class)->getInfo($this->place->uid, $source_id);
|
|
|
+ $data['user'] = $this->place->user;
|
|
|
$data['info'] = [
|
|
|
'id' => $info['id'],
|
|
|
'cate_id' => $info['cate_id'],
|
|
@@ -200,9 +200,9 @@ class Source extends Core
|
|
|
}*/
|
|
|
|
|
|
# 获取评价
|
|
|
- $data['review'] = Act::load('review', 1, $source_id)->getList(['limit' => 3], 'content,pic,rate,open');
|
|
|
+ $data['review'] = Act::load('review', $this->place->uid, 1, $source_id)->getList(['limit' => 3], 'content,pic,rate,open');
|
|
|
# 评价总数
|
|
|
- $data['review_total'] = Act::load('review', 1, $source_id)->getTotal();
|
|
|
+ $data['review_total'] = Act::load('review', $this->place->uid, 1, $source_id)->getTotal();
|
|
|
|
|
|
# 详情页轮播、详情页信息流
|
|
|
$data['ad'] = Dever::load(\Ppage\Lib\Ad::class)->gets([21,22], $info['channel_id'], $info['cate_parent_id']);
|
|
@@ -214,7 +214,7 @@ class Source extends Core
|
|
|
public function sku()
|
|
|
{
|
|
|
$source_id = Dever::input('id', 'is_numeric', '资源ID');
|
|
|
- $data['sku'] = Dever::load(Psource\Lib\Info::class)->getSku($source_id);
|
|
|
+ $data['sku'] = Dever::load(\Psource\Lib\Info::class)->getSku($source_id);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
@@ -222,7 +222,7 @@ class Source extends Core
|
|
|
public function content()
|
|
|
{
|
|
|
$source_id = Dever::input('id', 'is_numeric', '资源ID');
|
|
|
- $source = Dever::load(Psource\Lib\Info::class)->getBaseInfo($source_id);
|
|
|
+ $source = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($source_id);
|
|
|
list($data['top'], $data['cate_id']) = Dever::load(\Psource\Lib\Content::class)->getCate($source_id);
|
|
|
|
|
|
$data['top'] = array_merge([['id' => 0, 'name' => '全部']], $data['top']);
|
|
@@ -246,14 +246,14 @@ class Source extends Core
|
|
|
{
|
|
|
$content_id = Dever::input('id', 'is_numeric', '内容ID');
|
|
|
$data['content'] = Dever::load(\Psource\Lib\Content::class)->getInfo($content_id);
|
|
|
- $data['source'] = Dever::load(Psource\Lib\Info::class)->getBaseInfo($data['content']['info_id']);
|
|
|
+ $data['source'] = Dever::load(\Psource\Lib\Info::class)->getBaseInfo($data['content']['info_id']);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
# 确认支付
|
|
|
public function payConfirm()
|
|
|
{
|
|
|
- if (!$this->place['uid']) {
|
|
|
+ if (!$this->place->uid) {
|
|
|
$this->showLogin();
|
|
|
}
|
|
|
$this->showBindMobile();
|
|
@@ -269,7 +269,7 @@ class Source extends Core
|
|
|
if (!isset($source[0])) {
|
|
|
Dever::error('资源不存在');
|
|
|
}
|
|
|
- $data = Dever::load(\Porder\Lib\Source\Pay::class)->init($this->place['uid'], $this->sector['id'], $this->place)->get($source, $cate);
|
|
|
+ $data = Dever::load(\Porder\Lib\Source\Pay::class)->get($source, $cate);
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
@@ -285,7 +285,7 @@ class Source extends Core
|
|
|
{
|
|
|
$source_id = Dever::input('source_id', 'is_numeric', '资源ID');
|
|
|
$num = Dever::input('num', 'is_numeric', '分页条数', 10);
|
|
|
- $data = Act::load('review', 1, $source_id)->getList(['num' => $num], 'content,pic,rate,open');
|
|
|
+ $data = Act::load('review', $this->place->uid, 1, $source_id)->getList(['num' => $num], 'content,pic,rate,open');
|
|
|
$result['list'] = $data;
|
|
|
$result['total'] = Dever::page('total');
|
|
|
return $result;
|
|
@@ -294,7 +294,7 @@ class Source extends Core
|
|
|
# 资源订单列表
|
|
|
public function getOrderList()
|
|
|
{
|
|
|
- $where['uid'] = $this->place['uid'];
|
|
|
+ $where['uid'] = $this->place->uid;
|
|
|
$set['num'] = 10;
|
|
|
$set['col'] = 'id,order_num,source_id,name,cash,num,cdate,status';
|
|
|
$status = Dever::input('status');
|