Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
00837624
ShopXO
项目概览
______--______
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
00837624
编写于
5月 05, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品新增seo
上级
cf411547
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
88 addition
and
38 deletion
+88
-38
application/admin/view/default/goods/save_info.html
application/admin/view/default/goods/save_info.html
+16
-0
application/index/controller/Common.php
application/index/controller/Common.php
+3
-1
application/index/controller/Goods.php
application/index/controller/Goods.php
+10
-2
application/index/view/default/public/header.html
application/index/view/default/public/header.html
+2
-2
application/service/GoodsService.php
application/service/GoodsService.php
+16
-0
application/service/SeoService.php
application/service/SeoService.php
+13
-7
config/shopxo.sql
config/shopxo.sql
+28
-26
未找到文件。
application/admin/view/default/goods/save_info.html
浏览文件 @
00837624
...
...
@@ -36,6 +36,9 @@
<li>
<a
href=
"#goods-nav-web"
>
电脑端详情
</a>
</li>
<li>
<a
href=
"#goods-nav-seo"
>
SEO
</a>
</li>
</ul>
</nav>
...
...
@@ -362,6 +365,19 @@
</div>
</div>
<!-- seo -->
<div
id=
"goods-nav-seo"
class=
"division-block"
>
<label
class=
"block nav-detail-title"
>
SEO
</label>
<div
class=
"am-form-group"
>
<label>
SEO关键字
<span
class=
"am-form-group-label-tips"
>
一般不超过100个字符,多个关键字以半圆角逗号 [ , ] 隔开
</span></label>
<input
type=
"text"
name=
"seo_keywords"
placeholder=
"SEO关键字"
maxlength=
"130"
data-validation-message=
"SEO关键字格式 最多130个字符"
class=
"am-radius"
{{
if
!
empty
($
data
)}}
value=
"{{$data.seo_keywords}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label>
SEO描述
<span
class=
"am-form-group-label-tips"
>
一般不超过200个字符
</span></label>
<textarea
rows=
"4"
name=
"seo_desc"
maxlength=
"230"
class=
"am-radius"
placeholder=
"SEO描述"
data-validation-message=
"SEO描述格式 最多230个字符"
>
{{if !empty($data)}}{{$data.seo_desc}}{{/if}}
</textarea>
</div>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<input
type=
"hidden"
name=
"id"
{{
if
!
empty
($
data
)}}
value=
"{{$data.id}}"
{{/
if
}}
/>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
...
...
application/index/controller/Common.php
浏览文件 @
00837624
...
...
@@ -245,8 +245,10 @@ class Common extends Controller
// 图片host地址
$this
->
assign
(
'attachment_host'
,
config
(
'shopxo.attachment_host'
));
//
标题
//
seo
$this
->
assign
(
'home_seo_site_title'
,
MyC
(
'home_seo_site_title'
));
$this
->
assign
(
'home_seo_site_keywords'
,
MyC
(
'home_seo_site_keywords'
));
$this
->
assign
(
'home_seo_site_description'
,
MyC
(
'home_seo_site_description'
));
// 页面最大宽度
$max_width
=
MyC
(
'home_content_max_width'
,
0
,
true
);
...
...
application/index/controller/Goods.php
浏览文件 @
00837624
...
...
@@ -76,8 +76,16 @@ class Goods extends Common
// 商品数据
$this
->
assign
(
'goods'
,
$ret
[
'data'
][
0
]);
// 浏览器名称
$this
->
assign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
0
][
'title'
]));
// seo
$this
->
assign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
0
][
'title'
],
2
));
if
(
!
empty
(
$ret
[
'data'
][
0
][
'seo_keywords'
]))
{
$this
->
assign
(
'home_seo_site_keywords'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
0
][
'seo_keywords'
],
2
));
}
if
(
!
empty
(
$ret
[
'data'
][
0
][
'seo_desc'
]))
{
$this
->
assign
(
'home_seo_site_description'
,
SeoService
::
BrowserSeoTitle
(
$ret
[
'data'
][
0
][
'seo_desc'
],
2
));
}
// 二维码
$this
->
assign
(
'qrcode_url'
,
MyUrl
(
'index/qrcode/index'
,
[
'content'
=>
urlencode
(
base64_encode
(
MyUrl
(
'index/goods/index'
,
[
'id'
=>
$id
],
true
,
true
)))]));
...
...
application/index/view/default/public/header.html
浏览文件 @
00837624
...
...
@@ -3,8 +3,8 @@
<head>
<meta
charset=
"{{:config('shopxo.default_charset', 'utf-8')}}"
/>
<title>
{{$home_seo_site_title}}
</title>
<meta
name=
"keywords"
content=
"{{
:MyC('home_seo_site_keywords')
}}"
/>
<meta
name=
"description"
content=
"{{
:MyC('home_seo_site_description')
}}"
/>
<meta
name=
"keywords"
content=
"{{
$home_seo_site_keywords
}}"
/>
<meta
name=
"description"
content=
"{{
$home_seo_site_description
}}"
/>
<meta
name=
"generator"
content=
"{{:__MY_URL__}}"
/>
<meta
name=
"application-name"
content=
"{{$home_seo_site_title}}"
/>
<meta
name=
"msapplication-tooltip"
content=
"{{$home_seo_site_title}}"
/>
...
...
application/service/GoodsService.php
浏览文件 @
00837624
...
...
@@ -1012,6 +1012,20 @@ class GoodsService
'key_name'
=>
'buy_min_number'
,
'error_msg'
=>
'请填写有效的最低起购数量'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'seo_keywords'
,
'checked_data'
=>
'130'
,
'is_checked'
=>
1
,
'error_msg'
=>
'SEO关键字格式 最多130个字符'
,
],
[
'checked_type'
=>
'length'
,
'key_name'
=>
'seo_desc'
,
'checked_data'
=>
'230'
,
'is_checked'
=>
1
,
'error_msg'
=>
'SEO描述格式 最多230个字符'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
...
...
@@ -1070,6 +1084,8 @@ class GoodsService
'home_recommended_images'
=>
$attachment
[
'data'
][
'home_recommended_images'
],
'brand_id'
=>
isset
(
$params
[
'brand_id'
])
?
intval
(
$params
[
'brand_id'
])
:
0
,
'video'
=>
$attachment
[
'data'
][
'video'
],
'seo_keywords'
=>
empty
(
$params
[
'seo_keywords'
])
?
''
:
$params
[
'seo_keywords'
],
'seo_desc'
=>
empty
(
$params
[
'seo_desc'
])
?
''
:
$params
[
'seo_desc'
],
];
// 启动事务
...
...
application/service/SeoService.php
浏览文件 @
00837624
...
...
@@ -27,7 +27,7 @@ class SeoService
* @date 2019-03-11
* @desc description
* @param [string] $title [标题]
* @param [int] $type
[模式0 使用站点名称, 模式1 使用SEO名称
]
* @param [int] $type
[模式0 使用站点名称, 模式1 使用SEO名称, 模式2 标题,
]
* @return [string] [浏览器seo标题]
*/
public
static
function
BrowserSeoTitle
(
$title
,
$type
=
0
)
...
...
@@ -41,15 +41,21 @@ class SeoService
// 模式
switch
(
$type
)
{
// 模式0 使用站点名称
case
0
:
return
$title
.
' - '
.
MyC
(
'home_site_name'
);
break
;
// 模式1 或 默认使用标题加seo名称
case
1
:
default
:
return
$title
.
' - '
.
MyC
(
'home_seo_site_title'
);
break
;
// 模式2 或 默认使用标题加seo名称
case
2
:
return
$title
;
break
;
// 模式0 使用站点名称
// 默认标题
case
0
:
default
:
return
$title
.
' - '
.
MyC
(
'home_site_name'
);
}
}
}
...
...
config/shopxo.sql
浏览文件 @
00837624
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录