コード例 #1
0
ファイル: HomeController.php プロジェクト: netxinyi/meigui
 public function deletePhoto($id)
 {
     try {
         $file = UserGallery::where('user_id', user()->user_id)->find($id);
         if ($file) {
             $file->delete();
             return $this->rest()->success(array(), '删除成功');
         }
         return $this->rest()->error('文件不存在');
     } catch (\Exception $e) {
         return $this->rest()->error('删除失败');
     }
 }
コード例 #2
0
ファイル: UserController.php プロジェクト: netxinyi/meigui
 public function getGallerylist()
 {
     $users = UserGallery::with('user')->where('status', UserEnum::GALLERY_CHECK)->paginate(15);
     return $this->view('gallery')->with('users', $users);
 }