php - Cakephp 3 Sum 2 columns of same table
one text
Solution:
Try this:
$query->select([
'Total' => $query->func()->sum($query->newExpr('OrderDetails.item_amount + OrderDetails.stitching_amount'))
]);
Sourceone text
Try this:
$query->select([
'Total' => $query->func()->sum($query->newExpr('OrderDetails.item_amount + OrderDetails.stitching_amount'))
]);
Source