Skip to content

Commit ea3bdeb

Browse files
authored
Merge pull request #67 from NetCommons3/master
Merge master branch
2 parents ee70186 + d660565 commit ea3bdeb

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

Model/MultidatabaseContentSearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getCondSelect($values = []) {
133133
);
134134
break;
135135
case 'checkbox':
136-
$result += $this->MultidatabaseContentSearchCond->getCondSelCheck(
136+
$result[] = $this->MultidatabaseContentSearchCond->getCondSelCheck(
137137
$metadata['selections'], $values, $valueKey
138138
);
139139
break;

Model/MultidatabaseContentSearchCond.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,28 @@ public function getCondSelVal($query) {
5757
*/
5858
public function getCondStartEndDt($query) {
5959
$conditions = [];
60+
61+
//サーバタイムゾーンの日時に変換
62+
$date = new DateTime($query['start_dt']['value']);
63+
$createdStart = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));
64+
$date = new DateTime($query['end_dt']['value']);
65+
$date->modify('+59 second');
66+
$createdEnd = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));
67+
6068
if (
6169
!empty($query['start_dt']['value']) &&
6270
!empty($query['end_dt']['value'])
6371
) {
6472
$conditions['MultidatabaseContent.created between ? and ?'] = [
65-
$query['start_dt']['value'],
66-
$query['end_dt']['value']
73+
$createdStart,
74+
$createdEnd
6775
];
6876
} else {
6977
if (!empty($query['start_dt']['value'])) {
70-
$conditions['MultidatabaseContent.created <='] = $query['start_dt']['value'];
78+
$conditions['MultidatabaseContent.created >='] = $createdStart;
7179
}
7280
if (!empty($query['end_dt']['value'])) {
73-
$conditions['MultidatabaseContent.created >='] = $query['end_dt']['value'];
81+
$conditions['MultidatabaseContent.created <='] = $createdEnd;
7482
}
7583
}
7684

View/Helper/MultidatabaseContentViewHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ public function renderGroupItems($metadatas) {
215215
public function dropDownToggleSelect($metadatas, $viewType = 'index') {
216216
$params = $this->_View->Paginator->params;
217217
$named = $params['named'];
218+
$named['page'] = 1;
218219
$url = $named;
219220
$result = '';
220221

View/MultidatabaseContents/search.ctp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@ echo $this->NetCommonsHtml->css([
4848
echo $this->NetCommonsForm->input('type', $options);
4949
?>
5050
</div>
51-
<?php // 作成者(ハンドル) ?>
52-
<div>
53-
<?php
54-
$options = [
55-
'label' => __d('multidatabases', 'Create user')
56-
];
57-
echo $this->NetCommonsForm->input('create_user', $options);
58-
?>
59-
</div>
6051
<?php // 作成日時 ?>
6152
<div>
6253
<div class="form-group">

0 commit comments

Comments
 (0)