Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jamesyang1999
ShopXO
提交
6096edde
ShopXO
项目概览
jamesyang1999
/
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,体验更适合开发者的 AI 搜索 >>
提交
6096edde
编写于
12月 29, 2020
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
地区新增全量数据接口
上级
14ac66a9
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
200 addition
and
48 deletion
+200
-48
application/api/controller/Region.php
application/api/controller/Region.php
+19
-5
application/index/controller/Region.php
application/index/controller/Region.php
+14
-1
application/index/view/default/index/index.html
application/index/view/default/index/index.html
+1
-14
application/index/view/default/public/home_banner.html
application/index/view/default/public/home_banner.html
+1
-3
application/index/view/default/public/home_nav.html
application/index/view/default/public/home_nav.html
+26
-0
application/service/AppHomeNavService.php
application/service/AppHomeNavService.php
+14
-0
application/service/RegionService.php
application/service/RegionService.php
+76
-0
application/tags.php
application/tags.php
+46
-25
config/shopxo.php
config/shopxo.php
+3
-0
未找到文件。
application/api/controller/Region.php
浏览文件 @
6096edde
...
...
@@ -35,11 +35,12 @@ class Region extends Common
}
/**
* [Index 获取地区]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2018-04-08T15:08:01+0800
* 获取地区节点
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
*/
public
function
Index
()
{
...
...
@@ -52,5 +53,18 @@ class Region extends Common
$data
=
RegionService
::
RegionNode
(
$params
);
return
DataReturn
(
'success'
,
0
,
$data
);
}
/**
* 获取地区所有数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
*/
public
function
All
()
{
return
RegionService
::
RegionAll
();
}
}
?>
\ No newline at end of file
application/index/controller/Region.php
浏览文件 @
6096edde
...
...
@@ -35,7 +35,7 @@ class Region extends Common
}
/**
* 获取地区
* 获取地区
节点
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -59,5 +59,18 @@ class Region extends Common
$data
=
RegionService
::
RegionNode
(
$params
);
return
DataReturn
(
'操作成功'
,
0
,
$data
);
}
/**
* 获取地区所有数据
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
*/
public
function
All
()
{
return
RegionService
::
RegionAll
();
}
}
?>
\ No newline at end of file
application/index/view/default/index/index.html
浏览文件 @
6096edde
...
...
@@ -22,20 +22,7 @@
<!-- 轮播上内容 -->
<div
class=
"am-container slideall"
>
<!-- 轮播-手机导航 -->
{{if !empty($navigation)}}
<div
class=
"am-g am-g-fixed small-nav"
>
{{foreach $navigation as $nav}}
<div
class=
"am-u-sm-3"
>
<a
{{
if
$
nav
['
is_need_login
']
eq
1
and
empty
($
user
)}}
href=
"javascript:;"
class=
"login-event"
{{
else
/}}
href=
"{{$nav.event_value}}"
{{/
if
}}
>
<div
class=
"nav-icon"
style=
"{{if !empty($nav['bg_color'])}}background:{{$nav.bg_color}};{{/if}}"
>
<img
src=
"{{$nav.images_url}}"
alt=
"{{$nav.name}}"
/>
</div>
<div
class=
"mini-nav-title"
>
{{$nav.name}}
</div>
</a>
</div>
{{/foreach}}
</div>
{{/if}}
{{include file="public/home_nav" /}}
<!-- 轮播-聚合内容 -->
{{if MyC('home_index_banner_right_status', 1) eq 1}}
...
...
application/index/view/default/public/home_banner.html
浏览文件 @
6096edde
<!-- 首页轮播 start -->
<div
class=
"banner"
>
<div
data-am-widget=
"slider"
class=
"am-slider am-slider-a1"
data-am-slider=
'{"directionNav":false}'
>
<ul
class=
"am-slides"
>
...
...
@@ -25,5 +24,4 @@
{{/if}}
</ul>
</div>
</div>
<!-- 首页轮播 end -->
\ No newline at end of file
</div>
\ No newline at end of file
application/index/view/default/public/home_nav.html
0 → 100644
浏览文件 @
6096edde
{{if !empty($navigation)}}
<div
class=
"am-g am-g-fixed small-nav"
>
{{foreach $navigation as $nav}}
<div
class=
"am-u-sm-3"
>
{{switch nav.event_type}}
{{case 3}}
<!-- 地图 -->
<a
href=
"javascript:;"
{{
if
$
nav
['
is_need_login
']
eq
1
and
empty
($
user
)}}
class=
"login-event"
{{
else
/}}{{
if
!
empty
($
nav
['
event_value_data
'])
and
!
empty
($
nav
['
event_value_data
'][2])
and
!
empty
($
nav
['
event_value_data
'][3])}}
class=
"submit-map-popup"
data-lng=
"{{$nav['event_value_data'][2]}}"
data-lat=
"{{$nav['event_value_data'][3]}}"
{{/
if
}}{{/
if
}}
>
{{/case}}
{{case 4}}
<!-- 电话 -->
<a
{{
if
$
nav
['
is_need_login
']
eq
1
and
empty
($
user
)}}
href=
"javascript:;"
class=
"login-event"
{{
else
/}}{{
if
!
empty
($
nav
['
event_value
'])}}
href=
"tel:{{$nav.event_value}}"
{{
else
/}}
href=
"javascript:;"
{{/
if
}}{{/
if
}}
>
{{/case}}
{{default /}}
<!-- 默认url地址 -->
<a
{{
if
$
nav
['
is_need_login
']
eq
1
and
empty
($
user
)}}
href=
"javascript:;"
class=
"login-event"
{{
else
/}}{{
if
!
empty
($
nav
['
event_value
'])}}
href=
"{{$nav.event_value}}"
target=
"_blank"
{{
else
/}}
href=
"javascript:;"
{{/
if
}}{{/
if
}}
>
{{/switch}}
<div
class=
"nav-icon"
style=
"{{if !empty($nav['bg_color'])}}background:{{$nav.bg_color}};{{/if}}"
>
<img
src=
"{{$nav.images_url}}"
alt=
"{{$nav.name}}"
/>
</div>
<div
class=
"mini-nav-title"
>
{{$nav.name}}
</div>
</a>
</div>
{{/foreach}}
</div>
{{/if}}
\ No newline at end of file
application/service/AppHomeNavService.php
浏览文件 @
6096edde
...
...
@@ -287,9 +287,23 @@ class AppHomeNavService
{
foreach
(
$data
as
&
$v
)
{
// 图片地址
$v
[
'images_url_old'
]
=
$v
[
'images_url'
];
$v
[
'images_url'
]
=
ResourcesService
::
AttachmentPathViewHandle
(
$v
[
'images_url'
]);
$v
[
'event_value'
]
=
empty
(
$v
[
'event_value'
])
?
null
:
$v
[
'event_value'
];
// 事件值
if
(
!
empty
(
$v
[
'event_value'
]))
{
// 地图
if
(
$v
[
'event_type'
]
==
3
)
{
$v
[
'event_value_data'
]
=
explode
(
'|'
,
$v
[
'event_value'
]);
}
$v
[
'event_value'
]
=
$v
[
'event_value'
];
}
else
{
$v
[
'event_value'
]
=
null
;
}
}
}
...
...
application/service/RegionService.php
浏览文件 @
6096edde
...
...
@@ -225,5 +225,81 @@ class RegionService
$data
=
empty
(
$data
)
?
$ids
:
array_unique
(
array_merge
(
$ids
,
$data
));
return
$data
;
}
/**
* 获取地区所有数据、最多三级
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-12-29
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
RegionAll
(
$params
=
[])
{
// 缓存
$key
=
config
(
'shopxo.cache_region_all_key'
);
$data
=
cache
(
$key
);
if
(
empty
(
$data
))
{
// 所有一级
$field
=
'id,pid,name'
;
$data
=
self
::
RegionNode
([
'field'
=>
$field
,
'where'
=>
[
'pid'
=>
0
]]);
if
(
!
empty
(
$data
))
{
// 所有二级
$two
=
self
::
RegionNode
([
'field'
=>
$field
,
'where'
=>
[
'pid'
=>
array_column
(
$data
,
'id'
)]]);
$two_group
=
[];
$three_group
=
[];
if
(
!
empty
(
$two
))
{
// 所有三级
$three
=
self
::
RegionNode
([
'field'
=>
$field
,
'where'
=>
[
'pid'
=>
array_column
(
$two
,
'id'
)]]);
if
(
!
empty
(
$three
))
{
// 三级集合组
foreach
(
$three
as
$v
)
{
if
(
!
array_key_exists
(
$v
[
'pid'
],
$three_group
))
{
$three_group
[
$v
[
'pid'
]]
=
[];
}
$pid
=
$v
[
'pid'
];
unset
(
$v
[
'pid'
]);
$three_group
[
$pid
][]
=
$v
;
}
}
// 二级集合
foreach
(
$two
as
$v
)
{
// 是否存在三级数据
$v
[
'items'
]
=
array_key_exists
(
$v
[
'id'
],
$three_group
)
?
$three_group
[
$v
[
'id'
]]
:
[];
// 集合组
if
(
!
array_key_exists
(
$v
[
'pid'
],
$two_group
))
{
$two_group
[
$v
[
'pid'
]]
=
[];
}
$pid
=
$v
[
'pid'
];
unset
(
$v
[
'pid'
]);
$two_group
[
$pid
][]
=
$v
;
}
}
// 一级集合
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
'items'
]
=
array_key_exists
(
$v
[
'id'
],
$two_group
)
?
$two_group
[
$v
[
'id'
]]
:
[];
}
// 存储缓存
cache
(
$key
,
$data
,
60
);
}
}
return
DataReturn
(
'success'
,
0
,
$data
);
}
}
?>
\ No newline at end of file
application/tags.php
浏览文件 @
6096edde
...
...
@@ -34,71 +34,92 @@ return array (
),
'plugins_css'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
0
=>
'app\\plugins\\share\\Hook'
,
1
=>
'app\\plugins\\points\\Hook'
,
2
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_js'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
0
=>
'app\\plugins\\share\\Hook'
,
1
=>
'app\\plugins\\points\\Hook'
,
2
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_view_common_bottom'
=>
array
(
0
=>
'app\\plugins\\share\\Hook'
,
),
'plugins_common_page_bottom'
=>
array
(
0
=>
'app\\plugins\\share\\Hook'
,
),
'plugins_view_goods_detail_photo_bottom'
=>
array
(
0
=>
'app\\plugins\\share\\Hook'
,
),
'plugins_service_navigation_header_handle'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_service_
goods_handle_end
'
=>
'plugins_service_
quick_navigation_pc
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\
limitedtimediscount
\\Hook'
,
1
=>
'app\\plugins\\
signin
\\Hook'
,
),
'plugins_
view_buy_form_inside
'
=>
'plugins_
service_quick_navigation_h5
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_
view_buy_base_confirm_top
'
=>
'plugins_
service_quick_navigation_weixin
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_service_
buy_group_goods_handle
'
=>
'plugins_service_
quick_navigation_alipay
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_service_
buy_order_insert_end
'
=>
'plugins_service_
quick_navigation_baidu
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_service_
order_status_change_history_success_handle
'
=>
'plugins_service_
quick_navigation_qq
'
=>
array
(
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_service_quick_navigation_
pc
'
=>
'plugins_service_quick_navigation_
toutiao
'
=>
array
(
0
=>
'app\\plugins\\signin\\Hook'
,
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\signin\\Hook'
,
),
'plugins_service_
quick_navigation_h5
'
=>
'plugins_service_
goods_handle_end
'
=>
array
(
0
=>
'app\\plugins\\signin\\Hook'
,
0
=>
'app\\plugins\\points\\Hook'
,
1
=>
'app\\plugins\\limitedtimediscount\\Hook'
,
),
'plugins_
service_quick_navigation_weixin
'
=>
'plugins_
view_buy_form_inside
'
=>
array
(
0
=>
'app\\plugins\\
signin
\\Hook'
,
0
=>
'app\\plugins\\
points
\\Hook'
,
),
'plugins_
service_quick_navigation_alipay
'
=>
'plugins_
view_buy_base_confirm_top
'
=>
array
(
0
=>
'app\\plugins\\
signin
\\Hook'
,
0
=>
'app\\plugins\\
points
\\Hook'
,
),
'plugins_service_
quick_navigation_baidu
'
=>
'plugins_service_
buy_group_goods_handle
'
=>
array
(
0
=>
'app\\plugins\\
signin
\\Hook'
,
0
=>
'app\\plugins\\
points
\\Hook'
,
),
'plugins_service_
quick_navigation_qq
'
=>
'plugins_service_
buy_order_insert_end
'
=>
array
(
0
=>
'app\\plugins\\
signin
\\Hook'
,
0
=>
'app\\plugins\\
points
\\Hook'
,
),
'plugins_service_
quick_navigation_toutiao
'
=>
'plugins_service_
order_status_change_history_success_handle
'
=>
array
(
0
=>
'app\\plugins\\
signin
\\Hook'
,
0
=>
'app\\plugins\\
points
\\Hook'
,
),
'plugins_service_users_center_left_menu_handle'
=>
array
(
...
...
config/shopxo.php
浏览文件 @
6096edde
...
...
@@ -73,6 +73,9 @@ return [
// 快捷导航缓存信息
'cache_quick_navigation_key'
=>
'cache_quick_navigation_data_'
,
// 地区所有数据缓存、1~3级
'cache_region_all_key'
=>
'cache_region_all_data'
,
// 附件host、最后不要带/斜杠结尾, 数据库图片地址以/static/...开头
'attachment_host'
=>
$cdn_attachment_host
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录