A
A
Artemzn12018-11-27 17:19:29
Yii
Artemzn1, 2018-11-27 17:19:29

Records not showing up, what's the problem?

There is a table of equipment and a catalog of equipment. In the equipment there is a field Start of operation (start_operation - date), and in the catalog there is a service life (life - int).
In the search model I add a calculated field End of life date:
$select_date_end = 'DATE_ADD(start_operation, INTERVAL catalog_equipment.life DAY)';
$query->innerJoinWith('catalogOborudovania')->select(['*', $select_date_end . ' as date_end']);
date_end is added to a column in the gridview.
After that, records that have the same catalog_id are no longer displayed, for example, there are 2 records with catalog_id = 2, only the first of them will be displayed

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question