Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dockers
3f-timesheet
Commits
5cdf06c9
Commit
5cdf06c9
authored
Dec 06, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search function for project list
parent
928d8177
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
6 deletions
+55
-6
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
+11
-6
packages/portal/timesheet/src/Model/VwProjects.php
+44
-0
No files found.
packages/portal/timesheet/src/Http/Controllers/MaintenanceController.php
View file @
5cdf06c9
...
...
@@ -10,6 +10,7 @@ use Portal\Timesheet\Model\Users;
use
Portal\Timesheet\Model\Ts_master
;
use
Portal\Timesheet\Model\Ts_detail
;
use
Portal\Timesheet\Model\Project
;
use
Portal\Timesheet\Model\VwProjects
;
use
Portal\Timesheet\Model\Tproject
;
use
Portal\Timesheet\Model\Department
;
use
Portal\Timesheet\Model\Pteam
;
...
...
@@ -41,14 +42,14 @@ class MaintenanceController extends Controller
if
(
$roleid
==
'9'
||
$roleid
==
'2'
||
$roleid
==
'6'
)
{
$project
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$project
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
orderBy
(
'p_project_sts'
,
'desc'
)
->
get
();
// dd($project);
$checkproject
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$checkproject
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
->
orderBy
(
'created_at'
,
'desc'
)
...
...
@@ -56,20 +57,22 @@ class MaintenanceController extends Controller
->
first
();
$keyword
=
request
()
->
get
(
'search'
);
$data
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$data
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
orderBy
(
'p_project_sts'
,
'desc'
)
->
where
(
'p_project_description'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'p_project_code'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'pm_name'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'pd_name'
,
'like'
,
"%
$keyword
%"
)
->
paginate
(
'10'
);
// dd($data);
}
else
// if($roleid == '8')
{
$project
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$project
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
where
(
'p_project_task_team'
,
$user
->
staff_id
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
...
...
@@ -77,7 +80,7 @@ class MaintenanceController extends Controller
->
orderBy
(
'p_project_sts'
,
'desc'
)
->
get
();
$checkproject
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$checkproject
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
where
(
'p_project_task_team'
,
$user
->
staff_id
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
...
...
@@ -86,7 +89,7 @@ class MaintenanceController extends Controller
->
first
();
$keyword
=
request
()
->
get
(
'search'
);
$data
=
Project
::
where
(
'p_project_type'
,
$chargeable
)
$data
=
VwProjects
::
where
(
'p_project_type'
,
$chargeable
)
->
where
(
'p_project_task_team'
,
$user
->
staff_id
)
->
with
(
'projectDirector'
)
->
with
(
'projectManager'
)
...
...
@@ -94,6 +97,8 @@ class MaintenanceController extends Controller
->
orderBy
(
'p_project_sts'
,
'desc'
)
->
where
(
'p_project_description'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'p_project_code'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'pm_name'
,
'like'
,
"%
$keyword
%"
)
->
orWhere
(
'pd_name'
,
'like'
,
"%
$keyword
%"
)
->
paginate
(
'10'
);
}
...
...
packages/portal/timesheet/src/Model/VwProjects.php
0 → 100644
View file @
5cdf06c9
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Notifications\Notifiable
;
class
VwProjects
extends
Model
{
use
Notifiable
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'vw_project'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
public
function
projectManager
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'staff_id'
,
'p_project_task_team'
);
}
public
function
projectDirector
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Staff_info'
,
'id'
,
'p_project_director'
);
}
public
function
projectTeam
()
{
return
$this
->
hasOne
(
'Portal\Timesheet\Model\Pteam'
,
'fk_project_id'
,
'id'
);
}
}
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