/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($result = check_auth_to('YHLB_DELETE')) {
         return $result;
     }
     try {
         User::destroy($id);
         return redirect()->action('Admin\\UserController@index')->with('operationstatus', 'sucess');
     } catch (\Exception $e) {
         return redirect()->back()->withErrors(['error' => '删除用户失败,请重试(' . $e->getMessage() . ')']);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($result = check_auth_to('QXZ_DELETE')) {
         return $result;
     }
     try {
         DB::transaction(function () use($id) {
             AuthGroupRelaionship::deleteAuthGroupRelationshipGroupLabel($id);
             AuthGroup::destroy($id);
         });
         return redirect()->action('Admin\\AuthGroupController@index')->with('operationstatus', 'sucess');
     } catch (\Exception $e) {
         return redirect()->back()->withErrors(['error' => '删除权限组失败,请重试(' . $e->getMessage() . ')']);
     }
 }
Exemple #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($result = check_auth_to('WZGL_DELETE')) {
         return $result;
     }
     try {
         ArticleStatus::deleteArticleStatus($id);
         Article::destroy($id);
         Article::resetRedisCache();
         Cache::forget(Article::REIDS_ARTICLE_CACHE . $id);
         return redirect()->action('Admin\\ArticleController@index')->with('operationstatus', 'sucess');
     } catch (\Exception $e) {
         return redirect()->back()->withErrors(['error' => '删除文章失败,请重试(' . $e->getMessage() . ')']);
     }
 }
Exemple #4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($result = check_auth_to('DHGL_DELETE')) {
         return $result;
     }
     try {
         $count = Navigation::where('parent_id', '=', $id)->count();
         if ($count !== 0) {
             throw new \Exception("请先删除下级导航");
         }
         Navigation::destroy($id);
         return redirect()->action('Admin\\NavigationController@index')->with('operationstatus', 'sucess');
     } catch (\Exception $e) {
         return redirect()->back()->withErrors(['error' => '删除导航失败,请重试(' . $e->getMessage() . ')']);
     }
 }
Exemple #5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($result = check_auth_to('JBSZ_DELETE')) {
         return $result;
     }
     try {
         Systems::destroy($id);
         Cache::tags(Systems::REDIS_SYSTEM_CONFIG)->flush();
         return redirect()->action('Admin\\SystemsController@index')->with('operationstatus', 'sucess');
     } catch (\Exception $e) {
         return redirect()->back()->withErrors(['error' => '删除基本设置失败,请重试(' . $e->getMessage() . ')']);
     }
 }