Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
40966149
Commit
40966149
authored
Dec 12, 2017
by
mengyixi
Browse files
Options
Browse Files
Download
Plain Diff
deleteFile
parents
cb989fdc
7d1e07c0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
73 deletions
+43
-73
FileServiceContract.php
app/Contracts/FileServiceContract.php
+2
-2
FileController.php
app/Http/Controllers/FileController.php
+4
-1
GroupController.php
app/Http/Controllers/GroupController.php
+6
-3
FileService.php
app/Services/FileService.php
+12
-4
groupinformation.blade.php
resources/views/admin/group/groupinformation.blade.php
+19
-63
No files found.
app/Contracts/FileServiceContract.php
View file @
40966149
...
...
@@ -11,8 +11,8 @@ namespace App\Contracts;
interface
FileServiceContract
{
public
function
getAll
();
// 根据团队ID 查询当前团队所有文件
public
function
getAll
(
$group_id
);
public
function
get
(
$id
);
public
function
delete
(
$file_id
);
}
\ No newline at end of file
app/Http/Controllers/FileController.php
View file @
40966149
...
...
@@ -23,6 +23,9 @@ class FileController extends Controller
public
function
delete
(
Request
$request
)
{
$file_id
=
$request
;
$this
->
mFile
->
delete
(
$file_id
);
$result
=
$this
->
mFile
->
delete
(
$file_id
);
if
(
$result
){
return
view
(
route
(
'500'
));
}
}
}
app/Http/Controllers/GroupController.php
View file @
40966149
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
use
App\Contracts\FileServiceContract
;
use
App\Contracts\GroupServiceContract
;
use
App\Contracts\UserServiceContract
;
use
App\Util\Message
;
...
...
@@ -13,10 +14,11 @@ class GroupController extends Controller
public
$mGroup
;
public
function
__construct
(
GroupServiceContract
$group
,
UserServiceContract
$user
)
public
function
__construct
(
GroupServiceContract
$group
,
UserServiceContract
$user
,
FileServiceContract
$fileHandel
)
{
$this
->
mGroup
=
$group
;
$this
->
mUser
=
$user
;
$this
->
mFile
=
$fileHandel
;
}
...
...
@@ -33,11 +35,12 @@ class GroupController extends Controller
{
$id
=
$request
->
id
;
$groups
=
$this
->
mGroup
->
get
(
$id
);
$files
=
$this
->
mFile
->
getAll
(
120
);
if
(
$groups
){
return
view
(
'admin/group/groupinformation'
,
compact
(
'groups'
));
return
view
(
'admin/group/groupinformation'
,
compact
(
'groups'
,
'files'
));
}
return
Message
::
makeError
(
'查找失败'
);
}
...
...
app/Services/FileService.php
View file @
40966149
...
...
@@ -7,17 +7,23 @@
*/
namespace
App\Services
;
use
App\Models\File
;
use
App\Models\File
;
use
App\Contracts\FileServiceContract
;
class
FileService
implements
FileServiceContract
{
public
function
getAll
()
public
function
getAll
(
$group_id
)
{
dd
(
1
);
$files
=
File
::
where
(
'group_id'
,
$group_id
)
->
get
();
if
(
$files
->
isEmpty
()){
return
null
;
}
return
$files
;
}
public
function
get
(
$id
)
...
...
@@ -28,6 +34,8 @@ class FileService implements FileServiceContract
public
function
delete
(
$file_id
)
{
// TODO: Implement delete() method.
// $file =
$file
=
File
::
where
([
"id"
=>
file_id
])
->
get
();
$result
=
$file
->
delete
();
return
$result
;
}
}
\ No newline at end of file
resources/views/admin/group/groupinformation.blade.php
View file @
40966149
...
...
@@ -92,90 +92,47 @@
<
th
>
文件名
</
th
>
<
th
>
类型
</
th
>
<
th
>
size
</
th
>
<
th
>
状态
</
th
>
<
th
>
文件夹
</
th
>
<
th
>
所属项目
</
th
>
<
th
>
创建者
</
th
>
<
th
>
操作
</
th
>
</
tr
>
</
thead
>
{{
--@
if
(
$groups
==
null
)
--
}}
@
if
(
$files
==
null
)
<
tbody
>
<
tr
>
<
td
colspan
=
"8"
style
=
"text-align: center;color: red"
>
数据暂无
</
td
>
</
tr
>
</
tbody
>
</
table
>
{{
--@
else
--
}}
{{
--@
foreach
(
$groups
as
$group
)
--
}}
@
else
@
foreach
(
$files
as
$file
)
<
tbody
>
<
tr
>
<
td
></
td
>
<
td
></
td
>
<
td
></
td
>
<
td
></
td
>
<
td
></
td
>
<
td
></
td
>
<
td
></
td
>
<
td
>
{{
$file
->
id
}}
</
td
>
<
td
>
{{
$file
->
name
}}
</
td
>
<
td
>
{{
$file
->
file_type
}}
</
td
>
<
td
>
{{
$file
->
size
}}
</
td
>
<
td
>
{{
$file
->
folder_id
}}
</
td
>
<
td
>
{{
$file
->
project_id
}}
</
td
>
<
td
>
{{
$file
->
creator_id
}}
</
td
>
<
td
><
a
href
=
"
{
{$file->id}
}
"
class
=
"btn btn-info"
>
查看详情
</
a
>
<
a
href
=
"
{
{$file->id}
}
"
class
=
"btn bg-orange"
>
删除
</
a
>
</
td
>
</
tr
>
</
tbody
>
@
endforeach
@
endif
</
table
>
</
div
>
<!--
/.
tab
-
pane
-->
<
div
class
=
"tab-pane"
id
=
"settings"
>
<
h3
>
wowowo
我这里什么都没有
</
h3
>
{{
--<
form
class
=
"form-horizontal"
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputName"
class
=
"col-sm-2 control-label"
>
Name
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"email"
class
=
"form-control"
id
=
"inputName"
placeholder
=
"Name"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputEmail"
class
=
"col-sm-2 control-label"
>
Email
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"email"
class
=
"form-control"
id
=
"inputEmail"
placeholder
=
"Email"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputName"
class
=
"col-sm-2 control-label"
>
Name
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"text"
class
=
"form-control"
id
=
"inputName"
placeholder
=
"Name"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputExperience"
class
=
"col-sm-2 control-label"
>
Experience
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
textarea
class
=
"form-control"
id
=
"inputExperience"
placeholder
=
"Experience"
></
textarea
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputSkills"
class
=
"col-sm-2 control-label"
>
Skills
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"text"
class
=
"form-control"
id
=
"inputSkills"
placeholder
=
"Skills"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
div
class
=
"col-sm-offset-2 col-sm-10"
>--
}}
{{
--<
div
class
=
"checkbox"
>--
}}
{{
--<
label
>--
}}
{{
--<
input
type
=
"checkbox"
>
I
agree
to
the
<
a
href
=
"#"
>
terms
and
conditions
</
a
>--
}}
{{
--</
label
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
div
class
=
"col-sm-offset-2 col-sm-10"
>--
}}
{{
--<
button
type
=
"submit"
class
=
"btn btn-danger"
>
Submit
</
button
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--</
form
>--
}}
</
div
>
<!--
/.
tab
-
pane
-->
</
div
>
...
...
@@ -191,7 +148,6 @@
@
endsection
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment