Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

受注管理画面の Warning 修正 #1130

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ public function lfCheckError(&$objFormParam)

$arrErr = [];
$arrErrTemp = $objFormParam->checkError();
$arrErrDate = [];
$arrErrDate = ['shipping_date_year' => []];
foreach ($arrValues['shipping_date_year'] as $key_index => $year) {
$month = $arrValues['shipping_date_month'][$key_index];
$day = $arrValues['shipping_date_day'][$key_index];
Expand All @@ -702,7 +702,7 @@ public function lfCheckError(&$objFormParam)
'shipping_date_day' => $day,
]);
$objError->doFunc(['お届け日', 'shipping_date_year', 'shipping_date_month', 'shipping_date_day'], ['CHECK_DATE']);
$arrErrDate['shipping_date_year'][$key_index] = $objError->arrErr['shipping_date_year'];
$arrErrDate['shipping_date_year'][$key_index] = isset($objError->arrErr['shipping_date_year']) ? $objError->arrErr['shipping_date_year'] : '';
}
$arrErrTemp = array_merge($arrErrTemp, $arrErrDate);

Expand All @@ -717,7 +717,10 @@ public function lfCheckError(&$objFormParam)
]);
$objError->doFunc(['生年月日', 'order_birth_year', 'order_birth_month', 'order_birth_day'],
['CHECK_BIRTHDAY']);
$arrErrTemp['order_birth_year'] = $objError->arrErr['order_birth_year'];
if (!isset($arrErrTemp['order_birth_year'])) {
$arrErrTemp['order_birth_year'] = '';
}
$arrErrTemp['order_birth_year'] = isset($objError->arrErr['order_birth_year']) ? $objError->arrErr['order_birth_year'] : '';

// 商品の種類数
$max = count($arrValues['quantity']);
Expand Down Expand Up @@ -907,7 +910,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message,
$arrShippingValues[$shipping_index]['deliv_id'] = $objFormParam->getValue('deliv_id');

// お届け時間名称を取得
$arrShippingValues[$shipping_index]['shipping_time'] = $arrDelivTime[$arrShipping['time_id']];
$arrShippingValues[$shipping_index]['shipping_time'] = $arrDelivTime[$arrShipping['time_id']] ?? '';

// 複数配送の場合は配送商品を登録
if (!SC_Utils_Ex::isBlank($arrAllShipmentItem)) {
Expand Down Expand Up @@ -1068,7 +1071,7 @@ public function shipmentAddProduct(&$objFormParam, $add_product_class_id)
// 届け先に選択済みの商品がある場合
$arrShipmentProducts = $this->getShipmentProducts($objFormParam);

if ($arrShipmentProducts['shipment_product_class_id'] && in_array($add_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id])) {
if ($arrShipmentProducts['shipment_product_class_id'] && in_array($add_product_class_id, $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id] ?? [])) {
foreach ($arrShipmentProducts['shipment_product_class_id'][$select_shipping_id] as $relation_index => $shipment_product_class_id) {
if ($shipment_product_class_id == $add_product_class_id) {
$arrShipmentProducts['shipment_quantity'][$select_shipping_id][$relation_index]++;
Expand Down Expand Up @@ -1229,9 +1232,14 @@ public function setProductsQuantity(&$objFormParam)
$arrUpdateQuantity = [];
foreach ($arrShipmentsItems as $arritems) {
foreach ($arritems['shipment_product_class_id'] as $relation_index => $shipment_product_class_id) {
if (!isset($arrUpdateQuantity[$shipment_product_class_id])) {
$arrUpdateQuantity[$shipment_product_class_id] = 0;
}
// XXX 空文字が入ってくる場合があるので数値へキャストする
// きちんとエラーハンドリングすべきだが応急処置
$arrUpdateQuantity[$shipment_product_class_id] += (int) $arritems['shipment_quantity'][$relation_index];
if (is_numeric($arritems['shipment_quantity'][$relation_index])) {
$arrUpdateQuantity[$shipment_product_class_id] += (int) $arritems['shipment_quantity'][$relation_index];
}
}
}

Expand Down Expand Up @@ -1321,11 +1329,11 @@ public function checkInsertOrderProducts(&$objFormParam, $arrProductClassIds, $i
$arrAddProducts = [];
$arrTax = SC_Helper_TaxRule_Ex::getTaxRule($arrAddProductInfo['product_id']);

$arrAddProductInfo['product_name'] = ($arrAddProductInfo['product_name'])
$arrAddProductInfo['product_name'] = isset($arrAddProductInfo['product_name'])
? $arrAddProductInfo['product_name']
: $arrAddProductInfo['name'];

$arrAddProductInfo['price'] = ($arrAddProductInfo['price'])
$arrAddProductInfo['price'] = isset($arrAddProductInfo['price'])
? $arrAddProductInfo['price']
: $arrAddProductInfo['price02'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function action()

// ぶった斬りポイント==================================================================
// ページ送りの処理
$page_max = SC_Utils_Ex::sfGetSearchPageMax($_POST['search_page_max']);
$page_max = SC_Utils_Ex::sfGetSearchPageMax($_POST['search_page_max'] ?? 0);

// ページ送りの取得
$objNavi = new SC_PageNavi_Ex($_POST['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX);
Expand Down
Loading