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


PHP Feedback::model方法代码示例

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


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

示例1: loadModel

 public function loadModel($id)
 {
     if (($model = Feedback::model()->findByPk($id)) === null) {
         throw new CHttpException(404, 'Страница не найдена');
     }
     return $model;
 }
开发者ID:kuzmina-mariya,项目名称:gallery,代码行数:7,代码来源:FeedbackBackendController.php

示例2: getFeedbackById

 public static function getFeedbackById($id)
 {
     $feedBack = Feedback::model()->findByPk($id);
     if ($feedBack) {
         return $feedBack;
     }
     return null;
 }
开发者ID:romeo14,项目名称:wallfeet,代码行数:8,代码来源:FeedbackApi.php

示例3: run

 public function run()
 {
     $models = Feedback::model()->finished()->review()->slider()->findAll(array('limit' => (int) $this->limit, 'order' => 't.sort ASC'));
     if (empty($models)) {
         return;
     }
     $this->render($this->view, array('models' => $models));
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:8,代码来源:ReviewsWidget.php

示例4: actionView

 public function actionView($id)
 {
     $this->data['id'] = $id;
     $this->connection->createCommand("update xm_feedback set haveread = 1 where feedback_id = {$id}")->query();
     $feedback = Feedback::model()->findByPk($id);
     $this->data['feedback'] = $feedback;
     $this->render('view', $this->data);
 }
开发者ID:Toney,项目名称:xmcms,代码行数:8,代码来源:FeedbackController.php

示例5: array

             $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));
         }
     } else {
         throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');
     }
 }
 /**
  * Lists all models.
  */
开发者ID:rainsongsky,项目名称:yincart,代码行数:9,代码来源:FeedbackController.php

示例6: actionStat

 public function actionStat()
 {
     $posts = Posts::model()->count();
     $commentsNum = Comments::model()->count();
     $attachsNum = Attachments::model()->count();
     $feedbackNum = Feedback::model()->count();
     $arr = array('posts' => $posts, 'commentsNum' => $commentsNum, 'attachsNum' => $attachsNum, 'feedbackNum' => $feedbackNum);
     $this->render('stat', $arr);
 }
开发者ID:ph7pal,项目名称:momo,代码行数:9,代码来源:IndexController.php

示例7: checkSelf

 public function checkSelf()
 {
     $messages = array();
     if (!$this->notifyEmailFrom) {
         $messages[WebModule::CHECK_ERROR][] = array('type' => WebModule::CHECK_ERROR, 'message' => Yii::t('FeedbackModule.feedback', 'Select email which will be display in "From" field {link}', array('{link}' => CHtml::link(Yii::t('FeedbackModule.feedback', 'Change module settings'), array('/yupe/backend/modulesettings/', 'module' => $this->id)))));
     }
     $count = Feedback::model()->new()->count();
     if ($count) {
         $messages[WebModule::CHECK_NOTICE][] = array('type' => WebModule::CHECK_NOTICE, 'message' => Yii::t('FeedbackModule.feedback', 'You have {{count}} ', array('{{count}}' => $count)) . Yii::t('FeedbackModule.feedback', 'new message |new messages |new messages ', $count) . ' ' . CHtml::link(Yii::t('FeedbackModule.feedback', 'Show and reply?'), array('/feedback/feedbackBackend/index/', 'order' => 'status.asc', 'FeedbBack_sort' => 'status')));
     }
     return isset($messages[WebModule::CHECK_ERROR]) || isset($messages[WebModule::CHECK_NOTICE]) ? $messages : true;
 }
开发者ID:kuzmina-mariya,项目名称:happy-end,代码行数:12,代码来源:FeedbackModule.php

示例8: getFeedbackByEvent

 public function getFeedbackByEvent($event_id)
 {
     $feedbacks = Feedback::model()->findAllByAttributes(array('event_id' => $event_id));
     $returnArr = array();
     foreach ($feedbacks as $item) {
         $itemArr = $this->getQuestionByFeedback($item->feedback_id);
         if (!empty($itemArr)) {
             $returnArr[] = $itemArr;
         }
     }
     return $returnArr;
 }
