dongshanyan0322 2013-09-04 07:03
浏览 91
已采纳

Yii $ criteria-> addBetweenCondition不在CDbCriteria中工作

I want to get results of sender score between 1 to 10,So I have add this condtion.

   $criteria->addBetweenCondition('sender_score',$_GET['senderscore_start'],$_GET['senderscore_end']);

sender_score is my table field, senderscore_start and senderscore_end are only public variables.

My Search From Code:

<div class="row">       
    <?php echo $form->label($model,'senderscore_start'); ?>
    <?php echo $form->textField($model,'senderscore_start',array('size'=>60,'maxlength'=>100,'style'=>'width:300px;')); ?>      
</div>  
<div class="row">       
    <?php echo $form->label($model,'senderscore_end'); ?>
    <?php echo $form->textField($model,'senderscore_end',array('size'=>60,'maxlength'=>100,'style'=>'width:300px;')); ?>       
</div>

My Model Code:

public $senderscore_start;
public $senderscore_end;

array('senderscore_start,senderscore_end', 'safe', 'on'=>'search'),

$criteria->addBetweenCondition('sender_score',$_GET['senderscore_start'],$_GET['senderscore_end']);`

But not showing results between 1,10 , can you look at this please! what's wrong with my code. `

  • 写回答

2条回答 默认 最新

  • dtr32787 2013-09-04 07:23
    关注

    Try this!

     $criteria->addBetweenCondition('sender_score',$_GET['IpManager']['senderscore_start'],$_GET['IpManager']['senderscore_end']);          
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 这个复选框什么作用?
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决