促销商品总数
// 促销商品总算 function grab_promote_goods_count(){ $time = gmtime(); $sql = "SELECT COUNT(*) " . "FROM " . $GLOBALS[‘ecs‘]->table(‘goods‘)."WHERE is_on_sale = 1 AND is_alone_sale = 1 AND is_delete = 0 AND is_promote = 1 AND promote_start_date <= ‘$time‘ AND promote_end_date >= ‘$time‘"; return $GLOBALS[‘db‘]->getOne($sql); }
原文:http://www.cnblogs.com/wesky/p/4916887.html