public function actionRefresh(){ $printers = Yii::app()->db->createCommand('select * from nb_printer where company_id=:companyId') ->bindValue(':companyId',$this->companyId) ->queryAll(); $key = $this->companyId.'_printer'; $list = new ARedisList($key); $list->clear(); if(!empty($printers)) { foreach ($printers as $printer) { $list->unshift($printer['ip_address']); } } exit; }