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


PHP Orders::table方法代码示例

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


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

示例1: getSkuAllNum

 public static function getSkuAllNum($sku)
 {
     if (!$sku) {
         return array();
     }
     $table = self::table();
     $order_table = Orders::table();
     $sql = "SELECT SUM(a.product_num) AS product_num FROM {$table} AS a, {$order_table} AS b WHERE b.order_code=a.order_code AND b.order_status IN (2,3,4,5) AND a.product_sku='{$sku}'";
     $product_nums = DB::GetQueryResult($sql, true);
     $product_nums = isset($product_nums['product_num']) ? (int) $product_nums['product_num'] : 0;
     return $product_nums;
 }
开发者ID:isonz,项目名称:fxptpcn,代码行数:12,代码来源:OrdersProducts.class.php

示例2: RIGHT

            $where = $where0 . "user_code='{$user_code}' AND create_time>={$stardate} AND create_time<={$enddate}";
        }
    }
    if (!$keyword) {
        //DB::Debug();
        $order = Orders::paging($page, $page_size, $where, "id DESC", "*");
    } else {
        if ('bh' == $keyword) {
            //DB::Debug();
            $ordertable = Orders::table();
            $orderproducttable = OrdersProducts::table();
            $sql = " SELECT a.* FROM {$ordertable} AS a, {$orderproducttable} AS b WHERE RIGHT(a.order_code,2)='BH' AND a.order_code=b.order_code AND a.user_code='{$user_code}' ORDER BY a.id DESC";
            $order = Paging::bySQL($sql, $page, $page_size, 'a');
        } else {
            //DB::Debug();
            $ordertable = Orders::table();
            $orderproducttable = OrdersProducts::table();
            $sql = " SELECT a.* FROM {$ordertable} AS a, {$orderproducttable} AS b WHERE (RIGHT(a.order_code,2)='SK' OR LEFT(a.order_code,4)='FXAD') AND a.order_code=b.order_code AND a.user_code='{$user_code}' AND (a.order_code LIKE '%{$keyword}%' OR b.product_sku LIKE '%{$keyword}%')  GROUP BY a.order_code ORDER BY a.id DESC";
            $order = Paging::bySQL($sql, $page, $page_size, 'a');
        }
    }
}
$orders = $order['data'];
$paged = $order['page'];
foreach ($orders as $k => $order) {
    $order_code = $order['order_code'];
    $products = OrdersProducts::getUserProducts($order_code);
    $tmp = array();
    //获取各个PRODCUT STOCK
    $len = count($products);
    for ($i = 0; $i < $len; $i++) {
开发者ID:isonz,项目名称:fxptpcn,代码行数:31,代码来源:home.php


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