diff --git a/application/modules/default/models/ProjectTagRatings.php b/application/modules/default/models/ProjectTagRatings.php index 4bdf53968..f6ad2216c 100755 --- a/application/modules/default/models/ProjectTagRatings.php +++ b/application/modules/default/models/ProjectTagRatings.php @@ -1,101 +1,101 @@ . **/ class Default_Model_ProjectTagRatings { /** * @param $project_id */ public function getProjectTagRatings($project_id) { $sql = " SELECT r.tag_id, r.vote, r.member_id, r.tag_rating_id FROM stat_projects p - inner join category_tag_group_rating g on p.project_category_id = g.category_id - inner join tag_group_item i on i.tag_group_id = g.tag_group_id + inner join project_category g on p.project_category_id = g.project_category_id + inner join tag_group_item i on i.tag_group_id = g.tag_rating inner join tag_rating r on r.tag_id = i.tag_id and r.project_id = p.project_id and r.is_deleted=0 inner join tag t on t.tag_id = r.tag_id where p.project_id = :project_id "; $result = Zend_Db_Table::getDefaultAdapter()->query($sql, array('project_id' => $project_id))->fetchAll(); return $result; } public function getCategoryTagRatings($category_id) { $sql ="SELECT - t.tag_id as id, - t.tag_fullname as name, - tg.group_display_name - FROM category_tag_group_rating g - inner join tag_group_item i on i.tag_group_id = g.tag_group_id - inner join tag t on t.tag_id = i.tag_id - inner join tag_group tg on g.tag_group_id = tg.group_id - where g.category_id = :category_id + t.tag_id as id, + t.tag_fullname as name, + tg.group_display_name + FROM project_category g + inner join tag_group_item i on i.tag_group_id = g.tag_rating + inner join tag t on t.tag_id = i.tag_id + inner join tag_group tg on g.tag_rating = tg.group_id + where g.project_category_id =:category_id "; $result = Zend_Db_Table::getDefaultAdapter()->query($sql, array('category_id' => $category_id))->fetchAll(); return $result; } /** * @return tag_rating_id,vote/false */ public function checkIfVote($member_id,$project_id,$tag_id) { $sql = "select tag_rating_id,vote from tag_rating where member_id=:member_id and project_id=:project_id and tag_id=:tag_id and is_deleted=0"; $result = Zend_Db_Table::getDefaultAdapter()->fetchRow($sql,array("member_id"=>$member_id ,"project_id"=>$project_id ,"tag_id" =>$tag_id )); return $result; if($result && $result['tag_rating_id']) { return $result; }else{ return false; } } public function doVote($member_id,$project_id,$tag_id,$vote) { Zend_Db_Table::getDefaultAdapter()->insert('tag_rating' ,array('member_id' => $member_id ,'project_id' => $project_id ,'tag_id' => $tag_id ,'vote' => $vote )); } public function removeVote($tag_rating_id) { $sql ="update tag_rating set is_deleted=1, deleted_at=now() where tag_rating_id=".$tag_rating_id; Zend_Db_Table::getDefaultAdapter()->query($sql); } } \ No newline at end of file diff --git a/application/modules/default/views/scripts/product/partials/details.phtml b/application/modules/default/views/scripts/product/partials/details.phtml index c29888b50..f94544d01 100644 --- a/application/modules/default/views/scripts/product/partials/details.phtml +++ b/application/modules/default/views/scripts/product/partials/details.phtml @@ -1,410 +1,410 @@ . **/ $tableProject = new Default_Model_Project(); $this->product_views = $tableProject->fetchProjectViews($this->product->project_id); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $tableTags = new Default_Model_Tags(); $tagsArray = $tableTags->getTagsArray($this->product->project_id, $tableTags::TAG_TYPE_PROJECT, $tableTags::TAG_GHNS_EXCLUDED_GROUPID); $isGhnsExcluded = false; if(isset($tagsArray) && (count($tagsArray) == 1)) { $isGhnsExcluded = true; } $isProductDangerous = $tableTags->isProductDangerous($this->product->project_id); $filesTable = new Default_Model_DbTable_PploadFiles(); $countDownloadsToday = $filesTable->fetchCountDownloadsTodayForProject($this->product->ppload_collection_id); $countDownloadsTodayUk = $filesTable->fetchCountDownloadsTodayForProjectNew($this->product->ppload_collection_id); $mediaViewsTable = new Default_Model_DbTable_MediaViews(); $countMediaViewsToday = $mediaViewsTable->fetchCountViewsTodayForProject($this->product->project_id); $countMediaViewsAlltime = $mediaViewsTable->fetchCountViewsForProjectAllTime($this->product->project_id); $countPageviews = $this->projectDetailCounts($this->product->project_id); $countPageviewsTotal = 0; $countPageviewsToday = $countPageviews[0]['count_views']; if(sizeof($countPageviews)==2) $countPageviewsTotal = $countPageviews[1]['count_views']; // $heute = date("Y-m-d H:i:s"); $today = (new DateTime())->modify('-1 day'); $filterDownloadToday = $today->format("Y-m-d H:i:s"); ?>