|
@@ -46,6 +46,7 @@ class ProductController extends Controller
|
|
|
$products = DistProduct::where('category_id', $category->id)
|
|
|
->where('dist_id', getDistId())
|
|
|
->where('enabled', 1)
|
|
|
+ ->where('status', 2)
|
|
|
->with('images') // Eager load images
|
|
|
->orderBy('order', 'desc') // 按 order 字段降序排序
|
|
|
->orderBy('id', 'desc') // 按 id 降序排序
|
|
@@ -115,6 +116,7 @@ class ProductController extends Controller
|
|
|
$relatedProducts = DistProduct::where('category_id', $product->category_id)
|
|
|
->where('dist_id', getDistId())
|
|
|
->where('enabled', 1)
|
|
|
+ ->where('status', 2)
|
|
|
->where('id', '<>', $product->id)
|
|
|
->with('images') // Eager load images
|
|
|
->orderBy('order', 'desc') // 按 order 字段降序排序
|