Commit 9a508ad7 authored by gxx's avatar gxx

yixie

parent a739e424
...@@ -25,7 +25,7 @@ class FileService implements FileServiceContract ...@@ -25,7 +25,7 @@ class FileService implements FileServiceContract
public function getAll($group_id) public function getAll($group_id)
{ {
$files = File::where('group_id',$group_id)->get(); $files = File::where('group_id',$group_id)->paginate(8);
if($files->isEmpty()){ if($files->isEmpty()){
return null; return null;
} }
...@@ -40,8 +40,8 @@ class FileService implements FileServiceContract ...@@ -40,8 +40,8 @@ class FileService implements FileServiceContract
public function delete($file_id) public function delete($file_id)
{ {
$file =File::where(["id"=>file_id])->get(); // $file =File::where(["id"=>file_id])->get();
$result = $file->delete(); // $result = $file->delete();
// $pointer = $file->pointer; // $pointer = $file->pointer;
// $count =File::where(["pointer"=>$pointer])->count(); // $count =File::where(["pointer"=>$pointer])->count();
// if($result && $count == 0){ // if($result && $count == 0){
...@@ -57,6 +57,6 @@ class FileService implements FileServiceContract ...@@ -57,6 +57,6 @@ class FileService implements FileServiceContract
// return Message::makeError('文件不存在'); // return Message::makeError('文件不存在');
// } // }
// } // }
return $result; // return $result;
} }
} }
\ No newline at end of file
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<th>文件夹</th> <th>文件夹</th>
<th>所属项目</th> <th>所属项目</th>
<th>创建者</th> <th>创建者</th>
<th>操作</th> {{--<th>操作</th>--}}
</tr> </tr>
</thead> </thead>
@if($files == null) @if($files == null)
...@@ -116,15 +116,16 @@ ...@@ -116,15 +116,16 @@
<td>{{$file->folder_id}}</td> <td>{{$file->folder_id}}</td>
<td>{{$file->fileInProject->name}}</td> <td>{{$file->fileInProject->name}}</td>
<td>{{$file->fileCreator->user_name}}</td> <td>{{$file->fileCreator->user_name}}</td>
<td><a href="{{route('file.get',['id' => $file->id])}}" class="btn btn-info" > 查看详情</a> <td>
<a href="{{route('file.delete',['id' => $file->id])}}" class="btn bg-orange" > 删除</a> {{--<a href="{{route('file.get',['id' => $file->id])}}" class="btn btn-info" > 查看详情</a>--}}
{{--<a href="{{route('file.delete',['id' => $file->id])}}" class="btn bg-orange" > 删除</a>--}}
</td> </td>
</tr> </tr>
</tbody> </tbody>
@endforeach @endforeach
@endif @endif
</table> </table>
{{ $files->links() }}
</div> </div>
<!-- /.tab-pane --> <!-- /.tab-pane -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment