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
ffb399d3
Commit
ffb399d3
authored
Jan 09, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daily commit
parent
d4ba340f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
Webservices.php
application/controllers/Webservices.php
+1
-2
Mechanic_model.php
application/models/Mechanic_model.php
+13
-12
No files found.
application/controllers/Webservices.php
View file @
ffb399d3
...
...
@@ -210,12 +210,11 @@ class Webservices extends CI_Controller {
$mechanic_data
=
$this
->
Mechanic_model
->
getNearByMechanics
(
$postData
);
if
(
!
empty
(
$
issue
_data
)){
if
(
!
empty
(
$
mechanic
_data
)){
$respArr
[
'status'
]
=
'1'
;
$respArr
[
'message'
]
=
'Success'
;
$respArr
[
'mechanic_data'
]
=
$mechanic_data
;
}
echo
json_encode
(
$respArr
);
exit
;
}
}
...
...
application/models/Mechanic_model.php
View file @
ffb399d3
...
...
@@ -141,7 +141,7 @@ class Mechanic_model extends CI_Model {
$current_lat
=
$pickLocData
[
'pickup_lat'
];
$current_lng
=
$pickLocData
[
'pickup_lng'
];
$sql
=
"SELECT ME.*,MS.shop_name,MS.address AS shop_address,
$sql
=
"SELECT
AU.display_name,AU.profile_image,
ME.*,MS.shop_name,MS.address AS shop_address,
MS.phone AS shop_phone,MS.email_id AS shop_email_id,
3956*2*ASIN(SQRT(POWER(SIN((
$current_lat
-ME.location_lat)*pi()/180/2),2)+
COS(
$current_lat
*pi()/180 )*COS(ME.location_lat*pi()/180)*
...
...
@@ -158,19 +158,20 @@ class Mechanic_model extends CI_Model {
}
$mechDataArr
=
array
();
$default_timer
=
array
(
'09:00 AM'
,
'10:00 AM'
,
'11:00 AM'
,
'12:00 PM'
,
'01:00 PM'
,
'02:00 PM'
,
'03:00 PM'
,
'04:00 PM'
,
'05:00 PM'
,
'06:00 PM'
);
foreach
(
$mechData
AS
$data
){
foreach
(
$mechData
AS
$index
=>
$data
){
if
(
empty
(
$data
[
'start_time'
])
||
empty
(
$data
[
'end_time'
])){
continue
;
$scheduleTiming
=
array
(
'09:00 AM'
,
'10:00 AM'
,
'11:00 AM'
,
'12:00 PM'
,
'01:00 PM'
,
'02:00 PM'
,
'03:00 PM'
,
'04:00 PM'
,
'05:00 PM'
,
'06:00 PM'
);
}
else
{
$endTime
=
strtotime
(
$data
[
'end_time'
]);
$schTime
=
strtotime
(
$data
[
'start_time'
]);
$scheduleTiming
=
array
();
for
(
;
$schTime
<=
(
$endTime
-
3600
)
;
$schTime
+=
3600
){
$scheduleTiming
[]
=
date
(
'h:i A'
,
$schTime
);
}
}
$endTime
=
strtotime
(
$data
[
'end_time'
]);
$schTime
=
strtotime
(
$data
[
'start_time'
]);
$custom_timer
=
array
();
for
(
;
$schTime
<=
$endTime
;
$schTime
+=
3600
){
$custom_timer
[]
=
$schTime
;
}
pr
(
$custom_timer
);
$mechData
[
$index
][
'scheduleTiming'
]
=
$scheduleTiming
;
}
return
$mechData
;
}
...
...
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