Hi all
i don’t know if this is possible,
i’ve output a model to array in a controller, and would like to include a model function to return calculated values.
i want to include Dmprice
controller
$data = arrayhelper::toarray($data = products::find()
->joinwith('category')
->where(['categories.category_parent_id' => $parentid])
//->orderby(['c.category_sequence ASC'])
->limit(100)
->all());
Model
public function getDmprice()
{
return $this->Matrixprice($this->stock_code, $this->stock_group, $this->priceBand);
}
any clues or help would be appreciated.