Commit dd000b3d by Arpit Jain

Worked on rating drop down selected and also completed review point

parent 728070f7
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Homepage;
use App\Helpers\Apihelpers; use App\Helpers\Apihelpers;
use App\Traits\Apitraits; use App\Traits\Apitraits;
use App\Locater; use App\Locater;
...@@ -122,8 +121,7 @@ class SearchController extends Controller ...@@ -122,8 +121,7 @@ class SearchController extends Controller
$api_url = config('app.api_location'); $api_url = config('app.api_location');
$locationDetailAPIdata = $this->call_api($api_url,$locatorID); $locationDetailAPIdata = $this->call_api($api_url,$locatorID);
$homepage = Homepage::where('homepages.status', '=', '1')->first(); return view('frontend.searchs.detail', compact('locatorID','locationDetailAPIdata','pageData'));
return view('frontend.searchs.detail', compact('homepage','locatorID','locationDetailAPIdata','pageData'));
} }
...@@ -133,59 +131,40 @@ class SearchController extends Controller ...@@ -133,59 +131,40 @@ class SearchController extends Controller
$api_url = config('app.api_search'); $api_url = config('app.api_search');
$locationDetailAPIdata = $this->call_api_page($api_url,$request['query']); $locationDetailAPIdata = $this->call_api_page($api_url,$request['query']);
if(empty($locationDetailAPIdata['data'])){ $html = view('frontend.searchs.autocomplete', compact('locationDetailAPIdata'))->render();
return [
$html = view('frontend.searchs.autocomplete', compact('locationDetailAPIdata'))->render();
return response()->json([
'status' => 'error',
'data' => $html
]);
}else{
$html = view('frontend.searchs.autocomplete', compact('locationDetailAPIdata'))->render();
return response()->json([
'status' => 'success', 'status' => 'success',
'data' => $html 'data' => $html
]); ];
}
} }
/** /**
* For render Review ajax * For render Review ajax
* */ * */
public function reviewpaginate(Request $request) public function reviewPaginate(Request $request)
{ {
$api_url = config('app.api'); $api_url = config('app.api');
$reviewData = $this->review_api_detail($api_url,$request->locatorID,$request->page); $reviewData = $this->review_api_detail($api_url, $request->locatorID, $request->page);
if ( count($reviewData['data']) < 1 ) return '';
return view('frontend.searchs.review_element', compact('reviewData')); return view('frontend.searchs.review_element', compact('reviewData'));
} }
public function getCityValue(Request $request) public function getCityValue(Request $request)
{ {
$getCityData = City::where('cities.name', '!=', '')->where('cities.parent_id', '=', $request->state)->pluck('name','id')->toarray(); $getCityData = City::where('cities.name', '!=', '')
->where('cities.parent_id', '=', $request->state)
->where('cities.is_deleted', '=', '0')
->where('cities.status', '=', '1')
->pluck('name','id')->toarray();
if(!empty($getCityData)){ $html = view('frontend.searchs.city_dropdown', compact('getCityData'))->render();
return [
$html = view('frontend.searchs.city_dropdown', compact('getCityData'))->render(); 'status' => 'success',
return response()->json([ 'data' => $html
'status' => 'success', ];
'data' => $html
]);
}else{
$html = view('frontend.searchs.city_dropdown', compact('getCityData'))->render();
return response()->json(['status' => 'error', 'data' => $html]);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment