45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Helpers\ApiResponse;
|
|
use Illuminate\Support\Facades\DB;
|
|
use App\Models\Products\CommonCode;
|
|
use App\Models\Materials\Material;
|
|
|
|
class MeterialService
|
|
{
|
|
public static function getMeterials()
|
|
{
|
|
$query = new Material();
|
|
return ApiResponse::response('get', $query);
|
|
}
|
|
|
|
public static function setMeterial()
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return ApiResponse::response('get', $query);
|
|
}
|
|
|
|
public static function getMeterial(int $id)
|
|
{
|
|
$query = Material::find($id);
|
|
return ApiResponse::response('get', $query);
|
|
}
|
|
|
|
public static function updateMeterial(int $id)
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return ApiResponse::response('get', $query);
|
|
}
|
|
|
|
public static function destoryMeterial(int $id)
|
|
{
|
|
$query = DB::table('COM_CODE')
|
|
->select(['CODE_TP_ID', 'CODE_ID', 'CODE_VAL', 'CODE_DESC', 'USE_YN']);
|
|
return ApiResponse::response('get', $query);
|
|
}
|
|
}
|