本文整理汇总了PHP中SC_Helper_Purchase_Ex::getShippings方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Helper_Purchase_Ex::getShippings方法的具体用法?PHP SC_Helper_Purchase_Ex::getShippings怎么用?PHP SC_Helper_Purchase_Ex::getShippings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Helper_Purchase_Ex
的用法示例。
在下文中一共展示了SC_Helper_Purchase_Ex::getShippings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setOrderToFormParam
/**
* 受注データを取得して, SC_FormParam へ設定する.
*
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @param integer $order_id 取得元の受注ID
* @return void
*/
public function setOrderToFormParam(&$objFormParam, $order_id)
{
$objPurchase = new SC_Helper_Purchase_Ex();
// 受注詳細を設定
$arrOrderDetail = $objPurchase->getOrderDetail($order_id, false);
$objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail));
$arrShippingsTmp = $objPurchase->getShippings($order_id);
$arrShippings = array();
if ($arrShippingsTmp) {
foreach ($arrShippingsTmp as $row) {
// お届け日の処理
if (!SC_Utils_Ex::isBlank($row['shipping_date'])) {
$ts = strtotime($row['shipping_date']);
$row['shipping_date_year'] = date('Y', $ts);
$row['shipping_date_month'] = date('n', $ts);
$row['shipping_date_day'] = date('j', $ts);
}
$arrShippings[$row['shipping_id']] = $row;
}
} else {
// ダウンロード商品の場合はお届け先情報がないので受注詳細から必要なデータを挿入する
foreach ($this->arrShippingKeys as $keys) {
$arrShippings[0][$keys] = '';
}
foreach ($arrOrderDetail as $key => $value) {
$arrShippings[0]['shipment_item'][$key]['shipping_id'] = $key;
$arrShippings[0]['shipment_item'][$key]['product_class_id'] = $value['product_class_id'];
$arrShippings[0]['shipment_item'][$key]['quantity'] = $value['quantity'];
}
}
$objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings));
/*
* 配送商品を設定
*
* $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値
* $arrProductQuantity[$shipping_id] = お届け先ごとの配送商品数量
*/
$arrShipmentItem = array();
foreach ($arrShippings as $shipping_id => $arrShipping) {
foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) {
foreach ($arrItem as $item_key => $item_val) {
$arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val;
}
}
}
$objFormParam->setParam($arrShipmentItem);
/*
* 受注情報を設定
* $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値
* が渡ってくるため, $arrOrder で上書きする.
*/
$arrOrder = $objPurchase->getOrder($order_id);
// 生年月日の処理
if (!SC_Utils_Ex::isBlank($arrOrder['order_birth'])) {
$order_birth = substr($arrOrder['order_birth'], 0, 10);
$arrOrderBirth = explode("-", $order_birth);
$arrOrder['order_birth_year'] = intval($arrOrderBirth[0]);
$arrOrder['order_birth_month'] = intval($arrOrderBirth[1]);
$arrOrder['order_birth_day'] = intval($arrOrderBirth[2]);
}
$objFormParam->setParam($arrOrder);
// ポイントを設定
if (USE_POINT !== false) {
list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint($order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status']);
$objFormParam->setValue('total_point', $db_point);
$objFormParam->setValue('point', $rollback_point);
} else {
$objFormParam->setValue('total_point', 0);
$objFormParam->setValue('point', 0);
}
if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) {
$arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id'));
$objFormParam->setValue('customer_point', $arrCustomer['point']);
}
}
示例2: setOrderToFormParam
/**
* 受注データを取得して, SC_FormParam へ設定する.
*
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @param integer $order_id 取得元の受注ID
* @return void
*/
function setOrderToFormParam(&$objFormParam, $order_id)
{
$objPurchase = new SC_Helper_Purchase_Ex();
// 受注詳細を設定
$arrOrderDetail = $objPurchase->getOrderDetail($order_id, false);
$objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail));
$arrShippingsTmp = $objPurchase->getShippings($order_id);
$arrShippings = array();
foreach ($arrShippingsTmp as $row) {
// お届け日の処理
if (!SC_Utils_Ex::isBlank($row['shipping_date'])) {
$ts = strtotime($row['shipping_date']);
$row['shipping_date_year'] = date('Y', $ts);
$row['shipping_date_month'] = date('n', $ts);
$row['shipping_date_day'] = date('j', $ts);
}
$arrShippings[$row['shipping_id']] = $row;
}
$objFormParam->setValue('shipping_quantity', count($arrShippings));
$objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings));
/*
* 配送商品を設定
*
* $arrShipmentItem['shipment_(key)'][$shipping_id][$item_index] = 値
* $arrProductQuantity[$shipping_id] = 配送先ごとの配送商品数量
*/
$arrProductQuantity = array();
$arrShipmentItem = array();
foreach ($arrShippings as $shipping_id => $arrShipping) {
$arrProductQuantity[$shipping_id] = count($arrShipping['shipment_item']);
foreach ($arrShipping['shipment_item'] as $item_index => $arrItem) {
foreach ($arrItem as $item_key => $item_val) {
$arrShipmentItem['shipment_' . $item_key][$shipping_id][$item_index] = $item_val;
}
}
}
$objFormParam->setValue('shipping_product_quantity', $arrProductQuantity);
$objFormParam->setParam($arrShipmentItem);
/*
* 受注情報を設定
* $arrOrderDetail と項目が重複しており, $arrOrderDetail は連想配列の値
* が渡ってくるため, $arrOrder で上書きする.
*/
$arrOrder = $objPurchase->getOrder($order_id);
$objFormParam->setParam($arrOrder);
// ポイントを設定
list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint($order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status']);
$objFormParam->setValue('total_point', $db_point);
$objFormParam->setValue('point', $rollback_point);
if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) {
$arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id'));
$objFormParam->setValue('customer_point', $arrCustomer['point']);
}
}
示例3: lfGetShippingDate
/**
* 受注お届け先情報の取得
*
* @param SC_Helper_Purchase_Ex $objPurchase object SC_Helper_Purchaseクラス
* @param $order_id integer 注文番号
* @param $arrWDAY array 曜日データの配列
* @return array お届け先情報
*/
public function lfGetShippingDate(&$objPurchase, $order_id, $arrWDAY)
{
$arrShipping = $objPurchase->getShippings($order_id);
foreach ($arrShipping as $shipping_index => $shippingData) {
foreach ($shippingData as $key => $val) {
if ($key == 'shipping_date' && SC_Utils_Ex::isBlank($val) == false) {
// お届け日を整形
list($y, $m, $d, $w) = explode(' ', date('Y m d w', strtotime($val)));
$arrShipping[$shipping_index]['shipping_date'] = sprintf('%04d/%02d/%02d(%s)', $y, $m, $d, $arrWDAY[$w]);
}
}
}
return $arrShipping;
}