本文整理汇总了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;
}
示例2: getFeedbackById
public static function getFeedbackById($id)
{
$feedBack = Feedback::model()->findByPk($id);
if ($feedBack) {
return $feedBack;
}
return null;
}
示例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));
}
示例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);
}
示例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.
*/
示例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);
}
示例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;
}
示例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;
}
示例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());
}
}
示例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;
}
}
示例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;
}
示例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));
}
}
示例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));
}
示例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));
}
示例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>';
}
}
}