Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Tobin
dcarfixers
Commits
4c055305
Commit
4c055305
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'local_production'
add car location See merge request
!148
parents
4cda822a
bcd66733
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Webservice_model.php
application/models/Webservice_model.php
+9
-2
No files found.
application/models/Webservice_model.php
View file @
4c055305
...
...
@@ -168,12 +168,13 @@ class Webservice_model extends CI_Model {
$this
->
db
->
join
(
"mechanic_booking"
,
"mechanic_booking.booking_id = bookings.booking_id"
);
$this
->
db
->
join
(
"mechanic"
,
"mechanic_booking.mechanic_id = mechanic.mechanic_id"
);
$this
->
db
->
join
(
"mechanic_shop"
,
"mechanic_shop.shop_id = mechanic.shop_id"
,
"left"
);
$this
->
db
->
where
(
'scheduled_date >'
,
date
(
'Y-m-d h:i'
));
//
$this->db->where('scheduled_date >',date('Y-m-d h:i'));
$this
->
db
->
where
(
'bookings.status !='
,
'0'
);
if
(
$start
!=
0
||
$per_page
!=
0
){
$this
->
db
->
limit
(
$per_page
,
$start
);
}
$this
->
db
->
group_by
(
'id'
);
$this
->
db
->
order_by
(
'id'
,
'DESC'
);
$bookData
=
$this
->
db
->
get_where
(
'bookings'
,
$where
)
->
result_array
();
$respArr
[
'status'
]
=
'success'
;
$respArr
[
'message'
]
=
'success'
;
...
...
@@ -338,13 +339,19 @@ class Webservice_model extends CI_Model {
$date
=
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
date
(
'Y-m-d'
)
:
date
(
'Y-m-d'
,
$postData
[
'date'
]
/
1000
);
$time
=
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
date
(
'h:i A'
)
:
$postData
[
'time'
];
$cost
=
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
0
:
$postData
[
'total_cost'
];
$car_location
=
(
isset
(
$postData
[
'location'
])
&&
!
empty
(
$postData
[
'location'
]))
?
$postData
[
'location'
]
:
''
;
$car_loc_lat
=
(
isset
(
$postData
[
'location_lat'
])
&&
!
empty
(
$postData
[
'location_lat'
]))
?
$postData
[
'location_lat'
]
:
''
;
$car_loc_lng
=
(
isset
(
$postData
[
'location_long'
])
&&
!
empty
(
$postData
[
'location_long'
]))
?
$postData
[
'location_long'
]
:
''
;
$insert_array
=
array
(
'cost'
=>
$cost
,
'scheduled_date'
=>
$date
,
'scheduled_time'
=>
$time
,
'issues_selected'
=>
$issues
,
'service_type'
=>
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
2
:
1
,
'status'
=>
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
1
:
5
'status'
=>
(
isset
(
$postData
[
'is_emergency'
])
&&
!
empty
(
$postData
[
'is_emergency'
]))
?
1
:
5
,
'car_location'
=>
$car_location
,
'car_loc_lat'
=>
$car_loc_lat
,
'car_loc_lng'
=>
$car_loc_lng
);
if
(
$this
->
db
->
update
(
'bookings'
,
$insert_array
,
array
(
'booking_id'
=>
$postData
[
'booking_id'
]))){
$this
->
db
->
insert
(
"mechanic_booking"
,
array
(
'booking_id'
=>
$postData
[
'booking_id'
],
'mechanic_id'
=>
$postData
[
'mechanic_id'
],
'amount'
=>
$cost
,
'status'
=>
'0'
));
...
...
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