示例#1
0
 public function destroy(User $user)
 {
     try {
         transaction();
         $user->gallery()->delete();
         $user->info()->delete();
         $user->object()->delete();
         $user->recommend()->delete();
         $user->like()->delete();
         $user->likeMe()->delete();
         $user->bind()->delete();
         $user->delete();
         commit();
         return $this->rest()->success(array(), '删除成功');
     } catch (\Exception $e) {
         rollback();
         return $this->rest()->error('删除失败,请稍后再试');
     }
 }