Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
7e209898
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
7e209898
编写于
4月 11, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
搜索参数类型控制
上级
922b0323
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
46 addition
and
3 deletion
+46
-3
application/admin/controller/Site.php
application/admin/controller/Site.php
+8
-0
application/admin/view/default/site/siteset/search.html
application/admin/view/default/site/siteset/search.html
+8
-0
application/admin/view/default/sqlconsole/index.html
application/admin/view/default/sqlconsole/index.html
+1
-1
application/service/ConfigService.php
application/service/ConfigService.php
+1
-0
application/service/SearchService.php
application/service/SearchService.php
+28
-2
未找到文件。
application/admin/controller/Site.php
浏览文件 @
7e209898
...
...
@@ -179,6 +179,9 @@ class Site extends Common
// 首页楼层数据类型
$this
->
assign
(
'common_site_floor_data_type_list'
,
lang
(
'common_site_floor_data_type_list'
));
// 搜索参数类型
$this
->
assign
(
'common_goods_parameters_type_list'
,
lang
(
'common_goods_parameters_type_list'
));
// 主导航
$this
->
assign
(
'second_nav_list'
,
[
[
...
...
@@ -334,6 +337,11 @@ class Site extends Common
// 楼层左侧分类
$params
[
'home_index_floor_left_top_category'
]
=
empty
(
$params
[
'home_index_floor_left_top_category'
])
?
''
:
json_encode
(
$params
[
'home_index_floor_left_top_category'
],
JSON_UNESCAPED_UNICODE
);
break
;
// 搜索
case
'search'
:
$field_list
[]
=
'home_search_params_type'
;
break
;
}
break
;
...
...
application/admin/view/default/site/siteset/search.html
浏览文件 @
7e209898
...
...
@@ -76,6 +76,14 @@
{{/foreach}}
</select>
</div>
<div
class=
"am-form-group"
>
<label>
{{$data.home_search_params_type.name}}
<span
class=
"am-form-group-label-tips"
>
{{$data.home_search_params_type.describe}}
</span></label>
<select
name=
"{{$data.home_search_params_type.only_tag}}"
multiple=
"multiple"
class=
"am-radius chosen-select"
data-placeholder=
"{{$data.home_search_params_type.name}}"
data-validation-message=
"{{$data.home_search_params_type.error_tips}}"
>
{{foreach $common_goods_parameters_type_list as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
data
['
home_search_params_type
']['
value
'])
and
in_array
($
v
['
value
'],
$
data
['
home_search_params_type
']['
value
'])}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
</select>
</div>
<div
class=
"am-form-group"
>
<label>
{{$data.home_search_is_spec.name}}
<span
class=
"am-form-group-label-tips"
>
{{$data.home_search_is_spec.describe}}
</span></label>
<select
name=
"{{$data.home_search_is_spec.only_tag}}"
class=
"am-radius chosen-select"
data-validation-message=
"{{$data.home_search_is_spec.error_tips}}"
required
>
...
...
application/admin/view/default/sqlconsole/index.html
浏览文件 @
7e209898
...
...
@@ -11,7 +11,7 @@
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:MyUrl('admin/sqlconsole/implement')}}"
method=
"POST"
request-type=
"ajax-fun"
request-value=
"ViewImplementBack"
>
<div
class=
"am-form-group"
>
<textarea
rows=
"6"
name=
"sql"
class=
"am-radius"
placeholder=
"SQL语句"
data-validation-message=
"请填写需要执行的SQL语句"
required
></textarea>
<textarea
rows=
"
1
6"
name=
"sql"
class=
"am-radius"
placeholder=
"SQL语句"
data-validation-message=
"请填写需要执行的SQL语句"
required
></textarea>
</div>
<div
class=
"am-form-group am-form-group-refreshing am-margin-top-lg am-padding-left-0"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block"
data-am-loading=
"{loadingText:'处理中...'}"
>
执行
</button>
...
...
application/service/ConfigService.php
浏览文件 @
7e209898
...
...
@@ -60,6 +60,7 @@ class ConfigService
'home_user_login_type'
,
'home_user_reg_type'
,
'admin_login_type'
,
'home_search_params_type'
,
];
/**
...
...
application/service/SearchService.php
浏览文件 @
7e209898
...
...
@@ -259,7 +259,7 @@ class SearchService
}
if
(
!
empty
(
$params
[
'goods_params_values'
]))
{
$ids
=
Db
::
name
(
'GoodsParams'
)
->
where
([
'value'
=>
$params
[
'goods_params_values'
],
'type'
=>
2
])
->
column
(
'goods_id'
);
$ids
=
Db
::
name
(
'GoodsParams'
)
->
where
([
'value'
=>
$params
[
'goods_params_values'
],
'type'
=>
self
::
SearchParamsWhereTypeValue
()
])
->
column
(
'goods_id'
);
if
(
!
empty
(
$ids
))
{
$where_base
[]
=
[
'g.id'
,
'in'
,
$ids
];
...
...
@@ -291,6 +291,32 @@ class SearchService
];
}
/**
* 参数搜索条件类型
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-04-11
* @desc description
*/
public
static
function
SearchParamsWhereTypeValue
()
{
// 获取配置
$value
=
MyC
(
'home_search_params_type'
);
if
(
empty
(
$value
))
{
$value
=
[
2
];
}
// 是否为数组
if
(
!
is_array
(
$value
))
{
$value
=
explode
(
','
,
$value
);
}
return
$value
;
}
/**
* 搜索记录添加
* @author Devil
...
...
@@ -480,7 +506,7 @@ class SearchService
$where_screening_price
=
$where
[
'screening_price'
];
// 仅搜索基础参数
$where_base
[]
=
[
'gp.type'
,
'
='
,
2
];
$where_base
[]
=
[
'gp.type'
,
'
in'
,
self
::
SearchParamsWhereTypeValue
()
];
// 一维数组、参数值去重
$data
=
Db
::
name
(
'Goods'
)
->
alias
(
'g'
)
->
join
([
'__GOODS_CATEGORY_JOIN__'
=>
'gci'
],
'g.id=gci.goods_id'
)
->
join
([
'__GOODS_PARAMS__'
=>
'gp'
],
'g.id=gp.goods_id'
)
->
where
(
$where_base
)
->
where
(
function
(
$query
)
use
(
$where_keywords
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录