切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
e6ed54b51b396f4ca18b3b33c55b75f9940e2e29
1 个父辈
931598c1
1 个管道 的构建
通过
耗费 1 秒
5
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
21 行增加
和
3 行删除
app/portal/controller/IndexController.php
public/themes/simpleboot3/portal/index/search_salesman_goods.html
app/portal/controller/IndexController.php
查看文件 @
e6ed54b
...
...
@@ -215,6 +215,24 @@ class IndexController extends WeChatBaseController
}
/**
* 首页搜索结果页 价格排序
*/
public
function
search_price_order
(){
$search_content
=
$_POST
[
'search_content'
];
$search_content_data
=
Db
::
name
(
'goods'
)
->
alias
(
'a'
)
->
field
(
"a.*,b.name"
)
->
join
(
'classification b'
,
'a.classify_id = b.id'
,
'LEFT'
)
->
where
(
"type =2 "
)
->
where
(
'book_name'
,
'like'
,
"%"
.
$search_content
.
"%"
)
->
order
(
'price desc'
)
->
select
()
->
toArray
();
if
(
!
empty
(
$search_content_data
)){
foreach
(
$search_content_data
as
$key
=>
$val
){
$price
=
explode
(
'.'
,
$search_content_data
[
$key
][
'price'
]);
$search_content_data
[
$key
][
'price0'
]
=
$price
[
0
];
$search_content_data
[
$key
][
'price1'
]
=
$price
[
1
];
$search_content_data
[
$key
][
'show_img'
]
=
cmf_get_image_url
(
$search_content_data
[
$key
][
'show_img'
]);
}
}
return
json_encode
(
$search_content_data
);
}
...
...
public/themes/simpleboot3/portal/index/search_salesman_goods.html
查看文件 @
e6ed54b
...
...
@@ -102,14 +102,14 @@
*价格排序
*/
function
classify_price
(){
lable_id
=
$
(
'.cl_Active2'
).
attr
(
'data-id'
);
$
.
post
(
"{:url('Classify/classify_price')}"
,{
classify_id
:
classify_id
,
lable_id
:
lable_id
},
function
(
data
){
search_content
=
$
(
"input[name='search_content']"
).
val
();
$
.
post
(
"{:url('Index/search_price_order')}"
,{
search_content
:
search_content
},
function
(
data
){
$
(
'.in_hotLi'
).
remove
();
data_arr
=
JSON
.
parse
(
data
);
for
(
var
i
=
0
;
i
<
data_arr
.
length
;
i
++
){
show_img
=
data_arr
[
i
].
show_img
;
url
=
"{:url('Goodsdetails/Goods_details')}?goods_id="
+
data_arr
[
i
].
id
;
$
(
'.se_con'
).
append
(
"<div class='in_hotLi'><a href='"
+
url
+
"'><div class='in_hotImg'><img src='"
+
show_img
+
"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span>
"
+
data_arr
[
i
].
name
+
"</span>"
+
data_arr
[
i
].
book_name
+
"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"
+
data_arr
[
i
].
price0
+
"</span>."
+
data_arr
[
i
].
price0
1
+
"</div></div></div></a></div>"
);
$
(
'.se_con'
).
append
(
"<div class='in_hotLi'><a href='"
+
url
+
"'><div class='in_hotImg'><img src='"
+
show_img
+
"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span>
</span>"
+
data_arr
[
i
].
book_name
+
"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"
+
data_arr
[
i
].
price0
+
"</span>."
+
data_arr
[
i
].
price
1
+
"</div></div></div></a></div>"
);
}
});
}
...
...
请
注册
或
登录
后发表评论