Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/MultidatabaseContentSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function getCondSelect($values = []) {
);
break;
case 'checkbox':
$result += $this->MultidatabaseContentSearchCond->getCondSelCheck(
$result[] = $this->MultidatabaseContentSearchCond->getCondSelCheck(
$metadata['selections'], $values, $valueKey
);
break;
Expand Down
16 changes: 12 additions & 4 deletions Model/MultidatabaseContentSearchCond.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,28 @@ public function getCondSelVal($query) {
*/
public function getCondStartEndDt($query) {
$conditions = [];

//サーバタイムゾーンの日時に変換
$date = new DateTime($query['start_dt']['value']);
$createdStart = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));
$date = new DateTime($query['end_dt']['value']);
$date->modify('+59 second');
$createdEnd = (new NetCommonsTime())->toServerDatetime($date->format('Y-m-d H:i:s'));

if (
!empty($query['start_dt']['value']) &&
!empty($query['end_dt']['value'])
) {
$conditions['MultidatabaseContent.created between ? and ?'] = [
$query['start_dt']['value'],
$query['end_dt']['value']
$createdStart,
$createdEnd
];
} else {
if (!empty($query['start_dt']['value'])) {
$conditions['MultidatabaseContent.created <='] = $query['start_dt']['value'];
$conditions['MultidatabaseContent.created >='] = $createdStart;
}
if (!empty($query['end_dt']['value'])) {
$conditions['MultidatabaseContent.created >='] = $query['end_dt']['value'];
$conditions['MultidatabaseContent.created <='] = $createdEnd;
}
}

Expand Down
1 change: 1 addition & 0 deletions View/Helper/MultidatabaseContentViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public function renderGroupItems($metadatas) {
public function dropDownToggleSelect($metadatas, $viewType = 'index') {
$params = $this->_View->Paginator->params;
$named = $params['named'];
$named['page'] = 1;
$url = $named;
$result = '';

Expand Down
9 changes: 0 additions & 9 deletions View/MultidatabaseContents/search.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ echo $this->NetCommonsHtml->css([
echo $this->NetCommonsForm->input('type', $options);
?>
</div>
<?php // 作成者(ハンドル) ?>
<div>
<?php
$options = [
'label' => __d('multidatabases', 'Create user')
];
echo $this->NetCommonsForm->input('create_user', $options);
?>
</div>
<?php // 作成日時 ?>
<div>
<div class="form-group">
Expand Down
Loading