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


PHP products_minierp::getDIOHstockTarget方法代码示例

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


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

示例1: array

tep_db_connect();
define('STOCK_WARNING_LIMIT', 0.5);
//Alert if stock availibility is below this level (in percentage, 0,8=80%)
$products = array();
$articles = array();
use_class('products_minierp');
$class_pm = new products_minierp();
$bg_settings = $class_pm->retrieveBestGoodSettings();
$q = "SELECT pal.products_id, pal.products_articles_id AS articles_id, IFNULL(ps.stock, 0) AS stock";
$q .= "  FROM products_log pl";
$q .= " INNER JOIN products p ON p.products_id=pl.products_id AND p.stars=3";
$q .= " INNER JOIN products_articles_log pal ON pal.products_id=pl.products_id";
$q .= " LEFT JOIN products_stock ps ON ps.jng_warehouses_id=" . WAREHOUSE_ID_PRODUCTS_HAMBURG . " AND ps.products_id=pl.products_id AND ps.articles_id=pal.products_articles_id";
$r = tep_db_query($q);
while ($row = tep_db_fetch_array($r)) {
    $target = $class_pm->getDIOHstockTarget($row['products_id'], $row['articles_id']);
    $percent = $target == 0 ? 0 : $row['stock'] / $target;
    if ($percent < STOCK_WARNING_LIMIT) {
        if (!in_array($row['products_id'], $products)) {
            $products[] = $row['products_id'];
        }
        $articles[] = $row['products_id'] . '-' . $row['articles_id'];
    }
}
$products_total = count($products);
$articles_total = count($articles);
if ($products_total > 0) {
    $subject = 'Depot Stock Report';
    $send_message = '<p>This email is sent automatically by Manobo.</p>';
    $send_message .= '<p>We have today ' . $products_total . ' Top Seller Products (' . $articles_total . ' Articles) with stock ' . STOCK_WARNING_LIMIT * 100 . '% below our stock target</p>';
    $send_message .= '<p>MANOBO</p>';
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:early-warnings.php


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