开发者ID:huynt57,项目名称:hatch,代码行数:12,代码来源:Feedback.php

示例9: actionAddUserFeedback

 public function actionAddUserFeedback()
 {
     try {
         $attr = StringHelper::filterArrayString($_POST);
         if (Feedback::model()->addUserFeedback($attr)) {
             ResponseHelper::JsonReturnSuccess('', 'Success');
         } else {
             ResponseHelper::JsonReturnError('', 'Server Error');
         }
     } catch (Exception $ex) {
         var_dump($ex->getMessage());
     }
 }
开发者ID:huynt57,项目名称:hatch,代码行数:13,代码来源:FeedbackController.php

示例10: getRating

 public static function getRating($toId, $entityId, $type)
 {
     $criteria = new CDbCriteria();
     $criteria->select = 'avg(rate) AS rate';
     $criteria->condition = 'to_id=:toId AND entity_id=:entityId AND type=:type';
     $criteria->params = array(':toId' => $toId, ':entityId' => $entityId, ':type' => $type);
     $avg_rating = Feedback::model()->find($criteria);
     if ($avg_rating->rate) {
         return $avg_rating->rate;
     } else {
         return false;
     }
 }
开发者ID:romeo14,项目名称:pow,代码行数:13,代码来源:FeedbackApi.php

