切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
7bcd3b6f97fe4d4edba24fcb95f7ff463ef63565
1 个父辈
af3e5d1a
分享标题和图片
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
29 行增加
和
2 行删除
addons/shopro/model/UserFavorite.php
application/admin/view/shopro/config/platform.html
application/api/controller/Index.php
public/api.html
addons/shopro/model/UserFavorite.php
查看文件 @
7bcd3b6
...
...
@@ -39,12 +39,14 @@ class UserFavorite extends Model
$favorite
=
self
::
get
([
'goods_id'
=>
$goods_id
,
'user_id'
=>
$user
->
id
]);
if
(
$favorite
)
{
$favorite
->
delete
();
Goods
::
where
(
'id'
,
$goods_id
)
->
setDec
(
'likes'
);
return
false
;
}
else
{
self
::
create
([
'user_id'
=>
$user
->
id
,
'goods_id'
=>
$goods_id
]);
Goods
::
where
(
'id'
,
$goods_id
)
->
setInc
(
'likes'
);
return
true
;
}
}
...
...
application/admin/view/shopro/config/platform.html
查看文件 @
7bcd3b6
...
...
@@ -185,7 +185,7 @@
</el-form-item>
</div>
<div
v-if=
"type=='share'"
>
<
!--<
el-form-item label="分享标题:">
<el-form-item
label=
"分享标题:"
>
<el-input
v-model=
"detailForm.title"
placeholder=
"请输入分享标题"
></el-input>
</el-form-item>
<el-form-item
label=
"默认分享图片:"
>
...
...
@@ -205,7 +205,7 @@
</div>
</div>
</el-form-item>
<el-form-item label="商品分享背景:">
<
!--<
el-form-item label="商品分享背景:">
<div class="display-flex">
<div class="platform-images" v-if="detailForm.goods_poster_bg">
<el-image
...
...
application/api/controller/Index.php
查看文件 @
7bcd3b6
...
...
@@ -224,6 +224,31 @@ class Index extends Base
}
/**
* @ApiWeigh (97)
* @ApiTitle (分享标题和图片)
* @ApiSummary (分享标题和图片)
* @ApiMethod (GET)
*
* @ApiReturn({
"code": 1,
"msg": "首页",
"time": "1610097015",
"data": {
"title": "邀请有好礼", //分享标题
"image": "http://api.7wpp.com/uploads/20200414/4be7c944935a0fd6fc890f0214e6c3e0.jpg" //分享图片
}
})
*/
public
function
share
()
{
$share
=
json_decode
(
Config
::
where
([
'name'
=>
'share'
])
->
value
(
'value'
),
true
);
$this
->
success
(
'首页'
,
[
'title'
=>
$share
[
'title'
],
'image'
=>
isset
(
$share
[
'image'
])
?
cdnurl
(
$share
[
'image'
],
true
)
:
''
,
]);
}
/**
* @ApiInternal
* 初始化商城数据
*/
...
...
public/api.html
查看文件 @
7bcd3b6
此 diff 太大无法显示。
请
注册
或
登录
后发表评论