remove haseager limit a cause de fucking old server version SQL
This commit is contained in:
parent
65f974f68a
commit
c5d4162f2b
4 changed files with 2 additions and 10 deletions
|
|
@ -20,9 +20,7 @@ class ProductsController extends Controller
|
|||
$productsSlides = ProductSliderPictures::where('status', 1)->orderBy('order', 'ASC')->get();
|
||||
$meatTypes = MeatTypes::select('name', 'slug')->where('status', 1)->get();
|
||||
$ct = ConsumptionTimes::select('name', 'slug')->where('status', 1)->get();
|
||||
$ranges = Ranges::where('status', 1)->with(['products' => function ($q) {
|
||||
$q->limit(1);
|
||||
}])->get();
|
||||
$ranges = Ranges::where('status', 1)->with('products')->get();
|
||||
|
||||
return view('front.products.index', compact('productsSlides', 'ranges', 'meatTypes', 'ct'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,10 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;
|
||||
|
||||
class Products extends Model
|
||||
{
|
||||
|
||||
use HasEagerLimit;
|
||||
|
||||
protected $casts = [
|
||||
'star' => 'boolean'
|
||||
];
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;
|
||||
|
||||
class Ranges extends Model
|
||||
{
|
||||
use HasEagerLimit;
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@
|
|||
"riverskies/laravel-mobile-detect": "^1.3",
|
||||
"snipe/banbuilder": "^2.3",
|
||||
"spatie/laravel-mix-preload": "^1.2",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"staudenmeir/eloquent-eager-limit": "^1.0"
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.0",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue