public function addService($attr) { $model = new ServiceMedlatec(); $model->setAttributes($attr); $model->provider_id = Yii::app()->session['provider_id']; $model->updated_at = time(); $model->created_at = time(); if ($attr['type'] == 'meboo_admin') { $result->status = -3; } else { if ($attr['type'] == 'medlatec_admin') { $result->status = -2; } } if ($model->save(FALSE)) { return TRUE; } return FALSE; }
public function add($post) { $model = new ServiceMedlatec(); $model->setAttributes($post); $model->created_at = time(); $model->updated_at = time(); $model->active = 0; if ($model->save(FALSE)) { return TRUE; } return FALSE; }