feat : API - 제품 Category 리스트
This commit is contained in:
37
app/Services/ProductService.php
Normal file
37
app/Services/ProductService.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Helpers\ApiResponse;
|
||||
use App\Models\MemberCompany;
|
||||
use App\Models\Products\CommonCode;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ProductService
|
||||
{
|
||||
|
||||
/**
|
||||
* 회원 조회(리스트)
|
||||
*/
|
||||
public static function getCategory(string $userToken, bool $debug = false)
|
||||
{
|
||||
$query = CommonCode::where('code_group','category')->where('parent_id',null);
|
||||
|
||||
return ApiResponse::response('get', $query, true);
|
||||
}
|
||||
|
||||
public static function getMyInfo($request, bool $debug = false)
|
||||
{
|
||||
|
||||
$member = $request->user();
|
||||
$company = MemberCompany::where('mc_num',$member->tn_num)->first();
|
||||
$data=[
|
||||
'member' => $member,
|
||||
'company' => $company
|
||||
];
|
||||
|
||||
return ApiResponse::response('result', $data, $debug);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user