|
@@ -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) {
|
|
|
-
|
|
|
- $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) {
|
|
|
-
|
|
|
-
|
|
|
- return app()->call([PageController::class, 'detail'], ['slug' => $slug]);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- Route::get('/produto/{slug}', function ($slug) {
|
|
|
- $productController = new ProductController();
|
|
|
- return $productController->detail($slug);
|
|
|
- });
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|