0 && strlen($array["month"]) > 0 && strlen($array["day"]) > 0) { $arrRegist["birth"] = $array["year"] ."/". $array["month"] ."/". $array["day"] ." 00:00:00"; } else { $arrRegist["birth"] = NULL; } //-- パスワードの更新がある場合は暗号化。(更新がない場合はUPDATE文を構成しない) if ($array["password"] != DEFAULT_PASSWORD) $arrRegist["password"] = sha1($array["password"] . ":" . AUTH_MAGIC); $arrRegist["update_date"] = "NOW()"; //-- 編集登録実行 $objQuery->update("dtb_customer", $arrRegist, "customer_id = ? ", array($array['customer_id'])); } /** * 注文番号、利用ポイント、加算ポイントから最終ポイントを取得する. * * @param integer $order_id 注文番号 * @param integer $use_point 利用ポイント * @param integer $add_point 加算ポイント * @return array 最終ポイントの配列 */ function sfGetCustomerPoint($order_id, $use_point, $add_point) { $objQuery =& SC_Query::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) { if (USE_POINT !== false) { $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); $point = $arrRet[0]['point']; $total_point = $arrRet[0]['point'] - $use_point + $add_point; } else { $total_point = 0; $point = 0; } } else { $total_point = ""; $point = ""; } return array($point, $total_point); } /** * emailアドレスから、登録済み会員や退会済み会員をチェックする * * @param string $email メールアドレス * @return integer 0:登録可能 1:登録済み 2:再登録制限期間内削除ユーザー */ function lfCheckRegisterUserFromEmail($email){ $return = 0; $objQuery =& SC_Query::getSingletonInstance(); $arrRet = $objQuery->select("email, update_date, del_flg" ,"dtb_customer" ,"email = ? OR email_mobile = ? ORDER BY del_flg" ,array($email, $email) ); if(count($arrRet) > 0) { if($arrRet[0]['del_flg'] != '1') { // 会員である場合 if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; $return = 1; } else { // 退会した会員である場合 $leave_time = SC_Utils_Ex::sfDBDatetoTime($arrRet[0]['update_date']); $now_time = time(); $pass_time = $now_time - $leave_time; // 退会から何時間-経過しているか判定する。 $limit_time = ENTRY_LIMIT_HOUR * 3600; if($pass_time < $limit_time) { if (!isset($objErr->arrErr['email'])) $objErr->arrErr['email'] = ""; $return = 2; } } } return $return; } }