今天是个好日子。我只是想知道是否可以在模型内部进行计算,而不考虑数据库?如果是,我将如何做?如果没有,有人可以解释一下吗?谢谢。
例子:
var $monthly = '';
var $annually = '';
var $quarterly = '';
var $semiannual = '';
function computation($price, $quantity){
$this->monthly = $price * $quantity;
$this->annually = $price * $quantity * 12;
$this->quarterly = $price * $quantity * 3;
$this->semiannual = $price * $quantity * 6;
}