Yii Framework Forum: Array Query - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Array Query Arrayhelper Rate Topic: -----

#1 User is offline   apickstock 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 27-May 15

Posted 26 August 2016 - 10:28 AM

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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users