Auto Insert Model from Another Model

public function afterSave(){
Model2::model()->updateByPk($this->goods_id,array(‘stock’=>$this->balance_history)); // from model 1

return parent::afterSave();

}

Iklan