Muhammad Iqbal Afandi 3 vuotta sitten
vanhempi
commit
23d0b09918
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. 8
    0
      app/Services/DashboardService.php

+ 8
- 0
app/Services/DashboardService.php Näytä tiedosto

2
 
2
 
3
 namespace App\Services;
3
 namespace App\Services;
4
 
4
 
5
+use App\Models\StockProduct;
5
 use Carbon\Carbon;
6
 use Carbon\Carbon;
6
 use Illuminate\Support\Facades\DB;
7
 use Illuminate\Support\Facades\DB;
7
 
8
 
8
 class DashboardService
9
 class DashboardService
9
 {
10
 {
11
+    public static function stockProduct()
12
+    {
13
+        StockProduct::where("qty", "<=", "3")
14
+            ->take(5)
15
+            ->get();
16
+    }
17
+
10
     public static function productBestSelling()
18
     public static function productBestSelling()
11
     {
19
     {
12
         $query = DB::table("sale_details")
20
         $query = DB::table("sale_details")