Ejemplo n.º 1
0
 public function run()
 {
     //        if($this->ads!=null && $this->ads->count()>0)
     if ($this->mini) {
         $this->render('adsBlockMini', array('ads' => $this->ads));
     } else {
         $this->render('adsBlock', array('ads' => $this->ads));
     }
     $ivs = array();
     $total = 0;
     $uivs = AdvertStack::model()->userIvs($this->user_id);
     $trace = 0;
     foreach ($uivs as $iv) {
         $ivs[$total] = Interviews::model()->find(array('condition' => 'id=:id AND status=1', 'params' => array(':id' => $iv->content_id)));
         $ivs[$total]->fixShow();
         $total++;
         if ($total >= 2) {
             break;
         }
     }
     $this->render('ivsBlock', array('ivs' => $ivs, 'trace' => $trace));
 }
Ejemplo n.º 2
0
 public function is_exist()
 {
     return Interviews::model()->exists(array('condition' => "owner=:owner AND name=:name", 'params' => array(':owner' => $this->owner, ':name' => $this->name)));
 }
 public function actionMy()
 {
     $ivs = Interviews::model()->findAll('owner=:owner', array(':owner' => Yii::app()->user->id));
     Yii::app()->clientScript->registerPackage('interview-my');
     $this->render('/advert/interview_my', array('ivs' => $ivs));
 }