本文整理汇总了PHP中CategoryModel::select方法的典型用法代码示例。如果您正苦于以下问题:PHP CategoryModel::select方法的具体用法?PHP CategoryModel::select怎么用?PHP CategoryModel::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CategoryModel
的用法示例。
在下文中一共展示了CategoryModel::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: goodsByCate
public function goodsByCate($cateID, $n = null, $start = null)
{
$cateObj = new CategoryModel();
$allCates = $cateObj->select();
$cateList = $cateObj->getCatTree($allCates, $cateID);
$cateIDList = array($cateID);
foreach ($cateList as $v) {
$cateIDList[] = $v['cat_id'];
}
$instring = implode(',', $cateIDList);
$sql = 'select goods_id,goods_name, shop_price, market_price, thumb_img, add_time, goods_img from ' . $this->table . ' where cat_id in (' . $instring . ') order by add_time desc';
if (is_numeric($n) && is_numeric($start)) {
$sql .= ' limit ' . $start . ',' . $n;
}
$data = $this->db->getAll($sql);
return $data;
}
示例2: edit
/**
* 文章编辑页面
*/
function edit()
{
$art_id = $_GET['id'];
if (!empty($art_id)) {
//获得文章
$art = new ArticleModel();
$list = $art->getById($art_id);
$this->assign('alist', $list);
//获得单元
$sec = new SectionModel();
$list = $sec->order('id')->select();
$this->assign('slist', $list);
//获得分类
$cat = new CategoryModel();
$list = $cat->select();
$this->assign('clist', $list);
}
$this->display();
}
示例3: CategoryModel
/*
商品页
*/
define('ACC', true);
require '../system/init.php';
$cateObj = new CategoryModel();
$goodsObj = new GoodsModel();
$goodsID = $_GET['goods_id'];
$goodsInfo = $goodsObj->find($goodsID);
if (!isset($goodsInfo)) {
header('Location: index.php');
}
//print_r(serialize($goodsInfo));
$catID = $goodsInfo['cat_id'];
$allCates = $cateObj->select();
$cateNav = $cateObj->getTree($allCates, $catID);
$cateInfo = $cateObj->find($catID);
//print_r($cateNav);
//加入浏览记录用cookie做
//是否有cookie,没有则设置,有则加入,超过5个自动删除
if (isset($_COOKIE['goods_history'])) {
$history = _unserialize($_COOKIE['goods_history']);
foreach ($history as $k => $v) {
if ($v['goods_id'] != $goodsID) {
continue;
} else {
array_splice($history, $k, 1);
break;
}
}