function actionShenlun()
{
// 为 $this->_view 指定的值将会传递数据到视图中
$title_type = $this->_context->title_type;
$page = intval($this->_context->page);
if ($page < 1 or $page>140) $page = 1;
$max = intval($this->_context->max);
if ($max < 1 or $max>140) $max = 1;
$type_id = intval($this->_context->type_id);
if($type_id == '' || $type_id<1)
{
$type_id = '3';
}else{
$type_id = $type_id;
}
$rd = intval($this->_context->rd);
if($rd == '' || $rd<1 || $rd>5)
{
$rd=1;
}else{
$rd=$rd;
}
if($title_type == '' || $title_type<1)
{
$title_type = '成语';
}else{
$title_type = $title_type;
}
//随机取多少道题目
$select = Exam::find("title_type like '%".$title_type."%' ")->order(' RAND() ')->order(' id ASC ');
$select->limitPage($page, $max);
$this->_view['selects'] = $select->getOne();
$this->_view['pagination'] = $select->getPagination();
//exit( $select);
$this->_view['max'] = $max;
$daan = intval($this->_context->daan);
if($daan<1)
{
$daan = 1;
}
$this->_view['title_type'] = $title_type;
$this->_view['daan'] = $daan;
$this->_view['type_id'] = $type_id;
$this->_view['rd'] = $rd;
//echo $type_id;
}
22
最新推荐文章于 2024-05-06 17:42:30 发布