yii有关问题

WBOY
Release: 2016-06-13 12:22:55
Original
767 people have browsed it

yii问题


实现按条件查询

控制器:(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'] ;
        }

日期:显示两个日期的数据

<br />if(isset( $_POST['date1']) && $_POST['date1']!=""){<br />            $_GET['News']['date'] =$_POST['date1'] ;<br />        }<br />   if(isset( $_POST['date2']) && $_POST['date2']!=""){<br />            $_GET['News']['date'] =$_POST['date2'] ;<br />        }<br />//这个功能无法实现    查询两个日期间的数据<br />
Copy after login


------解决思路----------------------
谁告诉你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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template