本文整理匯總了PHP中CommonAction::getIdList方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonAction::getIdList方法的具體用法?PHP CommonAction::getIdList怎麽用?PHP CommonAction::getIdList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonAction
的用法示例。
在下文中一共展示了CommonAction::getIdList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteSort
public function deleteSort()
{
$id = I('id', 0, 'intval');
$idList = parent::getIdList('discuss_sort', $id);
if ($db = M('discuss_sort')->where(array('id in(' . $idList . ')'))->delete()) {
$this->success('刪除成功', U(GROUP_NAME . '/Discuss/sortlist'));
} else {
$this->error('刪除失敗');
}
}
示例2: index
public function index()
{
//首頁焦點圖
$objAd = M('ad');
$indexFocus = $objAd->where('sort_id=3')->order('id asc')->select();
$indexFocus = deep_htmlspecialchars_decode($indexFocus);
$this->assign('indexFocus', $indexFocus);
// 待解決的問題
$idList = parent::getIdList('ask_sort', 0);
//獲取所有的頂級分類和其子分類
$objAsk = D('AskView');
$where1 = 'sort_id in (' . $idList . ')';
$where1 .= ' AND solve = "0"';
$noAnswerList = $objAsk->where($where1)->field('id,ask_name,add_time,comment_num,username,uid,sort_name,sort_id')->order('add_time desc')->limit(10)->select();
$noAnswerList = deep_htmlspecialchars_decode($noAnswerList);
$this->assign('noAnswerList', $noAnswerList);
//懸賞最高的問題
$where2 = 'sort_id in (' . $idList . ')';
$rewardList = $objAsk->where($where2)->field('id,ask_name,add_time,comment_num,username,uid,sort_name,sort_id')->order('reward desc')->limit(10)->select();
$rewardList = deep_htmlspecialchars_decode($rewardList);
$this->assign('rewardList', $rewardList);
$this->display();
}