本文整理汇总了PHP中products_minierp::calculateStars方法的典型用法代码示例。如果您正苦于以下问题:PHP products_minierp::calculateStars方法的具体用法?PHP products_minierp::calculateStars怎么用?PHP products_minierp::calculateStars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类products_minierp
的用法示例。
在下文中一共展示了products_minierp::calculateStars方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
//SAVE LOG DATA PER PRODUCT (DAILY)
//Stop Querying Data because module is no longer critical compare to the amount of Data generated
//$query_log_daily = "INSERT INTO products_log_daily";
//$query_log_daily .= " SELECT DATE(NOW()) log_date,";
//$query_log_daily .= " products_id, weekly_view, monthly_view, weekly_sold, sold_monthly_1, sold_monthly_2, sold_monthly_3";
//$query_log_daily .= " FROM products_log";
//tep_db_query($query_log_daily);
$logger->write("DONE - SAVE LOG DATA PER ARTICLE");
unset($articles);
//AVOID HALTED PROCESS WHEN ASSIGNING BIG ARRAY ON PRODUCTS STARS PROCESS BELOW
////////////////////
// PRODUCTS STARS //
////////////////////
$products_stars = array();
foreach ($products as $pid => $dt) {
$stars = $class_pm->calculateStars($dt['sold_monthly_1']);
$products_stars[$stars][] = $pid;
}
tep_db_query("UPDATE products SET stars = 0");
foreach ($products_stars as $stars => $pids_stars) {
if ($stars > 0) {
tep_db_query("UPDATE products SET stars = {$stars} WHERE products_id IN (" . implode(',', $pids_stars) . ")");
}
}
$logger->write("DONE - PRODUCTS STARS");
unset($products);
/////////////////////////
// PRODUCTS STATIC LOG //
/////////////////////////
$year_static_log = date('Y', strtotime('-' . product::STATIC_LOG_LOOKBACK_TOLERANCE . ' days'));
product::generateStaticLog($year_static_log);