【发布时间】:2021-07-24 06:18:04
【问题描述】:
我在 oracle 中有一个表,它有一个名为“created_at”的列,时间戳作为数据类型,current_timestamp 作为默认值,并且该列也不能为空。稍后,需要将此列修改为 datatype = date,并将今天的日期作为默认值,并且该列也保持“NOT NULL”。我尝试了以下方法:
ALTER TABLE abc.xyz
MODIFY "CREATED_AT" DATE DEFAULT sysdate NOT NULL;
以下是我在视图文件中应用的过滤器:
'filter' => DateRangePicker::widget([
'name' => 'daterange',
'startAttribute' => 'report_date_from',
'endAttribute' => 'report_date_to',
'presetDropdown'=>false,
'hideInput'=>true,
'options' => [
'placeholder' => 'Select date ...',
],
])
以下是我在搜索模型类中传递给搜索函数的查询参数:
$query
->andFilterWhere(['between','CREATED_AT', $this->start_date, $this->end_date])
->andFilterWhere(['like', 'NAME', $this->NAME])
...
以下是遇到的错误:
Getting unknown property: frontend\models\SearchModel::start_date
正在实施的过滤器有什么问题吗?
【问题讨论】:
-
感谢您的建议!但我不在 12c Oracle 上工作。
标签: sql oracle yii2 yii2-advanced-app