- Timestamp:
- 2011/01/11 16:06:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
r19860 r19864 434 434 435 435 /** 436 * 会員編集登録処理を行う.437 *438 * @param array $array パラメータの配列439 * @param array $arrRegistColumn 登録するカラムの配列440 * @return void441 */442 function sfEditCustomerData($array, $arrRegistColumn) {443 $objQuery =& SC_Query::getSingletonInstance();444 445 foreach ($arrRegistColumn as $data) {446 if ($data["column"] != "password") {447 if($array[ $data['column'] ] != "") {448 $arrRegist[ $data["column"] ] = $array[ $data["column"] ];449 } else {450 $arrRegist[ $data['column'] ] = NULL;451 }452 }453 }454 if (strlen($array["year"]) > 0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) {455 $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00";456 } else {457 $arrRegist["birth"] = NULL;458 }459 460 //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない)461 if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC);462 $arrRegist["update_date"] = "NOW()";463 464 //-- 編集登録実行465 $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id']));466 }467 468 /**469 436 * 受注番号、最終ポイント、加算ポイント、利用ポイントから「オーダー前ポイント」を取得する 470 437 * … … 489 456 } 490 457 491 /** 492 * 注文番号、利用ポイント、加算ポイントから最終ポイントを取得する. 493 * 494 * @param integer $order_id 注文番号 495 * @param integer $use_point 利用ポイント 496 * @param integer $add_point 加算ポイント 497 * @return array 最終ポイントの配列 498 */ 499 function sfGetCustomerPoint($order_id, $use_point, $add_point) { 500 $objQuery =& SC_Query::getSingletonInstance(); 501 $arrRet = $objQuery->select("customer_id", "dtb_order", "order_id = ?", array($order_id)); 502 $customer_id = $arrRet[0]['customer_id']; 503 if ($customer_id != "" && $customer_id >= 1) { 504 if (USE_POINT !== false) { 505 $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 506 $point = $arrRet[0]['point']; 507 $total_point = $arrRet[0]['point'] - $use_point + $add_point; 508 } else { 509 $total_point = 0; 510 $point = 0; 511 } 512 } else { 513 $total_point = ""; 514 $point = ""; 515 } 516 return array($point, $total_point); 517 } 518 519 /** 520 * 顧客番号、利用ポイント、加算ポイントから最終ポイントを取得する. 521 * 522 * @param integer $customer_id 顧客番号 523 * @param integer $use_point 利用ポイント 524 * @param integer $add_point 加算ポイント 525 * @return array 最終ポイントの配列 526 */ 527 function sfGetCustomerPointFromCid($customer_id, $use_point, $add_point) { 528 $objQuery =& SC_Query::getSingletonInstance(); 529 if (USE_POINT !== false) { 530 $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 531 $point = $arrRet[0]['point']; 532 $total_point = $arrRet[0]['point'] - $use_point + $add_point; 533 } else { 534 $total_point = 0; 535 $point = 0; 536 } 537 return array($point, $total_point); 538 } 458 459 539 460 /** 540 461 * カテゴリツリーの取得を行う.
Note: See TracChangeset
for help on using the changeset viewer.