當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Orders::GetSuppliersAltern方法代碼示例

本文整理匯總了PHP中Orders::GetSuppliersAltern方法的典型用法代碼示例。如果您正苦於以下問題:PHP Orders::GetSuppliersAltern方法的具體用法?PHP Orders::GetSuppliersAltern怎麽用?PHP Orders::GetSuppliersAltern使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Orders的用法示例。


在下文中一共展示了Orders::GetSuppliersAltern方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: aasort

            $order_supplier[$current_order][$sup_key]['place'] = $supplier['place'];
            $order_supplier[$current_order][$sup_key]['art'] = $supplier['art'];
        }
    }
}
$tpl->Assign("os", $order_supplier);
$tpl->Assign("sorders", $supplier_order);
$tpl->Assign("orders", $orders_data);
$tpl->Assign("contragent", $contragent_data);
function aasort(&$array, $key)
{
    $sorter = array();
    $ret = array();
    reset($array);
    foreach ($array as $ii => $va) {
        $sorter[$ii] = $va[$key];
    }
    asort($sorter, SORT_STRING);
    foreach ($sorter as $ii => $va) {
        $ret[$ii] = $array[$ii];
    }
    $array = $ret;
}
aasort($suppliers_data, "art");
$tpl->Assign('suppliers', $suppliers_data);
$suppliers_altern = array();
$Order->GetSuppliersAltern($order_id);
$suppliers_altern = $Order->list;
$tpl->Assign('suppliers_altern', $suppliers_altern);
echo $tpl->Parse($GLOBALS['PATH_tpl'] . 'composed_invoice.tpl');
exit(0);
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:composed_invoice.php

示例2: foreach

    $sum = 0;
    $sum_mopt = 0;
    $suppliers[$k]['sweight'] = 0;
    $suppliers[$k]['svolume'] = 0;
    foreach ($Order->list as $product) {
        if ($product['opt_qty'] > 0 && $product['id_supplier'] == $s['id_supplier']) {
            $sum = round($sum + $product['opt_sum'], 2);
            $suppliers[$k]['sweight'] += round($product['weight'] * $product['opt_qty'], 2);
            $suppliers[$k]['svolume'] += round($product['volume'] * $product['opt_qty'], 2);
        }
        if ($product['mopt_qty'] > 0 && $product['id_supplier_mopt'] == $s['id_supplier']) {
            $sum_mopt = round($sum_mopt + $product['mopt_sum'], 2);
            $suppliers[$k]['sweight'] += round($product['weight'] * $product['mopt_qty'], 2);
            $suppliers[$k]['svolume'] += round($product['volume'] * $product['mopt_qty'], 2);
        }
    }
    $suppliers[$k]['sum'] = $sum + $sum_mopt;
    $suppliers[$k]['dn'] = $Supplier->GetDNByDate($s['id_supplier'], $ord['target_date']);
}
$tpl->Assign('suppliers', $suppliers);
$tpl->Assign('products', $parr);
$suppliers_altern = array();
$Order->GetSuppliersAltern($id_order);
$suppliers_altern = $Order->list;
$tpl->Assign('suppliers_altern', $suppliers_altern);
//print_r($suppliers_altern);
//print_r($suppliers);
//print_r($parr);
echo $tpl->Parse($GLOBALS['PATH_tpl'] . 'invoice_contragent.tpl');
exit(0);
// ---- right ----
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:invoice_contragent.php


注:本文中的Orders::GetSuppliersAltern方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。