YII2获取未知属性:dev24 \ modules \ reports \ components \ ReportDto :: Value 请解释我在创建迁移以创建报告时出现此错误的原因 这是我的迁移代码
protected $_reportService;
public function __construct($config = [])
{
parent::__construct($config);
$this->_reportService = new ReportService();
}
public function up()
{
$this->registerAllConsultants();
}
protected function registerAllConsultants()
{
$this->_reportService
->registerReport(
'AllConsultantsReport',
'Консультанты: Отчет по всем консультантам и их уровням',
$desc = 'Отчет по всем консультантам и их уровням',
new ReportConfiguration([
ReportConfiguration::FIELD_PRE_SQL => [],
ReportConfiguration::FIELD_COLUMNS => [
'Value' => [
'class' => \kartik\grid\DataColumn::class,
'attribute' => 'Value',
'pageSummary' => true,
'pageSummaryFunc' => GridView::F_SUM,
'pageSummaryOptions' => [
'prepend' => 'All Consultants Report: '
]
]
],
ReportConfiguration::FIELD_SQL =>
' SELECT a.first_name,
a.last_name,
a.email,
a.phone,
b.level,
b.user_id
from passport a
INNER JOIN user c
ON a.id=c.passport_id
INNER JOIN consultant b
ON b.user_id=c.id
where
c.id = :user_id
and
b.create_time between UNIX_TIMESTAMP(DATE_FORMAT(:begin_date,"%Y-%m-%d 00:00:00")) and UNIX_TIMESTAMP(DATE_FORMAT(:end_date ,"%Y-%m-%d 23:59:59"))
'
]),
(new OptionFormBuilder())
->model(UserIdDateRangeFilter::class)
->hint($desc)
->mergeFields(UserIdDateRangeFilter::getFormConfig())
->build(),
'Consultants'
);
}
这是错误的 如果你需要看到所有错误列表告诉我,请打印 http://prntscr.com/gwvvsc 当我使用没有顾问的日期时,我得到空的报告并没有这样的错误