updated
This commit is contained in:
@@ -161,6 +161,73 @@ class TeamStoreController extends Controller
|
||||
->with('thumbnails', $thumbnails);
|
||||
}
|
||||
|
||||
public function storeIndex(Request $request)
|
||||
{
|
||||
// $analyticsData = Analytics::getMostVisitedPages(14, 50);
|
||||
|
||||
// foreach($analyticsData as $key => $val){
|
||||
// if (strpos($val['url'], 'teamstore') !== false) {
|
||||
// $teamstore[] = $val['url'];
|
||||
// }
|
||||
// }
|
||||
|
||||
// foreach($teamstore as $t){
|
||||
// $sad = explode('/', $t);
|
||||
|
||||
// if(count($sad) == 4){
|
||||
// $arr_teamstore[] = explode('?', $sad['3'])['0'];
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// var_dump(array_unique($arr_teamstore));
|
||||
|
||||
$m = new TeamStoreModel;
|
||||
$q = $request->input('q');
|
||||
$sort = $request->input('s');
|
||||
|
||||
if (isset($q) && isset($sort)) {
|
||||
|
||||
if ($sort == "latest") {
|
||||
$field = "Id";
|
||||
$sort_value = "DESC";
|
||||
} elseif ($sort == "al-desc") {
|
||||
$field = "StoreName";
|
||||
$sort_value = "DESC";
|
||||
} elseif ($sort == "oldest") {
|
||||
$field = "Id";
|
||||
$sort_value = "ASC";
|
||||
} else {
|
||||
$field = "StoreName";
|
||||
$sort_value = "ASC";
|
||||
}
|
||||
|
||||
if ($q != "") {
|
||||
// keyword and sort
|
||||
$stores_array = $m->selectTeamstoreSearch($field, $sort_value, $q);
|
||||
} else {
|
||||
// sort only
|
||||
$stores_array = $m->selectTeamstoreFilter($field, $sort_value);
|
||||
}
|
||||
} else {
|
||||
$field = "StoreName";
|
||||
$sort_value = "ASC";
|
||||
$sort = "al-asc";
|
||||
$stores_array = $m->selectTeamstoreFilter($field, $sort_value);
|
||||
}
|
||||
|
||||
$getCarousel = $m->getCarousel();
|
||||
// var_dump($getCarousel);
|
||||
|
||||
$featured_products = $m->selectFeaturedProducts();
|
||||
return view('merchbay.stores')
|
||||
->with('stores_array', $stores_array)
|
||||
->with('keyword', $q)
|
||||
->with('filter', $sort)
|
||||
->with('carousel_images', $getCarousel)
|
||||
->with('featured_products', $featured_products);
|
||||
}
|
||||
|
||||
public function storelist(Request $request)
|
||||
{
|
||||
// $analyticsData = Analytics::getMostVisitedPages(14, 50);
|
||||
|
||||
Reference in New Issue
Block a user