Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-locator
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
Ajay Barthwal
store-locator
Commits
aa43f48c
Commit
aa43f48c
authored
Jul 22, 2019
by
Arpit Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on rating section
parent
a45f711d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
14 deletions
+27
-14
CronController.php
application/app/Http/Controllers/CronController.php
+1
-2
SearchController.php
application/app/Http/Controllers/SearchController.php
+6
-5
Apitraits.php
application/app/Traits/Apitraits.php
+2
-1
index.blade.php
application/resources/views/frontend/searchs/index.blade.php
+14
-2
location_element.blade.php
application/resources/views/frontend/searchs/location_element.blade.php
+4
-4
No files found.
application/app/Http/Controllers/CronController.php
View file @
aa43f48c
...
...
@@ -24,7 +24,7 @@ class CronController extends Controller
$getLocaterListMetaData
=
$this
->
cronList
(
$api_url
);
for
(
$i
=
$getLocaterListMetaData
[
'current_page'
];
$i
<=
$getLocaterListMetaData
[
'last_page'
];
$i
++
){
$getLocaterListDataNew
=
$this
->
call_api_page
(
$api_url
,
''
,
''
,
''
,
''
,
$i
);
$getLocaterListDataNew
=
$this
->
call_api_page
(
$api_url
,
''
,
''
,
''
,
''
,
''
,
$i
);
$finalData
=
array_map
(
function
(
$data
)
use
(
$getLocaterListDataNew
)
{
...
...
@@ -99,7 +99,6 @@ class CronController extends Controller
$cityaa
->
type
=
3
;
$cityaa
->
save
();
}
}
}
...
...
application/app/Http/Controllers/SearchController.php
View file @
aa43f48c
...
...
@@ -27,11 +27,11 @@ class SearchController extends Controller
}
private
function
getApiData
(
$locality
=
null
,
$state
=
null
,
$city
=
null
,
$location
=
null
,
$page
=
null
){
private
function
getApiData
(
$locality
=
null
,
$state
=
null
,
$city
=
null
,
$location
=
null
,
$
ratingOrder
=
null
,
$
page
=
null
){
$api_url
=
config
(
'app.api_list'
);
$apiLocaterData
=
$this
->
call_api_page
(
$api_url
,
$locality
,
$state
,
$city
,
$location
,
$page
);
$apiLocaterData
=
$this
->
call_api_page
(
$api_url
,
$locality
,
$state
,
$city
,
$location
,
$
ratingOrder
,
$
page
);
if
(
count
(
$apiLocaterData
[
'data'
])
<
1
)
return
response
()
->
json
([
'status'
=>
'error'
,
'data'
=>
'No data found!'
]);
...
...
@@ -101,7 +101,7 @@ class SearchController extends Controller
* */
public
function
searchlocater
(
Request
$request
)
{
$detail
=
$this
->
getApiData
(
$request
[
'locality'
],
$request
[
'state'
],
$request
[
'city'
],
$request
[
'location'
],
$request
[
'page'
]);
$detail
=
$this
->
getApiData
(
$request
[
'locality'
],
$request
[
'state'
],
$request
[
'city'
],
$request
[
'location'
],
$request
[
'
ratingOrder'
],
$request
[
'
page'
]);
$final
=
$detail
->
original
;
if
(
$final
[
'status'
]
==
'success'
){
...
...
@@ -114,8 +114,9 @@ class SearchController extends Controller
$state
=
$request
->
state
;
$city
=
$request
->
city
;
$location
=
$request
->
location
;
$ratingOrder
=
$request
->
ratingOrder
;
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'state'
,
'city'
,
'location'
,
'meta'
))
->
render
();
$html
=
view
(
'frontend.searchs.location_element'
,
compact
(
'finalData'
,
'links'
,
'locality'
,
'state'
,
'city'
,
'location'
,
'
ratingOrder'
,
'
meta'
))
->
render
();
return
response
()
->
json
([
'status'
=>
'success'
,
'data'
=>
$html
...
...
application/app/Traits/Apitraits.php
View file @
aa43f48c
...
...
@@ -102,7 +102,7 @@ Trait Apitraits
}
public
function
call_api_page
(
$api_url
,
$locatorID
=
null
,
$state
=
null
,
$city
=
null
,
$location
=
null
,
$page
=
1
)
public
function
call_api_page
(
$api_url
,
$locatorID
=
null
,
$state
=
null
,
$city
=
null
,
$location
=
null
,
$
ratingOrder
=
null
,
$
page
=
1
)
{
$apiKey
=
$this
->
getAPiKey
();
...
...
@@ -116,6 +116,7 @@ Trait Apitraits
'keyword'
=>
$locatorID
,
'state'
=>
$state
,
'city'
=>
$city
,
'ratingOrder'
=>
$ratingOrder
,
'page'
=>
empty
(
$page
)
?
1
:
$page
);
...
...
application/resources/views/frontend/searchs/index.blade.php
View file @
aa43f48c
...
...
@@ -123,14 +123,26 @@
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
paginate
(
page
,
locality
,
state
,
city
,
location
);
});
function
paginate
(
page
,
locality
,
state
,
city
,
location
){
$
(
"#searchlocaterid"
).
on
(
'click'
,
'.ratingDropDown a'
,
function
()
{
var
page
=
$
(
this
).
data
(
'page'
);
var
locality
=
$
(
'.locality'
).
val
();
var
state
=
$
(
'.getStateValue option:selected'
).
attr
(
'state'
);
var
city
=
$
(
'.getCityValue'
).
val
();
var
location
=
$
(
'.location'
).
val
();
var
ratingOrder
=
$
(
this
).
data
(
'rating'
);
paginate
(
page
,
locality
,
state
,
city
,
location
,
ratingOrder
);
});
function
paginate
(
page
,
locality
,
state
,
city
,
location
,
ratingOrder
){
$
.
ajax
({
type
:
'post'
,
url
:
"{{route('searchlocater')}}"
,
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locality
:
locality
,
state
:
state
,
city
:
city
,
location
:
location
},
data
:
{
"_token"
:
"{{ csrf_token() }}"
,
page
:
page
,
locality
:
locality
,
state
:
state
,
city
:
city
,
location
:
location
,
ratingOrder
:
ratingOrder
},
success
:
function
(
datanew
)
{
if
(
datanew
.
status
==
'success'
)
{
...
...
application/resources/views/frontend/searchs/location_element.blade.php
View file @
aa43f48c
...
...
@@ -19,11 +19,11 @@
<div
class=
"col-6 text-right"
>
<div
class=
"dropdown"
>
<div
class=
"btn btn-secondary dropdown-toggle custom-dropdown"
id=
"reviewbyfilter"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
Most Newest
Sort By
</div>
<div
class=
"dropdown-menu"
aria-labelledby=
"reviewbyfilter"
>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Highest rating
</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
>
Lowest rating
</a>
<div
class=
"dropdown-menu
ratingDropDown
"
aria-labelledby=
"reviewbyfilter"
>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
data-rating=
"desc"
>
Highest rating
</a>
<a
class=
"dropdown-item"
href=
"javascript:void(0);"
data-rating=
"asc"
>
Lowest rating
</a>
</div>
</div>
</div>
...
...
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