Skip to content

Instantly share code, notes, and snippets.

@max107
Created April 21, 2014 12:20
Show Gist options
  • Save max107/11141230 to your computer and use it in GitHub Desktop.
Save max107/11141230 to your computer and use it in GitHub Desktop.
<?php
$criteria = new CDbCriteria();
$criteria->condition = "status IN(1)";
$criteria->mergeWith($model->lang()->children()->getDbCriteria());
$criteria->order = "type ASC, create_time DESC";
Pages::model()->findAll($criteria);
@max107
Copy link
Author

max107 commented Apr 21, 2014

Pages::objects()->filter(['status__in' => [1]])->order(['type', '-create_time'])->all();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment