45 lines
1021 B
PHP
45 lines
1021 B
PHP
<?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();
|
|
return $query->get();
|
|
}
|
|
|
|
public static function setModel()
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return $query->get();
|
|
}
|
|
|
|
public static function getModel(int $id)
|
|
{
|
|
$query = Bom::find($id);
|
|
return $query->get();
|
|
}
|
|
|
|
public static function updateModel(int $id)
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return $query->get();
|
|
}
|
|
|
|
public static function destoryModel(int $id)
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return $query->get();
|
|
}
|
|
|
|
}
|