Previously, I was not using $model->save() function for inserting or updating any data. I was simply using createCommand() to execute query and
$model->save()
createCommand()
Check model saving error like this :
if ($model->save()) { } else { echo "MODEL NOT SAVED"; print_r($model->getAttributes()); print_r($model->getErrors()); exit; }