切换导航条
此项目
正在载入...
登录
anyv
/
xkeasy
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
anyv
6 years ago
提交
5b07454376b9d7e6e0e18bbd0f2b18f4febcaf90
1 个父辈
779b34b0
1 个管道 的构建
通过
耗费 0 秒
分类销量
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
32 行增加
和
2 行删除
app/portal/controller/ClassifyController.php
public/themes/simpleboot3/portal/classify/classify.html
app/portal/controller/ClassifyController.php
查看文件 @
5b07454
...
...
@@ -76,7 +76,23 @@ class ClassifyController extends WeChatBaseController{
*/
public
function
classify_sales
(){
dump
(
$_POST
);
die
;
$where
=
[
'a.type'
=>
1
];
if
(
!
empty
(
$_POST
[
'classify_id'
])){
$where
[
'classify_id'
]
=
$_POST
[
'classify_id'
];
}
if
(
!
empty
(
$_POST
[
'lable_id'
])){
$where
[
'label_id'
]
=
$_POST
[
'lable_id'
];
}
$data
=
Db
::
name
(
'goods'
)
->
alias
(
'a'
)
->
join
(
'classification b'
,
'a.classify_id = b.id'
,
'LEFT'
)
->
where
(
$where
)
->
order
(
'a.sales desc'
)
->
select
()
->
toArray
();
foreach
(
$data
as
$key
=>
$val
){
$price
=
explode
(
'.'
,
$data
[
$key
][
'price'
]);
$data
[
$key
][
'price0'
]
=
$price
[
0
];
$data
[
$key
][
'price01'
]
=
$price
[
1
];
$data
[
$key
][
'show_img'
]
=
cmf_get_image_url
(
$data
[
$key
][
'show_img'
]);
}
return
json_encode
(
$data
);
}
...
...
@@ -88,4 +104,13 @@ class ClassifyController extends WeChatBaseController{
}
\ No newline at end of file
...
...
public/themes/simpleboot3/portal/classify/classify.html
查看文件 @
5b07454
...
...
@@ -138,7 +138,12 @@
classify_id
=
$
(
'.cl_navActive'
).
attr
(
'data-id'
);
lable_id
=
$
(
'.cl_Active2'
).
attr
(
'data-id'
);
$
.
post
(
"{:url('Classify/classify_sales')}"
,{
classify_id
:
classify_id
,
lable_id
:
lable_id
},
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
;
$
(
'.se_con'
).
append
(
"<div class='in_hotLi'><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
].
price01
+
"</div></div></div></div>"
);
}
});
}
</script>
...
...
请
注册
或
登录
后发表评论