Changeset 18077
- Timestamp:
- 2009/06/09 20:53:56 (15 years ago)
- Location:
- branches/comu-ver2/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/helper/SC_Helper_DB.php
r18052 r18077 549 549 550 550 /** 551 * 顧客番号、利用ポイント、加算ポイントから最終ポイントを取得する. 552 * 553 * @param integer $customer_id 顧客番号 554 * @param integer $use_point 利用ポイント 555 * @param integer $add_point 加算ポイント 556 * @return array 最終ポイントの配列 557 */ 558 function sfGetCustomerPointFromCid($customer_id, $use_point, $add_point) { 559 $objQuery = new SC_Query(); 560 if (USE_POINT === true) { 561 $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 562 $point = $arrRet[0]['point']; 563 $total_point = $arrRet[0]['point'] - $use_point + $add_point; 564 } else { 565 $total_point = 0; 566 $point = 0; 567 } 568 return array($point, $total_point); 569 } 570 /** 551 571 * カテゴリツリーの取得を行う. 552 572 * -
branches/comu-ver2/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
r18074 r18077 150 150 // 入力値の変換 151 151 $this->objFormParam->convParam(); 152 $this->arrErr = $this->lfCheckError(); 153 $this->arrErr = array_merge((array)$this->arrErr, (array)$this->lfCheek()); 152 $this->arrErr = array_merge((array)$this->lfCheckError(), (array)$this->lfCheek($_POST['mode'])); 154 153 155 154 if(count($this->arrErr) == 0) { … … 179 178 // 入力値の変換 180 179 $this->objFormParam->convParam(); 181 $this->arrErr = $this->lfCheckError(); 182 #if(count($this->arrErr) == 0) { 183 $this->arrErr = $this->lfCheek(); 184 #} 180 $this->arrErr = array_merge((array)$this->lfCheckError(), (array)$this->lfCheek($_POST['mode'])); 185 181 break; 186 182 /* ペイジェント決済モジュール連携用 */ … … 456 452 457 453 /* 計算処理 */ 458 function lfCheek( ) {454 function lfCheek($mode = "") { 459 455 $objDb = new SC_Helper_DB_Ex(); 460 456 $arrVal = $this->objFormParam->getHashArray(); … … 487 483 $arrVal['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($totalpoint, $arrVal['use_point']); 488 484 489 list($arrVal['point'], $arrVal['total_point']) = $objDb->sfGetCustomerPoint($_POST['order_id'], $arrVal['use_point'], $arrVal['add_point']); 490 491 if($arrVal['total'] < 0) { 485 if (strlen($_POST['customer_id']) > 0){ 486 list($arrVal['point'], $arrVal['total_point']) = $objDb->sfGetCustomerPointFromCid($_POST['customer_id'], $arrVal['use_point'], $arrVal['add_point']); 487 }else{ 488 list($arrVal['point'], $arrVal['total_point']) = $objDb->sfGetCustomerPoint($_POST['order_id'], $arrVal['use_point'], $arrVal['add_point']); 489 } 490 if ($arrVal['total'] < 0) { 492 491 $arrErr['total'] = '合計額がマイナス表示にならないように調整して下さい。<br />'; 493 492 } 494 493 495 if ($arrVal['payment_total'] < 0) {494 if ($arrVal['payment_total'] < 0) { 496 495 $arrErr['payment_total'] = 'お支払い合計額がマイナス表示にならないように調整して下さい。<br />'; 497 496 } 498 if($arrVal['total_point'] < 0) { 499 $arrErr['total_point'] = '最終保持ポイントがマイナス表示にならないように調整して下さい。<br />'; 497 //新規追加受注のみ 498 if ($mode == "add") { 499 if ($arrVal['total_point'] < 0) { 500 $arrErr['use_point'] = '最終保持ポイントがマイナス表示にならないように調整して下さい。<br />'; 501 } 500 502 } 501 503
Note: See TracChangeset
for help on using the changeset viewer.