2025-08-01 17:25:31 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
|
|
use App\Models\Products\Bom;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use App\Models\Products\Product;
|
|
|
|
|
|
|
|
|
|
class ModelService
|
|
|
|
|
{
|
|
|
|
|
public static function getModels()
|
|
|
|
|
{
|
|
|
|
|
$query = new Product();
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function setModel()
|
|
|
|
|
{
|
|
|
|
|
$query = DB::table('COM_CODE')
|
|
|
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getModel(int $id)
|
|
|
|
|
{
|
|
|
|
|
$query = Bom::find($id);
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateModel(int $id)
|
|
|
|
|
{
|
|
|
|
|
$query = DB::table('COM_CODE')
|
|
|
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function destoryModel(int $id)
|
|
|
|
|
{
|
|
|
|
|
$query = DB::table('COM_CODE')
|
|
|
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|