当前位置: 首页>>代码示例>>PHP>>正文


PHP YiiBase::trace方法代码示例

本文整理汇总了PHP中YiiBase::trace方法的典型用法代码示例。如果您正苦于以下问题:PHP YiiBase::trace方法的具体用法?PHP YiiBase::trace怎么用?PHP YiiBase::trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YiiBase的用法示例。


在下文中一共展示了YiiBase::trace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionRun

 public function actionRun()
 {
     $iv = new Interviews();
     $iv->owner = Yii::app()->user->id;
     $iv->name = Yii::app()->getRequest()->getPost('name');
     $iv->title = Yii::app()->getRequest()->getPost('title');
     $iv->status = 1;
     $qs = Yii::app()->getRequest()->getPost('q');
     $answs = Yii::app()->getRequest()->getPost('a');
     $quests = array();
     foreach ($qs as $k => $v) {
         $cq = array();
         $cq['question'] = $v;
         foreach ($answs[$k] as $kk => $vv) {
             $cq['answs'][] = $vv;
         }
         array_push($quests, $cq);
     }
     $iv->questions = json_encode($quests);
     $targ = array();
     $targ['country'] = intVal(trim(Yii::app()->getRequest()->getPost('country_id', 0)));
     $targ['cities'] = Yii::app()->getRequest()->getPost('city', array());
     if (!is_array($targ['cities'])) {
         $targ['cities'] = array();
     }
     $targ['gender'] = intVal(Yii::app()->getRequest()->getPost('gender', -1));
     $targ['family_state'] = Yii::app()->getRequest()->getPost('fs', array());
     if (!is_array($targ['family_state'])) {
         $targ['family_state'] = array();
     }
     $targ['age_from'] = intVal(Yii::app()->getRequest()->getPost('age_from', 0));
     $targ['age_to'] = intVal(Yii::app()->getRequest()->getPost('age_to', 0));
     $targ['school'] = trim(Yii::app()->getRequest()->getPost('school', ''));
     $targ['class'] = trim(Yii::app()->getRequest()->getPost('class', ''));
     $targ['schoolyear'] = intVal(Yii::app()->getRequest()->getPost('schoolyear', 0));
     $targ['uni'] = trim(Yii::app()->getRequest()->getPost('uni', ''));
     $targ['fac'] = trim(Yii::app()->getRequest()->getPost('fac', ''));
     $targ['uniyear'] = intVal(Yii::app()->getRequest()->getPost('uniyear', 0));
     $targ['workplace'] = trim(Yii::app()->getRequest()->getPost('workplace', ''));
     $targ['workstate'] = trim(Yii::app()->getRequest()->getPost('workstate', ''));
     $iv->targeting = json_encode($targ);
     $iv->price = intVal(Yii::app()->getRequest()->getPost('cost', 0));
     $iv->limit = intVal(Yii::app()->getRequest()->getPost('limit', 0));
     $iv->spent = 0;
     $iv->crt = 0;
     $iv->shows = 0;
     $iv->activity_log = json_encode(array('' . time() => 'create', '' . time() => 'start'));
     if ($iv->is_exist()) {
         $name = $iv->name . '_';
         $i = -1;
         do {
             $i++;
             $iv->name = $name . $i;
         } while ($iv->is_exist());
     }
     //YiiBase::trace($iv->name);
     $success = $iv->save();
     foreach ($quests as $k => $v) {
         $qqq = new InterviewQuestions();
         $qqq->interview_id = $iv->primaryKey;
         $qqq->question = $k;
         $qqq->question_text = $v['question'];
         $qqq->answers = json_encode($v['answs']);
         if (!$qqq->save()) {
             $errs = $qqq->getErrors();
             foreach ($errs as $ev) {
                 foreach ($ev as $evv) {
                     YiiBase::trace($evv);
                 }
             }
         }
     }
     $search = new SearchComponent();
     $udr = $search->targetFinder();
     foreach ($udr as $row) {
         $addon = new AdvertStack();
         $addon->user_id = $row['user_id'];
         $addon->type = 1;
         $addon->content_id = $iv->primaryKey;
         $addon->date_added = time();
         $addon->save();
     }
     if ($success) {
         $this->redirect('//advert/interview/my');
     } else {
         $errs = $iv->getErrors();
         foreach ($errs as $v) {
             foreach ($v as $vv) {
                 YiiBase::trace($vv);
             }
         }
     }
 }
开发者ID:BGCX067,项目名称:facecom-svn-to-git,代码行数:93,代码来源:InterviewController.php


注:本文中的YiiBase::trace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。