<?php $sums = app\models\Sku3d::find()->select(["DATE_FORMAT(approvedate, '%m-%Y') as c_date", 'sum(totalhours) as total', 'count(sku) as sku'])
->where(['status' => 'Approved'])->groupBy('c_date')
->createCommand()
->queryAll();
foreach ($sums as $sum){ ?>
<tr>
<td><?=$sum['c_date'] ?></td>
<td><?=$sum['sku'] ?></td>
<td><?=$sum['total'] ?></td>
</tr>
<?php } ?>
I used the code above to count total products and sum total hours in a month. Currently i used table structure to display the data. Can I use yii2 gridview to display the data above?
Thanks.