Exemplo n.º 1
0
 public function actionUpdateService()
 {
     $image_preview = null;
     $post = StringHelper::filterArrayString($_POST);
     if ($_FILES['image']['error'] != 4) {
         $image_preview = UploadHelper::getUrlUploadSingleImage($_FILES['image'], 'service_image');
         $post['service_image'] = $image_preview;
     }
     if (ProviderService::model()->update($post)) {
         ResponseHelper::JsonReturnSuccess('', 'Success');
     } else {
         ResponseHelper::JsonReturnError('', 'Error');
     }
 }
Exemplo n.º 2
0
 public function update($post)
 {
     $model = ProviderService::model()->findByPk($post['service_id']);
     if ($model) {
         $model->setAttributes($post);
         if ($model->save(FALSE)) {
             return TRUE;
         }
     }
     return FALSE;
 }