|
@@ -42,9 +42,12 @@ class DistProduct extends Model
|
|
|
|
|
|
public static function getProducts($categoryId = null, $limit = null)
|
|
|
{
|
|
|
+ $dist=app('dist');
|
|
|
+
|
|
|
$query = self::query();
|
|
|
|
|
|
$query->where('enabled', 1);
|
|
|
+ $query->where('dist_id', $dist->id);
|
|
|
|
|
|
|
|
|
if ($categoryId) {
|
|
@@ -54,6 +57,7 @@ class DistProduct extends Model
|
|
|
|
|
|
$query->with(['images', 'distProductCategory']);
|
|
|
|
|
|
+ $query->orderBy('is_pinned', 'desc');
|
|
|
|
|
|
if ($limit) {
|
|
|
return $query->limit($limit)->get();
|