Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joyride phase2
Project
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
Jansa Jose
joyride phase2
Commits
8f02422d
Commit
8f02422d
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chart
parent
0905fae6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
Login_model.php
application/models/Login_model.php
+5
-0
No files found.
application/models/Login_model.php
View file @
8f02422d
...
...
@@ -33,15 +33,19 @@ class Login_model extends CI_Model {
$this
->
db
->
select
(
'SUM(booking_approve.amount) as sum,ride.departure_date'
);
$this
->
db
->
from
(
'booking_approve'
);
$this
->
db
->
join
(
'ride'
,
'ride.id = booking_approve.ride_id'
);
$this
->
db
->
where
(
'booking_approve.status'
,
'2'
);
$this
->
db
->
group_by
(
'ride.departure_date'
);
$query
=
$this
->
db
->
get
()
->
result
();
//echo $this->db->last_query();
$result
=
array
();
foreach
(
$query
as
$value
){
$prev_date
=
date
(
'Y-m-d'
,
strtotime
(
date
(
'Y-m-d'
)
.
' -7 day'
));
$value
=
(
array
)
$value
;
if
(
$value
[
'departure_date'
]
>=
$prev_date
){
$sum
=
(
$value
[
'sum'
]
==
null
)
?
'0'
:
$value
[
'sum'
];
$result
[]
=
array
(
$value
[
'departure_date'
],
$sum
);
}
}
return
json_encode
(
$result
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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