Skip to content

Commit

Permalink
Merge pull request smarty-php#72 from think-ahead/ticket-#5313-upgrad…
Browse files Browse the repository at this point in the history
…e-php5-to-php7-diagnostic-code-for-note-42

Redmine-#5313:[レスポンス改善] サーバーサイドをPHP5→PHP7にアップグレードする
  • Loading branch information
think-katou authored Sep 30, 2021
2 parents e8cecbd + 5979f88 commit 0127ad0
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions app/controllers/servers_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,8 @@ class ServersController extends WebServicesController
'storeReservationCounter' => array('struct' => array(
'wrkr' => 'xsd:int',
'bmr' => 'xsd:int',
'kanzashi_undecided' => 'xsd:int'
'kanzashi_undecided' => 'xsd:int',
'log' => 'xsd:string',
)),
'_storeReservationCounter' => array(
'array' => 'storeReservationCounter'
Expand Down Expand Up @@ -2954,18 +2955,27 @@ function wsCustomerMergeSave($sessionid, $strcode, $fromccode, $toccode, $transc
*/
function wsGetReservationCounter($sessionid, $strcode, $datefr, $dateto)
{

$to_miliseconds = function($time) {
return round($time * 1000, 3) . ' miliseconds';
};
//===================================================================================
//(Verify Session and Get DB name)
//-----------------------------------------------------------------------------------
$start_time = microtime(true);
$storeinfo = $this->YoyakuSession->Check($this);
if ($storeinfo == false) {
$this->_soap_server->fault(1, '', INVALID_SESSION);
return;
}
$end_time = microtime(true);
$log[] = "check_session_duration:". $to_miliseconds($end_time - $start_time);

$start_time = microtime(true);
$this->Customer->set_company_database($storeinfo['dbname'], $this->Customer);
//===================================================================================
$end_time = microtime(true);
$log[] = "set_company_database_duration:". $to_miliseconds($end_time - $start_time);

//===================================================================================
/*
STORE_TRANSACTION ORIGINATION
0: SIPSS店舗、もばすてPC予約、その他
Expand Down Expand Up @@ -3013,9 +3023,18 @@ function wsGetReservationCounter($sessionid, $strcode, $datefr, $dateto)
) tmptbl where yread = 0
) as tblecount";
//===================================================================================
$start_time = microtime(true);
$GetData = $this->Customer->query($sql);
$end_time = microtime(true);
$log[] = "query_duration:". $to_miliseconds($end_time - $start_time);

$start_time = microtime(true);
$arr_reservation = $this->ParseDataToObjectArray($GetData, 'tblecount');
$end_time = microtime(true);
//===================================================================================
$log[] = "ParseDataToObjectArray_function_duration:". $to_miliseconds($end_time - $start_time);
$arr_reservation[0]['log'] = implode("\n", $log);

$ret = array();
$ret['records'] = $arr_reservation;
//===================================================================================
Expand Down

0 comments on commit 0127ad0

Please sign in to comment.