@@ -2192,8 +2192,9 @@ public function attemptCreateOrderWithInstalment()
21922192 */
21932193 $ orderService = app ()->make ( OrdersService::class );
21942194 $ faker = Factory::create ();
2195- $ products = Product::whereRelation ( 'unit_quantities ' , 'quantity ' , '> ' , 100 )
2196- ->with ( 'unit_quantities ' , fn ( $ query ) => $ query ->where ( 'quantity ' , '> ' , 100 ) )
2195+ $ products = Product::whereRelation ( 'unit_quantities ' , 'quantity ' , '> ' , 2000 )
2196+ ->where ( 'type ' , '!= ' , Product::TYPE_GROUPED )
2197+ ->with ([ 'unit_quantities ' => fn ( $ query ) => $ query ->where ( 'quantity ' , '> ' , 2000 ) ])
21972198 ->get ()
21982199 ->shuffle ()->take (1 );
21992200 $ shippingFees = $ faker ->randomElement ([100 , 150 , 200 , 250 , 300 , 350 , 400 ]);
@@ -2777,8 +2778,8 @@ protected function attemptCouponUsage()
27772778
27782779 private function retreiveProducts ()
27792780 {
2780- $ products = Product::whereRelation ( 'unit_quantities ' , 'quantity ' , '> ' , 100 )
2781- ->with ( 'unit_quantities ' , fn ( $ query ) => $ query -> where ( 'quantity ' , '> ' , 100 ) )
2781+ $ products = Product::with ([ 'unit_quantities ' => fn ( $ query ) => $ query -> where ( 'quantity ' , '> ' , 1000 ) ] )
2782+ ->whereRelation ( 'unit_quantities ' , 'quantity ' , '> ' , 1000 )
27822783 ->get ()
27832784 ->shuffle ()
27842785 ->take (3 );
0 commit comments