|
@@ -24,34 +24,34 @@ use App\Models\SitePage;
|
|
|
*/
|
|
|
|
|
|
//巴西官网专用路由
|
|
|
-$host = $_SERVER['HTTP_HOST']; // 获取当前域名
|
|
|
-
|
|
|
-if ($host == 'internal-demo-site.mietubl.com.cn') {
|
|
|
- Route::get('/{slug}', function ($slug) {
|
|
|
- // 查询数据库,将 category_slug 转换为对应ID
|
|
|
- $categoryId = DistProductCategory::where(function ($query) use ($slug) {
|
|
|
- $query->where('slug', $slug);
|
|
|
- })
|
|
|
- ->where('dist_id', getDistId())
|
|
|
- ->first();
|
|
|
-
|
|
|
- if ($categoryId) {
|
|
|
- $productController = new ProductController();
|
|
|
- return $productController->category($slug);
|
|
|
- } else {
|
|
|
- $page = SitePage::where('status', '1')->where('dist_id', getDistId())->where('slug', $slug)->first();
|
|
|
- if ($page) {
|
|
|
-// $pageController = new PageController();
|
|
|
-// return $pageController->detail($page);
|
|
|
- return app()->call([PageController::class, 'detail'], ['slug' => $slug]);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- Route::get('/produto/{slug}', function ($slug) {
|
|
|
- $productController = new ProductController();
|
|
|
- return $productController->detail($slug);
|
|
|
- });
|
|
|
-}
|
|
|
+//$host = $_SERVER['HTTP_HOST']; // 获取当前域名
|
|
|
+//
|
|
|
+//if ($host == 'internal-demo-site.mietubl.com.cn') {
|
|
|
+// Route::get('/{slug}', function ($slug) {
|
|
|
+// // 查询数据库,将 category_slug 转换为对应ID
|
|
|
+// $categoryId = DistProductCategory::where(function ($query) use ($slug) {
|
|
|
+// $query->where('slug', $slug);
|
|
|
+// })
|
|
|
+// ->where('dist_id', getDistId())
|
|
|
+// ->first();
|
|
|
+//
|
|
|
+// if ($categoryId) {
|
|
|
+// $productController = new ProductController();
|
|
|
+// return $productController->category($slug);
|
|
|
+// } else {
|
|
|
+// $page = SitePage::where('status', '1')->where('dist_id', getDistId())->where('slug', $slug)->first();
|
|
|
+// if ($page) {
|
|
|
+//// $pageController = new PageController();
|
|
|
+//// return $pageController->detail($page);
|
|
|
+// return Route::get('/{slug}', [PageController::class, 'detail'])->name('page.detail');
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+// Route::get('/produto/{slug}', function ($slug) {
|
|
|
+// $productController = new ProductController();
|
|
|
+// return $productController->detail($slug);
|
|
|
+// });
|
|
|
+//}
|
|
|
|
|
|
|
|
|
|