Example #1
0
function get_purchase_info($order_sn)
{
    //获取订单下真实料号情况
    global $dbcon;
    $results = array();
    $sql = "SELECT sku,ebay_amount FROM ebay_orderdetail WHERE ebay_ordersn='{$order_sn}'";
    $sql = $dbcon->execute($sql);
    $orderdetaillist = $dbcon->getResultArray($sql);
    foreach ($orderdetaillist as $orderdetail) {
        $sku_arr = get_realskuinfo($orderdetail['sku']);
        foreach ($sku_arr as $or_sku => $or_nums) {
            $results[$or_sku] = get_sku_info($or_sku);
        }
    }
    return $results;
}
Example #2
0
function get_purchase_info($order_sn)
{
    global $dbcon;
    $results = array();
    $sql = "SELECT sku,ebay_amount FROM ebay_orderdetail WHERE ebay_ordersn='{$order_sn}'";
    $sql = $dbcon->execute($sql);
    $orderdetaillist = $dbcon->getResultArray($sql);
    foreach ($orderdetaillist as $orderdetail) {
        if (strpos($orderdetail['sku'], ',') !== false) {
            $skulists = explode(',', $orderdetail['sku']);
            foreach ($skulists as $skulist) {
                list($snum, $sku) = strpos($skulist, '*') !== false ? explode('*', $skulist) : array(1, $skulist);
                $results[$sku] = get_sku_info($sku);
            }
        } else {
            list($snum, $sku) = strpos($orderdetail['sku'], '*') !== false ? explode('*', $orderdetail['sku']) : array(1, $orderdetail['sku']);
            $results[$sku] = get_sku_info($sku);
        }
    }
    return $results;
}