Skip to content

Commit

Permalink
Merge pull request smarty-php#66 from think-ahead/ticket-#5313-upgrad…
Browse files Browse the repository at this point in the history
…e-php5-to-php7-fix-note-20

Redmine-#5313:[レスポンス改善] サーバーサイドをPHP5→PHP7にアップグレードする(fix note 20)
  • Loading branch information
think-katou authored Sep 17, 2021
2 parents 8f163d9 + cd3128c commit 3c19cdb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3547,26 +3547,23 @@ function wsSearchCustomer($sessionid, $param)
}
unset($param['free_customer']);

$remove_spaces = fn($str) => preg_replace("@[  ]@u", '', $str);

foreach ($param as $key => $val) {
if ((!empty($val) || $val === '0') && $key != 'limit' && $key != 'page' && $key != 'orderby' && $key != 'SEARCHSHAREDSTORE') {
if ($key == "PHONE") {
$criteria['(TEL1 LIKE ? OR TEL2 LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "MAILADDRESS") {
$criteria['(MAILADDRESS1 LIKE ? OR MAILADDRESS2 LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "CNAME") {
$val = preg_replace('/ /', '', $val);
$val = preg_replace('/ /', '', $val);
$val = $remove_spaces($val);
$criteria['(REPLACE(CNAME, " ", "") LIKE ? OR REPLACE(CNAME, " ", "") LIKE ?)'] = array('%' . $val . '%', '%' . $val . '%');
} elseif ($key == "CNAMEKANA") {
//--------------------------------------------------------------------------------------------------------------------
$val = preg_replace('/ /', '', $val);
$val = preg_replace(' ', '', $val);
//--------------------------------------------------------------------------------------------------------------------
$kanafull = preg_replace('/ /', '', $val);
$kanafull = preg_replace(' ', '', $val);
$val = $remove_spaces($val);
//--------------------------------------------------------------------------------------------------------------------
$val = mb_convert_kana($val, "kV", "UTF8");
$kanafull = mb_convert_kana($kanafull, "KV", "UTF8");
$kanafull = mb_convert_kana($val, "KV", "UTF8");
//--------------------------------------------------------------------------------------------------------------------
$criteria['(REPLACE(CNAMEKANA, " ", "") LIKE ?
OR REPLACE(CNAMEKANA, " ", "") LIKE ?
Expand Down

0 comments on commit 3c19cdb

Please sign in to comment.