实现按条件查询
控制器:(display 和 title 已经实现)
if(isset( $_POST['Cg_display']) && $_POST['Cg_display']!=""){
$_GET['News']['display'] =$_POST['Cg_display'] ;
}
if(isset( $_POST['title']) && $_POST['title']!=""){
$_GET['News']['title'] =$_POST['title'] ;
}
日期:显示两个日期的数据
if(isset( $_POST['date1']) && $_POST['date1']!=""){ $_GET['News']['date'] =$_POST['date1'] ; } if(isset( $_POST['date2']) && $_POST['date2']!=""){ $_GET['News']['date'] =$_POST['date2'] ; }//这个功能无法实现 查询两个日期间的数据
这种就是sql语句的拼接了。。 搜索时间>开始时间
谁告诉你Yii是这么玩的?
你这是1还是2?
1就建议你看看 http://www.yiichina.com/doc/api/1.1/CDbCriteria
2就建议你看看http://www.yiichina.com/doc/api/2.0/yii-db-activequery
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号