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
b435880e
Commit
b435880e
authored
Nov 29, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取所有的项目 所有的日程完成
parent
d503d9b2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
177 additions
and
2 deletions
+177
-2
TaskServiceContract.php
app/Contracts/TaskServiceContract.php
+16
-0
ScheduleController.php
app/Http/Controllers/ScheduleController.php
+10
-0
StatisticsController.php
app/Http/Controllers/StatisticsController.php
+14
-2
TaskController.php
app/Http/Controllers/TaskController.php
+10
-0
TaskServiceProvider.php
app/Providers/TaskServiceProvider.php
+33
-0
TaskService.php
app/Services/TaskService.php
+26
-0
app.php
config/app.php
+2
-0
index.blade.php
resources/views/admin/index.blade.php
+66
-0
No files found.
app/Contracts/TaskServiceContract.php
0 → 100644
View file @
b435880e
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/11/29
* Time: 18:58
*/
namespace
App\Contracts
;
interface
TaskServiceContract
{
public
function
getAll
();
}
\ No newline at end of file
app/Http/Controllers/ScheduleController.php
0 → 100644
View file @
b435880e
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
ScheduleController
extends
Controller
{
//
}
app/Http/Controllers/StatisticsController.php
View file @
b435880e
...
...
@@ -2,9 +2,12 @@
namespace
App\Http\Controllers
;
use
App\Contracts\ScheduleServiceContract
;
use
App\Contracts\StatisticsServiceContract
;
use
App\Contracts\TaskServiceContract
;
use
App\Models\Group
;
use
App\Models\Project
;
use
App\Models\Task
;
use
App\Models\User
;
use
App\Models\UserInfo
;
use
Carbon\Carbon
;
...
...
@@ -13,9 +16,11 @@ use Illuminate\Http\Request;
class
StatisticsController
extends
Controller
{
public
function
__construct
(
StatisticsServiceContract
$statisticsHandel
)
public
function
__construct
(
StatisticsServiceContract
$statisticsHandel
,
TaskServiceContract
$taskHandle
,
ScheduleServiceContract
$scheduleHandle
)
{
$this
->
mStatistics
=
$statisticsHandel
;
$this
->
mTask
=
$taskHandle
;
$this
->
mSchedule
=
$scheduleHandle
;
}
...
...
@@ -37,7 +42,14 @@ class StatisticsController extends Controller
// 查询所有项目
$projects
=
count
(
Project
::
all
());
return
view
(
'admin/index'
,
compact
(
'newUserCount'
,
'newProject'
,
'users'
,
'projects'
));
// 获取所有的任务
$tasks
=
$this
->
mTask
->
getAll
()
->
count
();
// 获取所有日程
$schedules
=
$this
->
mSchedule
->
getAll
()
->
count
();
return
view
(
'admin/index'
,
compact
(
'newUserCount'
,
'newProject'
,
'users'
,
'projects'
,
'tasks'
,
'schedules'
));
}
...
...
app/Http/Controllers/TaskController.php
0 → 100644
View file @
b435880e
<?php
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
class
TaskController
extends
Controller
{
//
}
app/Providers/TaskServiceProvider.php
0 → 100644
View file @
b435880e
<?php
namespace
App\Providers
;
use
App\Services\TaskService
;
use
Illuminate\Support\ServiceProvider
;
class
TaskServiceProvider
extends
ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public
function
boot
()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public
function
register
()
{
//绑定服务与接口关系
$this
->
app
->
singleton
(
"App\Contracts\TaskServiceContract"
,
function
(){
return
new
TaskService
();
});
}
}
app/Services/TaskService.php
0 → 100644
View file @
b435880e
<?php
/**
* Created by PhpStorm.
* User: Aladin
* Date: 2017/11/29
* Time: 19:00
*/
namespace
App\Services
;
use
App\Contracts\TaskServiceContract
;
use
App\Models\Task
;
class
TaskService
implements
TaskServiceContract
{
public
function
getAll
()
{
$tasks
=
Task
::
all
();
if
(
$tasks
->
isEmpty
()){
return
null
;
}
return
$tasks
;
}
}
\ No newline at end of file
config/app.php
View file @
b435880e
...
...
@@ -187,6 +187,8 @@ return [
App\Providers\AdminServiceProvider
::
class
,
App\Providers\RoleServiceProvider
::
class
,
App\Providers\PermissionServiceProvider
::
class
,
App\Providers\TaskServiceProvider
::
class
,
App\Providers\ScheduleServiceProvider
::
class
,
Zizaco\Entrust\EntrustServiceProvider
::
class
,
Orangehill\Iseed\IseedServiceProvider
::
class
,
...
...
resources/views/admin/index.blade.php
View file @
b435880e
...
...
@@ -67,6 +67,72 @@
<!--
./
col
-->
</
div
>
<
div
class
=
"row"
>
<!--
./
col
-->
<
div
class
=
"col-lg-3 col-xs-6"
>
<!--
small
box
-->
<
div
class
=
"small-box bg-yellow"
>
<
div
class
=
"inner"
style
=
"background-color: #1b6d85"
>
<
h3
>
{{
$schedules
}}
</
h3
>
<
p
>
全部日程
</
p
>
</
div
>
<
div
class
=
"icon"
>
<
i
class
=
"ion ion-person-add"
></
i
>
</
div
>
<
a
href
=
"#"
class
=
"small-box-footer"
>
More
info
<
i
class
=
"fa fa-arrow-circle-right"
></
i
></
a
>
</
div
>
</
div
>
<!--
./
col
-->
<
div
class
=
"col-lg-3 col-xs-6"
>
<!--
small
box
-->
<
div
class
=
"small-box bg-aqua"
>
<
div
class
=
"inner"
style
=
"background-color: #31b131"
>
<
h3
>
{{
$tasks
}}
</
h3
>
<
p
>
全部任务
</
p
>
</
div
>
<
div
class
=
"icon"
>
<
i
class
=
"ion ion-bag"
></
i
>
</
div
>
<
a
href
=
"#"
class
=
"small-box-footer"
>
More
info
<
i
class
=
"fa fa-arrow-circle-right"
></
i
></
a
>
</
div
>
</
div
>
<!--
./
col
-->
<
div
class
=
"col-lg-3 col-xs-6"
>
<!--
small
box
-->
<
div
class
=
"small-box bg-yellow"
>
<
div
class
=
"inner"
style
=
"background-color: #ebccd1"
>
<
h3
>
0
</
h3
>
<
p
>
全部日程
</
p
>
</
div
>
<
div
class
=
"icon"
>
<
i
class
=
"ion ion-person-add"
></
i
>
</
div
>
<
a
href
=
"#"
class
=
"small-box-footer"
>
More
info
<
i
class
=
"fa fa-arrow-circle-right"
></
i
></
a
>
</
div
>
</
div
>
<!--
./
col
-->
<
div
class
=
"col-lg-3 col-xs-6"
>
<!--
small
box
-->
<
div
class
=
"small-box bg-aqua"
>
<
div
class
=
"inner"
style
=
"background-color: #afd9ee"
>
<
h3
>
0
</
h3
>
<
p
>
全部任务
</
p
>
</
div
>
<
div
class
=
"icon"
>
<
i
class
=
"ion ion-bag"
></
i
>
</
div
>
<
a
href
=
"#"
class
=
"small-box-footer"
>
More
info
<
i
class
=
"fa fa-arrow-circle-right"
></
i
></
a
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"row"
>
...
...
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