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


PHP CRatings::AddComponentResults方法代码示例

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


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

示例1: CalcUserBonus

	function CalcUserBonus($arConfigs)
	{
		global $DB;

		$err_mess = (CRatings::err_mess())."<br>Function: CalcUserBonus<br>Line: ";

		$communityLastVisit = COption::GetOptionString("main", "rating_community_last_visit", '90');

		CRatings::AddComponentResults($arConfigs);

		$strSql = "DELETE FROM b_rating_component_results WHERE RATING_ID = '".IntVal($arConfigs['RATING_ID'])."' AND COMPLEX_NAME = '".$DB->ForSql($arConfigs['COMPLEX_NAME'])."'";
		$res = $DB->Query($strSql, false, $err_mess.__LINE__);

		$strSql = "INSERT INTO b_rating_component_results (RATING_ID, MODULE_ID, RATING_TYPE, NAME, COMPLEX_NAME, ENTITY_ID, ENTITY_TYPE_ID, CURRENT_VALUE)
					SELECT
						'".IntVal($arConfigs['RATING_ID'])."'  RATING_ID,
						'".$DB->ForSql($arConfigs['MODULE_ID'])."'  MODULE_ID,
						'".$DB->ForSql($arConfigs['RATING_TYPE'])."'  RATING_TYPE,
						'".$DB->ForSql($arConfigs['NAME'])."'  NAME,
						'".$DB->ForSql($arConfigs['COMPLEX_NAME'])."'  COMPLEX_NAME,
						RB.ENTITY_ID as ENTITY_ID,
						'".$DB->ForSql($arConfigs['ENTITY_ID'])."'  ENTITY_TYPE_ID,
						RB.BONUS*".floatval($arConfigs['CONFIG']['COEFFICIENT'])."  CURRENT_VALUE
					FROM
						b_rating_user RB
						LEFT JOIN b_user U ON U.ID = RB.ENTITY_ID AND U.ACTIVE = 'Y' AND U.LAST_LOGIN > DATE_SUB(NOW(), INTERVAL ".intval($communityLastVisit)." DAY)
					WHERE
						RB.RATING_ID = ".IntVal($arConfigs['RATING_ID'])."
						AND U.ID IS NOT NULL
					";
		$res = $DB->Query($strSql, false, $err_mess.__LINE__);

		return true;
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:34,代码来源:ratings_components.php

示例2: CalcUserRatingForumActivity

 function CalcUserRatingForumActivity($arConfigs)
 {
     global $DB;
     $err_mess = CRatings::err_mess() . "<br>Function: CalcUserRatingForumActivity<br>Line: ";
     CRatings::AddComponentResults($arConfigs);
     $strSql = "DELETE FROM b_rating_component_results WHERE RATING_ID = '" . IntVal($arConfigs['RATING_ID']) . "' AND COMPLEX_NAME = '" . $DB->ForSql($arConfigs['COMPLEX_NAME']) . "'";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     $sqlAllTopic = '';
     if (isset($arConfigs['CONFIG']['ALL_TOPIC_COEF']) && $arConfigs['CONFIG']['ALL_TOPIC_COEF'] != 0) {
         $sqlAllTopic = "\n\t\t\t\tSELECT\n\t\t\t\t\tUSER_START_ID as ENTITY_ID,\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['ALL_TOPIC_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_forum_topic\n\t\t\t\tWHERE START_DATE  < DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\tGROUP BY USER_START_ID\n\t\t\t\tUNION ALL ";
     }
     $sqlAllMessage = '';
     if (isset($arConfigs['CONFIG']['ALL_POST_COEF']) && $arConfigs['CONFIG']['ALL_POST_COEF'] != 0) {
         $sqlAllMessage = "\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['ALL_POST_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_forum_message\n\t\t\t\tWHERE POST_DATE  < DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\tGROUP BY AUTHOR_ID\n\t\t\t\tUNION ALL ";
     }
     $strSql = "INSERT INTO b_rating_component_results (RATING_ID, MODULE_ID, RATING_TYPE, NAME, COMPLEX_NAME, ENTITY_ID, ENTITY_TYPE_ID, CURRENT_VALUE)\n\t\t\tSELECT\n\t\t\t\t'" . IntVal($arConfigs['RATING_ID']) . "' as RATING_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['MODULE_ID']) . "' as MODULE_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['RATING_TYPE']) . "' as RATING_TYPE,\n\t\t\t\t'" . $DB->ForSql($arConfigs['NAME']) . "' as NAME,\n\t\t\t\t'" . $DB->ForSql($arConfigs['COMPLEX_NAME']) . "' as COMPLEX_NAME,\n\t\t\t\tENTITY_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['ENTITY_ID']) . "'  ENTITY_TYPE_ID,\n\t\t\t\tSUM(CURRENT_VALUE) CURRENT_VALUE\n\t\t\tFROM (\n\t\t\t\t" . $sqlAllMessage . "\n\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tSUM(IF(TO_DAYS(POST_DATE) > TO_DAYS(NOW())-1, 1, 0))*" . floatval($arConfigs['CONFIG']['TODAY_POST_COEF']) . " +\n\t\t\t\t\tSUM(IF(TO_DAYS(POST_DATE) > TO_DAYS(NOW())-7, 1, 0))*" . floatval($arConfigs['CONFIG']['WEEK_POST_COEF']) . "+\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['MONTH_POST_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_forum_message\n\t\t\t\tWHERE POST_DATE  > DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\tGROUP BY AUTHOR_ID\n\n\t\t\t\tUNION ALL\n\t\t\t\t" . $sqlAllTopic . "\n\n\t\t\t\tSELECT\n\t\t\t\t\tUSER_START_ID as ENTITY_ID,\n\t\t\t\t\tSUM(IF(TO_DAYS(START_DATE) > TO_DAYS(NOW())-1, 1, 0))*" . floatval($arConfigs['CONFIG']['TODAY_TOPIC_COEF']) . " +\n\t\t\t\t\tSUM(IF(TO_DAYS(START_DATE) > TO_DAYS(NOW())-7, 1, 0))*" . floatval($arConfigs['CONFIG']['WEEK_TOPIC_COEF']) . " +\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['MONTH_TOPIC_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_forum_topic\n\t\t\t\tWHERE START_DATE  > DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\tGROUP BY USER_START_ID\n\t\t\t) q\n\t\t\tWHERE ENTITY_ID > 0\n\t\t\tGROUP BY ENTITY_ID";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:ratings_components.php

示例3: CalcActivity

 public static function CalcActivity($arConfigs)
 {
     global $DB;
     $err_mess = CRatings::err_mess() . "<br>Function: CRatingsComponentsBlog::CalcActivity<br>Line: ";
     CRatings::AddComponentResults($arConfigs);
     $strSql = "DELETE FROM b_rating_component_results WHERE RATING_ID = '" . IntVal($arConfigs['RATING_ID']) . "' AND COMPLEX_NAME = '" . $DB->ForSql($arConfigs['COMPLEX_NAME']) . "'";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     $sqlAllPost = '';
     if (isset($arConfigs['CONFIG']['ALL_POST_COEF']) && $arConfigs['CONFIG']['ALL_POST_COEF'] != 0) {
         $sqlAllPost = "\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['ALL_POST_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_blog_post\n\t\t\t\tWHERE DATE_PUBLISH < DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\t\t\tAND PUBLISH_STATUS = '" . BLOG_PUBLISH_STATUS_PUBLISH . "'\n\t\t\t\tGROUP BY AUTHOR_ID\n\t\t\t\tUNION ALL ";
     }
     $sqlAllComment = '';
     if (isset($arConfigs['CONFIG']['ALL_COMMENT_COEF']) && $arConfigs['CONFIG']['ALL_COMMENT_COEF'] != 0) {
         $sqlAllComment = "\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['ALL_COMMENT_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_blog_comment\n\t\t\t\tWHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\t\tAND PUBLISH_STATUS = '" . BLOG_PUBLISH_STATUS_PUBLISH . "'\n\t\t\t\tGROUP BY AUTHOR_ID\n\t\t\t\tUNION ALL ";
     }
     $strSql = "INSERT INTO b_rating_component_results (RATING_ID, MODULE_ID, RATING_TYPE, NAME, COMPLEX_NAME, ENTITY_ID, ENTITY_TYPE_ID, CURRENT_VALUE)\n\t\t\tSELECT\n\t\t\t\t'" . IntVal($arConfigs['RATING_ID']) . "' as RATING_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['MODULE_ID']) . "' as MODULE_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['RATING_TYPE']) . "' as RATING_TYPE,\n\t\t\t\t'" . $DB->ForSql($arConfigs['NAME']) . "' as NAME,\n\t\t\t\t'" . $DB->ForSql($arConfigs['COMPLEX_NAME']) . "' as COMPLEX_NAME,\n\t\t\t\tENTITY_ID,\n\t\t\t\t'" . $DB->ForSql($arConfigs['ENTITY_ID']) . "'  ENTITY_TYPE_ID,\n\t\t\t\tSUM(CURRENT_VALUE) CURRENT_VALUE\n\t\t\tFROM (\n\t\t\t\t" . $sqlAllPost . "\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tSUM(IF(TO_DAYS(DATE_PUBLISH) > TO_DAYS(NOW())-1, 1, 0))*" . floatval($arConfigs['CONFIG']['TODAY_POST_COEF']) . " +\n\t\t\t\t\tSUM(IF(TO_DAYS(DATE_PUBLISH) > TO_DAYS(NOW())-7, 1, 0))*" . floatval($arConfigs['CONFIG']['WEEK_POST_COEF']) . "+\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['MONTH_POST_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_blog_post\n\t\t\t\tWHERE DATE_PUBLISH  > DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\t\t\tAND PUBLISH_STATUS = '" . BLOG_PUBLISH_STATUS_PUBLISH . "'\n\t\t\t\tGROUP BY AUTHOR_ID\n\n\t\t\t\tUNION ALL\n\t\t\t\t" . $sqlAllComment . "\n\t\t\t\tSELECT\n\t\t\t\t\tAUTHOR_ID as ENTITY_ID,\n\t\t\t\t\tSUM(IF(TO_DAYS(DATE_CREATE) > TO_DAYS(NOW())-1, 1, 0))*" . floatval($arConfigs['CONFIG']['TODAY_COMMENT_COEF']) . " +\n\t\t\t\t\tSUM(IF(TO_DAYS(DATE_CREATE) > TO_DAYS(NOW())-7, 1, 0))*" . floatval($arConfigs['CONFIG']['WEEK_COMMENT_COEF']) . " +\n\t\t\t\t\tCOUNT(*)*" . floatval($arConfigs['CONFIG']['MONTH_COMMENT_COEF']) . " as CURRENT_VALUE\n\t\t\t\tFROM b_blog_comment\n\t\t\t\tWHERE DATE_CREATE  > DATE_SUB(NOW(), INTERVAL 30 DAY)\n\t\t\t\t\tAND PUBLISH_STATUS = '" . BLOG_PUBLISH_STATUS_PUBLISH . "'\n\t\t\t\tGROUP BY AUTHOR_ID\n\t\t\t) q\n\t\t\tWHERE ENTITY_ID > 0\n\t\t\tGROUP BY ENTITY_ID";
     $res = $DB->Query($strSql, false, $err_mess . __LINE__);
     return true;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:19,代码来源:ratings_components.php


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