Changeset 21514 for branches/version-2_12-dev/data/class/SC_Customer.php
- Timestamp:
- 2012/02/15 19:56:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_Customer.php
r21481 r21514 42 42 } 43 43 // 本登録された会員のみ 44 $sql = "SELECT * FROM dtb_customer WHERE (email = ?" . $sql_mobile . ") AND del_flg = 0 AND status = 2";44 $sql = 'SELECT * FROM dtb_customer WHERE (email = ?' . $sql_mobile . ') AND del_flg = 0 AND status = 2'; 45 45 $objQuery = new SC_Query_Ex(); 46 46 $result = $objQuery->getAll($sql, $arrValues); … … 100 100 ) AS addrs 101 101 __EOS__; 102 $objQuery->setOrder( "other_deliv_id IS NULL DESC, other_deliv_id DESC");103 return $objQuery->select( "*", $from, "", array($customer_id, $customer_id));102 $objQuery->setOrder('other_deliv_id IS NULL DESC, other_deliv_id DESC'); 103 return $objQuery->select('*', $from, '', array($customer_id, $customer_id)); 104 104 } 105 105 … … 122 122 // 携帯端末IDが一致し、本登録された会員を検索する。 123 123 $objQuery = new SC_Query_Ex(); 124 $exists = $objQuery->exists('dtb_customer', "mobile_phone_id = ? AND del_flg = 0 AND status = 2", array($_SESSION['mobile']['phone_id']));124 $exists = $objQuery->exists('dtb_customer', 'mobile_phone_id = ? AND del_flg = 0 AND status = 2', array($_SESSION['mobile']['phone_id'])); 125 125 return $exists; 126 126 } … … 183 183 function setLogin($email) { 184 184 // 本登録された会員のみ 185 $sql = "SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND del_flg = 0 AND status = 2";185 $sql = 'SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND del_flg = 0 AND status = 2'; 186 186 $objQuery = new SC_Query_Ex(); 187 187 $result = $objQuery->getAll($sql, array($email, $email)); 188 $data = isset($result[0]) ? $result[0] : "";188 $data = isset($result[0]) ? $result[0] : ''; 189 189 $this->customer_data = $data; 190 190 $this->startSession(); … … 193 193 // セッション情報を最新の情報に更新する 194 194 function updateSession() { 195 $sql = "SELECT * FROM dtb_customer WHERE customer_id = ? AND del_flg = 0";195 $sql = 'SELECT * FROM dtb_customer WHERE customer_id = ? AND del_flg = 0'; 196 196 $customer_id = $this->getValue('customer_id'); 197 197 $objQuery = new SC_Query_Ex(); 198 198 $arrRet = $objQuery->getAll($sql, array($customer_id)); 199 $this->customer_data = isset($arrRet[0]) ? $arrRet[0] : "";199 $this->customer_data = isset($arrRet[0]) ? $arrRet[0] : ''; 200 200 $_SESSION['customer'] = $this->customer_data; 201 201 } … … 205 205 $_SESSION['customer'] = $this->customer_data; 206 206 // セッション情報の保存 207 GC_Utils_Ex::gfPrintLog( "access : user=".$this->customer_data['customer_id'] ."\t"."ip=". $this->getRemoteHost(), CUSTOMER_LOG_REALFILE);207 GC_Utils_Ex::gfPrintLog('access : user='.$this->customer_data['customer_id'] ."\t"."ip=". $this->getRemoteHost(), CUSTOMER_LOG_REALFILE); 208 208 } 209 209 … … 217 217 $objSiteSess->unsetUniqId(); 218 218 // ログに記録する 219 GC_Utils_Ex::gfPrintLog( "logout : user=".$this->customer_data['customer_id'] ."\t"."ip=". $this->getRemoteHost(), CUSTOMER_LOG_REALFILE);219 GC_Utils_Ex::gfPrintLog('logout : user='.$this->customer_data['customer_id'] ."\t"."ip=". $this->getRemoteHost(), CUSTOMER_LOG_REALFILE); 220 220 } 221 221 … … 270 270 function isBirthMonth() { 271 271 if (isset($_SESSION['customer']['birth'])) { 272 $arrRet = preg_split( "|[- :/]|", $_SESSION['customer']['birth']);272 $arrRet = preg_split('|[- :/]|', $_SESSION['customer']['birth']); 273 273 $birth_month = intval($arrRet[1]); 274 274 $now_month = intval(date('m')); … … 296 296 return $_SERVER['REMOTE_ADDR']; 297 297 } else { 298 return "";298 return ''; 299 299 } 300 300 } … … 303 303 function updateOrderSummary($customer_id) { 304 304 $objQuery = new SC_Query_Ex(); 305 $arrOrderSummary = $objQuery->getRow( "SUM( payment_total) as buy_total, COUNT(order_id) as buy_times,MAX( create_date) as last_buy_date, MIN(create_date) as first_buy_date",'dtb_order',"customer_id = ? AND del_flg = 0 AND status <> ?",array($customer_id,ORDER_CANCEL));306 $objQuery->update('dtb_customer',$arrOrderSummary, "customer_id = ?",array($customer_id));305 $arrOrderSummary = $objQuery->getRow('SUM( payment_total) as buy_total, COUNT(order_id) as buy_times,MAX( create_date) as last_buy_date, MIN(create_date) as first_buy_date','dtb_order',"customer_id = ? AND del_flg = 0 AND status <> ?",array($customer_id,ORDER_CANCEL)); 306 $objQuery->update('dtb_customer',$arrOrderSummary,'customer_id = ?',array($customer_id)); 307 307 } 308 308 }
Note: See TracChangeset
for help on using the changeset viewer.
