|
@@ -1,6 +1,4 @@
|
|
|
<?php
|
|
|
-
|
|
|
-use App\Models\DistProduct;
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
use App\Http\Controllers\HomeController;
|
|
@@ -13,7 +11,7 @@ use App\Http\Controllers\SitemapController;
|
|
|
use App\Http\Controllers\CollectionController;
|
|
|
|
|
|
use App\Models\DistProductCategory;
|
|
|
-
|
|
|
+use App\Models\SitePage;
|
|
|
/*
|
|
|
|--------------------------------------------------------------------------
|
|
|
| Web Routes
|
|
@@ -40,10 +38,9 @@ if ($host == 'internal-demo-site.mietubl.com.cn') {
|
|
|
if ($categoryId) {
|
|
|
return redirect()->route('products.categories', ['slug' => $categoryId]);
|
|
|
} else {
|
|
|
- $product = DistProduct::getProductSlug($slug);
|
|
|
-
|
|
|
- if ($product) {
|
|
|
- return redirect()->route('products.detail', ['id' => $product->id]);
|
|
|
+ $page = SitePage::where('status', '1')->where('dist_id', getDistId())->where('slug', $slug)->first();
|
|
|
+ if ($page) {
|
|
|
+ return redirect()->route('page.detail', ['id' => $page->id]);
|
|
|
}
|
|
|
}
|
|
|
});
|