切换导航条
此项目
正在载入...
登录
景龙
/
feifangu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
jinglong
5 years ago
提交
bb150ce2afb168e043ca12a23ba2f9e875946260
1 个父辈
59fc028d
1 个管道 的构建
通过
耗费 1 秒
修改我的收藏列表
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
52 行增加
和
4 行删除
application/api/controller/User.php
application/api/controller/User.php
查看文件 @
bb150ce
...
...
@@ -326,10 +326,58 @@ class User extends Api
$this
->
error
(
$validate
->
getError
());
}
$res
=
Common
::
selectWhereData
(
'collection'
,[
'uid'
=>
$this
->
uid
],
'id,g_id'
);
$goods_ids
=
array_column
(
$res
,
'g_id'
);
$res1
=
Common
::
goodsList
([
'id'
=>
[
'in'
,
$goods_ids
]],
$page
,
$this
->
uid
);
$this
->
success
(
'成功'
,
$res1
);
$is_news
=
Common
::
is_new
(
$this
->
uid
);
$limit
=
config
(
'verify.limit'
);
$where
=
[
'uid'
=>
$this
->
uid
];
if
(
$is_news
==
1
){
//旧人
$where
[
'is_new'
]
=
0
;
}
$res
=
Db
::
name
(
'collection'
)
->
alias
(
'c'
)
->
join
(
'goods g'
,
'c.g_id = g.id'
)
->
where
(
$where
)
->
field
(
'g.id,g.image,g.name,g.tag,g.style,g.sale_price1 sale_price,g.expense_price,g.is_new'
)
->
page
(
$page
,
$limit
)
->
order
(
'c.id desc'
)
->
useSoftDelete
(
'g.deletetime'
)
->
select
();
foreach
(
$res
as
&
$value
){
if
(
$is_news
==
2
||
$is_news
==
0
){
//未登录或者新人
if
(
$value
[
'is_new'
]
==
0
){
//非新人优惠标签
$value
[
'is_new_tag'
]
=
0
;
//不用显示新人价标签
}
else
{
//新人优惠标签
$value
[
'is_new_tag'
]
=
1
;
//显示新人价标签
}
}
else
{
$value
[
'is_new_tag'
]
=
0
;
//不用显示新人价标签(新人价标签商品不会出来)
}
$value
[
'image'
]
=
Common
::
absolutionUrlOne
(
$value
[
'image'
]);
$value
[
'style'
]
=
explode
(
'|'
,
$value
[
'style'
]);
$value
[
'tag'
]
=
explode
(
'|'
,
$value
[
'tag'
]);
$sale_price
=
Common
::
salePrice
(
$value
[
'sale_price'
]);
if
(
$sale_price
){
$value
[
'sale_price'
]
=
$sale_price
[
0
];
}
else
{
$value
[
'sale_price'
]
=
''
;
}
unset
(
$value
[
'is_new'
]);
}
$arr
[
'data'
]
=
$res
;
//总页数
$count
=
Db
::
name
(
'collection'
)
->
alias
(
'c'
)
->
join
(
'goods g'
,
'c.g_id = g.id'
)
->
where
(
$where
)
->
order
(
'c.id desc'
)
->
useSoftDelete
(
'g.deletetime'
)
->
count
();
$arr
[
'total_page'
]
=
ceil
(
$count
/
$limit
);
$this
->
success
(
'成功'
,
$arr
);
}
else
{
$this
->
error
(
'请求方式错误'
);
}
...
...
请
注册
或
登录
后发表评论