Esempio n. 1
0
 public function searchSupplier($id)
 {
     $criteria = new CDbCriteria();
     $criteria->compare('supplier_id', $id);
     $criteria->order = 'input_date DESC';
     if (Yii::app()->user->name != "admin") {
         $criteria->addInCondition('organization_id', SUser::model()->getGroupArray());
     }
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => 30)));
 }