示例11: checkSelf

 public function checkSelf()
 {
     $messages = array();
     if (!$this->notifyEmailFrom) {
         $messages[WebModule::CHECK_ERROR][] = array('type' => WebModule::CHECK_ERROR, 'message' => Yii::t('FeedbackModule.feedback', 'Select email which will be display in "From" field {link}', array('{link}' => CHtml::link(Yii::t('FeedbackModule.feedback', 'Change module settings'), array('/yupe/backend/modulesettings/', 'module' => $this->id)))));
     }
     $count = Feedback::model()->new()->count();
     if ($count) {
         $messages[WebModule::CHECK_NOTICE][] = array('type' => WebModule::CHECK_NOTICE, 'message' => Yii::t('FeedbackModule.feedback', 'You have {{count}} ', array('{{count}}' => $count)) . Yii::t('FeedbackModule.feedback', 'new message |new messages |new messages ', $count) . ' ' . CHtml::link(Yii::t('FeedbackModule.feedback', 'Show and reply?'), array('/feedback/feedbackBackend/index/', 'order' => 'status.asc', 'FeedbBack_sort' => 'status')));
     }
     $uploadPath = Yii::app()->uploadManager->getBasePath() . DIRECTORY_SEPARATOR . $this->uploadPath;
     if (!is_writable($uploadPath)) {
         $messages[WebModule::CHECK_ERROR][] = array('type' => WebModule::CHECK_ERROR, 'message' => Yii::t('FeedbackModule.feedback', 'Directory "{dir}" is not accessible for write! {link}', array('{dir}' => $uploadPath, '{link}' => CHtml::link(Yii::t('FeedbackModule.feedback', 'Change settings'), array('/yupe/backend/modulesettings/', 'module' => 'feedback')))));
     }
     return isset($messages[WebModule::CHECK_ERROR]) || isset($messages[WebModule::CHECK_NOTICE]) ? $messages : true;
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:16,代码来源:FeedbackModule.php

示例12: actionDelete

 public function actionDelete()
 {
     $companyId = Helper::getCompanyId(Yii::app()->request->getParam('companyId'));
     $ids = Yii::app()->request->getPost('lid');
     $allflag = Yii::app()->request->getParam('allflag', 0);
     Until::isUpdateValid($ids, $this->companyId, $this);
     //0,表示企业任何时候都在云端更新。
     if (!empty($ids)) {
         foreach ($ids as $id) {
             $model = Feedback::model()->find('lid=:id and dpid=:companyId', array(':id' => $id, ':companyId' => $companyId));
             if ($model) {
                 $model->saveAttributes(array('delete_flag' => 1, 'update_at' => date('Y-m-d H:i:s', time())));
             }
         }
         $this->redirect(array('feedback/index', 'companyId' => $companyId, 'allflag' => $allflag));
     } else {
         Yii::app()->user->setFlash('error', yii::t('app', '请选择要删除的项目'));
         $this->redirect(array('feedback/index', 'companyId' => $companyId, 'allflag' => $allflag));
     }
 }
开发者ID:song-yuan,项目名称:wymenujp,代码行数:20,代码来源:FeedbackController.php

示例13: actionReply

 public function actionReply($feedbackid)
 {
     if (Yii::app()->user->checkAccess('createAnswer') == false) {
         throw new CHttpException(403);
     }
     $feedback = Feedback::model()->findByPk($feedbackid);
     $answer = new Answer();
     if (isset($_POST['Answer'])) {
         $answer->attributes = Yii::app()->request->getPost('Answer');
         $answer->reply_time = date('Y-m-d');
         $answer->feedback_id = $feedbackid;
         if ($answer->save()) {
             $this->setFlashMessage(strtr('<strong>{link}</strong> 问题咨询回复成功', array('{link}' => CHtml::link(CHtml::encode($feedback->content), array('view', 'id' => $answer->primaryKey)))));
             $feedback->is_reply = 1;
             $feedback->save();
             $this->redirect(array('answer/index'));
         }
     }
     $this->breadcrumbs = array('问题咨询' => array('feedback/index'), '回复');
     $this->render('reply', array('answer' => $answer, 'feedback' => $feedback));
 }
开发者ID:kinghinds,项目名称:kingtest2,代码行数:21,代码来源:AnswerController.php

示例14: actionIndex

 public function actionIndex()
 {
     $this->pageTitle = Yii::t('common', '反馈中心') . SEPARATOR . Setting::getValueByCode('inside_title', true);
     $criteria = new CDbCriteria();
     $criteria->compare('is_reply', 1);
     $criteria->order = 'id DESC';
     $criteria->limit = 5;
     $feedbacks = Feedback::model()->findAll($criteria);
     $criteria = new CDbCriteria();
     $criteria->compare('t.banner_position_id', 4);
     $banner = Banner::model()->localized()->find($criteria);
     $this->layout = 'main';
     $feedbackForm = new FeedbackForm();
     if (isset($_POST['FeedbackForm'])) {
         $feedbackForm->setAttributes($_POST['FeedbackForm']);
         if ($feedbackForm->submit()) {
             $this->redirect(array('success'));
         }
     }
     $this->render('index', array('feedbacks' => $feedbacks, 'feedbackForm' => $feedbackForm, 'banner' => $banner));
 }
开发者ID:kinghinds,项目名称:kingtest2,代码行数:21,代码来源:FeedbackController.php

示例15: actionCopy

 public function actionCopy()
 {
     exit;
     Yii::import('feedback.models.*');
     $questions = Feedback::model()->faq()->findAll(array('order' => 't.id ASC'));
     foreach ($questions as $key => $q) {
         $question = new FaqQuestion();
         $question->id = $q->id;
         $question->category_id = $q->group_id;
         $question->created_at = $q->creation_date;
         $question->updated_at = $q->change_date;
         $question->question = $q->text;
         $question->answer = $q->answer;
         $question->sort = $q->sort * 10;
         $question->status = $q->status > 0 ? FaqQuestion::STATUS_PUBLISHED : FaqQuestion::STATUS_DRAFT;
         if (!$question->save()) {
             echo $question->question . ' - error<br />';
             var_dump($question->getErrors());
             echo '<hr>';
         }
     }
 }
开发者ID:kuzmina-mariya,项目名称:unizaro-stone,代码行数:22,代码来源:QuestionBackendController.php


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