Esempio n. 1
0
 public static function getOrderSku($order_code)
 {
     if (!$order_code) {
         return array();
     }
     $table = self::table();
     $sku_table = ProductsSku::table();
     $item_table = ProductsItem::table();
     $pic_table = ProductsPic::table();
     $sql = "SELECT c.title, b.sku, b.sku_name, b.item, b.current_price, SUM(a.product_num) AS product_num\n\t\tFROM {$table} AS a, {$sku_table} AS b, {$item_table} AS c\n\t\tWHERE c.item=b.item AND a.product_sku=b.sku AND a.order_code='{$order_code}' GROUP BY a.product_sku";
     $rs = DB::GetQueryResult($sql, false);
     return $rs;
 }
Esempio n. 2
0
 public static function getLists($user_id, $page, $page_size)
 {
     $user_id = (int) $user_id;
     if (!$user_id) {
         return array();
     }
     $table = self::table();
     $sku_table = ProductsSku::table();
     $item_table = ProductsItem::table();
     $sql = " SELECT a.id, b.id AS skuid, c.title, b.sku, b.sku_name, b.current_price FROM {$table} AS a, {$sku_table} AS b, {$item_table} AS c WHERE b.item=c.item AND a.sku_id=b.id AND a.user_id='{$user_id}' ORDER BY a.id DESC";
     $lists = Paging::bySQL($sql, $page, $page_size, 'a');
     ProductsSku::getProductsPic($lists['data']);
     return $lists;
 }