2025-08-01 17:25:31 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
|
|
|
|
use App\Helpers\ApiResponse;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use App\Models\Products\Bom;
|
|
|
|
|
|
|
|
|
|
class BomService
|
|
|
|
|
{
|
|
|
|
|
public static function getBoms()
|
|
|
|
|
{
|
|
|
|
|
$query = new Bom();
|
2025-08-19 12:41:17 +09:00
|
|
|
return $query->get();
|
2025-08-01 17:25:31 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function setBom()
|
|
|
|
|
{
|
|
|
|
|
$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 getBom(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 updateBom(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 destoryBom(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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|