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


PHP LogHelper::save方法代码示例

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


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

示例1: actionDescription

 public function actionDescription()
 {
     Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
     $id = 0;
     $class = $this->classModel;
     if (!empty($_GET["slug"])) {
         $model = $class::fetchBySlug(trim($_GET["slug"]));
         if ($model->id > 0) {
             $_GET["id"] = $model->id;
             $id = $model->id;
         }
     }
     if ($id > 0) {
         LogHelper::save("resorts", $id, "show");
         $item = CatalogKurorts::fetch($id);
         if ($item->id > 0) {
             Yii::app()->page->title = $item->name;
             $this->render('description', array("item" => $item, "otherHotels" => CatalogKurorts::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND category_id=:category_id AND id!=:id")->setParams(array(":category_id" => $item->category_id->id, ":id" => $item->id))->setOrderBy("col DESC")->setLimit(8)), "hotelCount" => CatalogKurorts::count(DBQueryParamsClass::CreateParams()->setConditions("category_id=:category")->setParams(array(":category" => $item->category_id->id)))));
         } else {
             throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
         }
     } else {
         throw new CHttpException("Ошибка", Yii::t("page", "Ошибка перехода на страницу"));
     }
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:25,代码来源:ResortsController.php

示例2: actionLog

 public function actionLog()
 {
     $type = Yii::app()->request->getParam("type", 0);
     $id = (int) Yii::app()->request->getParam("id", 0);
     $action = Yii::app()->request->getParam("action", 0);
     LogHelper::save($type, $id, $action);
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:7,代码来源:SiteController.php

示例3: actionDescription

 public function actionDescription()
 {
     Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
     $id = 0;
     $class = $this->classModel;
     if (!empty($_GET["slug"])) {
         $model = $class::fetchBySlug(trim($_GET["slug"]));
         if ($model->id > 0) {
             $_GET["id"] = $model->id;
             $id = $model->id;
         }
     }
     if (empty($id)) {
         $id = (int) Yii::app()->request->getParam("id", 0);
     }
     $error = Yii::app()->request->getParam("error", "");
     $tab = Yii::app()->request->getParam("tab", "");
     $tabArray = array("description", "pcomments", "tours");
     if (!in_array($tab, $tabArray)) {
         $tab = "";
     }
     // Ошибка при не правельно ID
     $error = Yii::t("page", "Произошла ошибка перехода на страницу, проверьте правильно написания адреса страницы");
     if (empty($id) && !empty($_GET["slug"])) {
         $ar = explode("-", $_GET["slug"]);
         $id = $ar[0];
     }
     if ($id > 0) {
         $item = CatalogFirmsInfo::fetch($id);
         if (empty($tab)) {
             $activeTab = "description";
         } else {
             $activeTab = $tab;
         }
         if ($item->id > 0) {
             LogHelper::save("firms", $item->id, "show");
             CCModelHelper::colCounter($item);
             $commentModel = new CatalogFirmsCommentsAdd();
             if (!empty($_POST["send_comment"])) {
                 $activeTab = "pcomments";
                 $commentModel->setAttributesFromArray($_POST["CatalogFirmsCommentsAdd"]);
                 $commentModel->firm_id = $id;
                 if (Yii::app()->user && Yii::app()->user->getId() > 0) {
                     $commentModel->user_id = Yii::app()->user->getId();
                 }
                 $commentModel->date = time();
                 if ($commentModel->save()) {
                     $item->onFirmNewComment(new CEvent($commentModel), array("subject" => $commentModel->name, "firm_name" => $item->name, "date" => date("d.m.Y H:i"), "user_name" => $commentModel->fio, "description" => $commentModel->message, "link" => SiteHelper::createUrl("/user/firms/description", array("id" => $item->id, "tab" => "pcomments"))));
                     $commentModel = new CatalogFirmsCommentsAdd();
                     $commentModel->formMessage = Yii::t("tours", "Сообщение отправлено, после модерации оно будет Опубликовано.");
                 }
             }
             Yii::app()->page->title = $item->name . " - " . Yii::t("page", "туристическое агенство") . " " . $item->country_id->name_2 . " " . $item->city_id->name;
             // Поля про поиско по турам
             $tourClass = new CatalogToursFirms();
             $arrSearchFieldsTours = $tourClass->getSearchAttributes();
             $this->render('description', array("item" => $item, "activeTab" => $activeTab, "commentModel" => $commentModel, "otherFirms" => CatalogFirms::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>'' AND id!=:id")->setParams(array(":id" => $item->id))->setOrderBy("col DESC")->setLimit(8)), "listGallery" => CatGallery::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("catalog=:catalog AND item_id=:items_id")->setParams(array(":catalog" => "catalog_firms", ":items_id" => $item->id))->setLimit(15)), "arrSearchFieldsTours" => $arrSearchFieldsTours));
         } else {
             throw new CHttpException("", "К сожалению описание данного тура не найденно в базе");
         }
     } else {
         throw new CHttpException("", "К сожалению описание данного тура не найденно в базе");
     }
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:64,代码来源:TravelAgencyController.php


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