简体   繁体   中英

Multiplication in column gridview yii2

我该如何从模型中复制两个属性

['value' => ('items.order_items_quantity' * 'items.order_items_initialPrice')],
[
    ...
    'value' => function($data) {
        return ($data->order_items_quantity * $data->order_items_initialPrice);
    }
]
[
    'attribute' => 'column1',
    'value' => function ($data, $key, $index, $column) {
        return $data->column1 * $data->column2;
    },
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM