本文整理汇总了PHP中Backend::getListCate方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::getListCate方法的具体用法?PHP Backend::getListCate怎么用?PHP Backend::getListCate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Backend
的用法示例。
在下文中一共展示了Backend::getListCate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
echo $a = $model->changeTitle($name);
exit;
}
if ($action == 'cate_menu') {
$value = (int) $_POST['val'];
$cate_id = (int) $_POST['cate_id'];
$model->updateHoteCate($cate_id, $value);
}
if ($action == "get-cate-by-type-product") {
if (isset($_POST['type'])) {
$type = $_POST['type'];
} else {
$type = "form";
}
$cate_type_id = (int) $_POST['cate_type_id'];
$arrCate = $model->getListCate($cate_type_id);
if (!empty($arrCate)) {
if ($type != "form") {
echo "<option value='-1' selected >--Tất cả--</option>";
} else {
echo "<option value='0' selected >--Chọn--</option>";
}
foreach ($arrCate as $cate1) {
echo "<option data-parent='" . $cate1['id'] . "' value='" . $cate1['id'] . "'>" . $cate1['cate_name'] . "</option>";
if (!empty($cate1['child'])) {
foreach ($cate1['child'] as $cate2) {
echo "<option data-parent='" . $cate2['parent_id'] . "' value='" . $cate2['id'] . "'> " . $cate2['cate_name'] . "</option>";
}
}
}
}
示例2: foreach
" type="checkbox" class="cate-parent"
<?php
if (!empty($arrCateTypeId) && in_array($cateType['id'], $arrCateTypeId)) {
echo "checked";
}
?>
name="cate_type_id[]">
<label for="cate-parent-<?php
echo $cateType['id'];
?>
"><?php
echo $cateType['cate_type_name'];
?>
</label></p>
<?php
$arrCate = $model->getListCate($cateType['id']);
if (!empty($arrCate)) {
foreach ($arrCate as $cate) {
?>
<p style="padding-left:50px;margin-bottom:0px">
<input data-parent="<?php
echo $cateType['id'];
?>
" id="cate-child-<?php
echo $cate['id'];
?>
" type="checkbox" class="cate-child"
name="cate_id[]" value="<?php
echo $cate['id'];
?>
"
示例3: Backend
<?php
require_once "model/Backend.php";
$model = new Backend();
$cateTypeArr = $model->getListCateType();
$cateArr = $model->getListCate();
$cateArrNoTree = $model->getListCateNoTree();
$limit = 20;
$link = "index.php?mod=product&act=list";
$link_form = "";
$page_show = 20;
if (isset($_GET['product_code']) && $_GET['product_code'] != '') {
$product_code = $_GET['product_code'];
$link .= "&product_code={$product_code}";
$link_form .= "&product_code={$product_code}";
} else {
$product_code = '';
}
if (isset($_GET['product_name']) && $_GET['product_name'] != '') {
$product_name = $_GET['product_name'];
$link .= "&product_name={$product_name}";
$link_form .= "&product_name={$product_name}";
} else {
$product_name = '';
}
if (isset($_GET['is_hot']) && $_GET['is_hot'] > -1) {
$is_hot = (int) $_GET['is_hot'];
$link_form .= "&is_hot={$is_hot}";
$link .= "&is_hot={$is_hot}";
} else {
$is_hot = -1;