如何将模型中的两个属性相乘?
['value' => ('items.order_items_quantity' * 'items.order_items_initialPrice')],
答案 0 :(得分:1)
[
...
'value' => function($data) {
return ($data->order_items_quantity * $data->order_items_initialPrice);
}
]
答案 1 :(得分:1)
[
'attribute' => 'column1',
'value' => function ($data, $key, $index, $column) {
return $data->column1 * $data->column2;
},
]