3
Ecshop首页分类调出排序、关键字、分类描述
source link: https://www.80shihua.com/archives/449
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Ecshop首页分类调出排序、关键字、分类描述
作者: dreamfly 分类: ecshop 发布时间: 2015-04-12 20:13
在includes/lib_goods.php中找到
/* 分类信息 */
$sql
=
'SELECT cat_name FROM '
.
$GLOBALS
[
'ecs'
]->table(
'category'
) .
" WHERE cat_id = '$cat_id'"
;
$cat
[
'name'
] =
$GLOBALS
[
'db'
]->getOne(
$sql
);
$cat
[
'url'
] = build_uri(
'category'
,
array
(
'cid'
=>
$cat_id
),
$cat
[
'name'
]);
$cat
[
'id'
] =
$cat_id
;
/* 分类信息 */
$sql
=
'SELECT cat_name,keywords,cat_desc,sort_order FROM '
.
$GLOBALS
[
'ecs'
]->table(
'category'
) .
" WHERE cat_id = '$cat_id'"
;
$res
=
$GLOBALS
[
'db'
]->getAll(
$sql
);
$cat
=
array
();
foreach
(
$res
AS
$row
)
{
$cat
[
'name'
] =
$row
[
'cat_name'
];
//分类名称
$cat
[
'keywords'
] =
$row
[
'keywords'
];
//关键字
$cat
[
'cat_desc'
] =
$row
[
'cat_desc'
];
//分类描述
$cat
[
'sort_order'
] =
$row
[
'sort_order'
];
//排序
}
$cat
[
'url'
] = build_uri(
'category'
,
array
(
'cid'
=>
$cat_id
),
$cat
[
'name'
]);
$cat
[
'id'
] =
$cat_id
;
//分类ID
然后在 cat_goods.lbi 中调用 {$goods_cat.keywords}----{$goods_cat.id}----{$goods_cat.name}----{$goods_cat.sort_order}
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
发表评论 取消回复
电子邮件地址不会被公开。 必填项已用*标注
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK