22

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;
    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值