本文整理汇总了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", "Ошибка перехода на страницу"));
}
}
示例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);
}
示例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("", "К сожалению описание данного тура не найденно в базе");
}
}