Example #1
0
 public function updateAccess($get, $post)
 {
     $id = $get['id'];
     $action_info = array();
     if ($id) {
         $action_info = AccessAction::findOneByPk($id);
     }
     if ($post) {
         if (!$id) {
             $action_info = new AccessAction();
         }
         try {
             $action_info->setValues($post);
             $action_info->save();
         } catch (\Exception $ex) {
             return new Result('操作失败' . $ex->getMessage(), false);
         }
         return new Result('操作成功', true);
     }
     return array('action_info' => $action_info);
 }