|
@@ -21,6 +21,22 @@ class Api extends Core
|
|
return Dever::db('collection/info')->state();
|
|
return Dever::db('collection/info')->state();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # 获取用户信息
|
|
|
|
+ public function getUser()
|
|
|
|
+ {
|
|
|
|
+ $data['user'] = $this->user;
|
|
|
|
+
|
|
|
|
+ $data['num'] = array
|
|
|
|
+ (
|
|
|
|
+ array('¥199', '', '钱包'),
|
|
|
|
+ array('200', '', '金币'),
|
|
|
|
+ array('10', '', '好友'),
|
|
|
|
+ array('30', '', '动态'),
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
# 获取合集内容
|
|
# 获取合集内容
|
|
public function getInfo()
|
|
public function getInfo()
|
|
{
|
|
{
|
|
@@ -131,8 +147,20 @@ class Api extends Core
|
|
{
|
|
{
|
|
$where['info_id'] = $this->id;
|
|
$where['info_id'] = $this->id;
|
|
$data['product'] = Dever::db('collection/product')->getAll($where);
|
|
$data['product'] = Dever::db('collection/product')->getAll($where);
|
|
- if ($data['product']) {
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 获取某一个商品详情
|
|
|
|
+ public function getProductOne()
|
|
|
|
+ {
|
|
|
|
+ $where['id'] = Dever::input('product_id');
|
|
|
|
+ $table = Dever::input('table');
|
|
|
|
+ $data['product'] = Dever::db($table)->one($where);
|
|
|
|
+
|
|
|
|
+ if ($data['product'] && isset($data['product']['goods_id']) && $data['product']['goods_id'] > 0) {
|
|
|
|
+ $data['product']['goods'] = Dever::load('goods/lib/info')->getInfo($data['product']['goods_id']);
|
|
|
|
+ $data['product']['goods'] = Dever::load('collection/lib/content')->getContent($data['product']['goods']);
|
|
}
|
|
}
|
|
|
|
|
|
return $data;
|
|
return $data;
|
|
@@ -284,13 +312,19 @@ class Api extends Core
|
|
$result = array();
|
|
$result = array();
|
|
if ($func) {
|
|
if ($func) {
|
|
foreach ($func as $k => $v) {
|
|
foreach ($func as $k => $v) {
|
|
|
|
+ $v['direction'] = strtolower($v['direction']);
|
|
|
|
+ if ($v['direction'] == 'left') {
|
|
|
|
+ $v['width'] = '86';
|
|
|
|
+ } else {
|
|
|
|
+ $v['width'] = '100';
|
|
|
|
+ }
|
|
$result[$v['type']] = array
|
|
$result[$v['type']] = array
|
|
(
|
|
(
|
|
'show' => false,
|
|
'show' => false,
|
|
'index' => 5,
|
|
'index' => 5,
|
|
'top' => 0,
|
|
'top' => 0,
|
|
'padding' => '0rpx',
|
|
'padding' => '0rpx',
|
|
- 'width' => $v['width'],
|
|
|
|
|
|
+ 'width' => $v['width'] . '%',
|
|
'direction' => strtolower($v['direction']),
|
|
'direction' => strtolower($v['direction']),
|
|
'param' => array(),
|
|
'param' => array(),
|
|
'button' => array
|
|
'button' => array
|