Tuesday, January 19, 2016

Yii countByAttributes or findAllByAttributes

    return $count = InstituteClassSummary::model()->countByAttributes(
    array(
      'zillaid' => $zilaid,
    ),
    array(
    //  'order' => 'date desc',
      'group' => 'institude_id',
    //  'offset' => 15
    ));

$allLogins = InstituteClassSummary::model()->findAllByAttributes(
array(
    'zillaid' => Yii::app()->user->id,
    'type' => $zilaid
),
array(
    'order' => 'date desc',
    'limit' => 10,
    'offset' => 15
));


No comments:

Post a Comment