Skip to content

Commit

Permalink
PHP8 で LC_Page_Admin_Order_Edit::lfCheckError() のエラーを回避
Browse files Browse the repository at this point in the history
f0ecec3 では不十分で、```$objFormParam->getValue('point')``` が ```""``` となり、```TypeError: Unsupported operand types: string - string``` を生じるケースがあった。
  • Loading branch information
seasoftjapan committed Feb 10, 2024
1 parent f0ecec3 commit 8fac1d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
16 changes: 7 additions & 9 deletions data/class/helper/SC_Helper_DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,13 @@ public function sfGetRootId()
public static function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status)
{
$objQuery = SC_Query_Ex::getSingletonInstance();
$arrRet = $objQuery->select('customer_id', 'dtb_order', 'order_id = ?', array($order_id));
$customer_id = $arrRet[0]['customer_id'];
if ($customer_id != '' && $customer_id >= 1) {
$arrRet = $objQuery->select('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$point = $arrRet[0]['point'];
$rollback_point = $arrRet[0]['point'];

$customer_id = (int) $objQuery->get('customer_id', 'dtb_order', 'order_id = ?', array($order_id));
$rollback_point = 0;
$point = 0;
if ($customer_id >= 1) {
$point = (int) $objQuery->get('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$rollback_point = $point;

// 対応状況がポイント利用対象の場合、使用ポイント分を戻す
if (SC_Helper_Purchase_Ex::isUsePoint($order_status)) {
Expand All @@ -336,9 +337,6 @@ public static function sfGetRollbackPoint($order_id, $use_point, $add_point, $or
if (SC_Helper_Purchase_Ex::isAddPoint($order_status)) {
$rollback_point -= $add_point;
}
} else {
$rollback_point = '';
$point = '';
}

return array($point, $rollback_point);
Expand Down
3 changes: 0 additions & 3 deletions data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,6 @@ public function setOrderToFormParam(&$objFormParam, $order_id)
);
$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'))) {
Expand Down

0 comments on commit 8fac1d1

Please sign in to comment.