feat : 품목관리 API 추가
This commit is contained in:
44
app/Services/MeterialService.php
Normal file
44
app/Services/MeterialService.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user