本文整理汇总了PHP中DateHelper::toDbDateFormat_tuan方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::toDbDateFormat_tuan方法的具体用法?PHP DateHelper::toDbDateFormat_tuan怎么用?PHP DateHelper::toDbDateFormat_tuan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::toDbDateFormat_tuan方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
/**
* Retrieves a list of models based on the current search/filter conditions.
* @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
*/
public function search()
{
$criteria = new CDbCriteria();
$criteria->compare('t.id', $this->id);
$criteria->compare('t.title', $this->title, true);
$criteria->compare('t.country_id', $this->country_id);
$criteria->compare('t.department', $this->department, true);
$date = DateHelper::toDbDateFormat_tuan($this->posted);
if (!empty($date)) {
$criteria->addCondition('DATE(t.posted) = "' . $date . '"');
}
$criteria->order = 't.id desc';
return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => Yii::app()->user->getState('pageSize', Yii::app()->params['defaultPageSize']))));
}