You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.2 KiB
PHTML

2 years ago
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Services\CrossFileService;
use App\Libs\TraitPartner;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Contracts\View\View;
class PartnerController extends Controller
{
use TraitPartner;
protected $breadcrumbs = [
['title' => '제휴업체', 'link' => '/cms/partner']
];
// Page Header
protected $page = [
'code' => 'cms.partner',
'title' => '제휴업체',
'icon' => 'fa-flag',
'description' => '',
'link' => '/cms/partner'
];
/**
* 제휴업체 목록
*
* @Verb : GET
* @Path : /cms/partner
* @param Request $request
* @return View
*/
public function index(Request $request)
{
$this->page['subTitle'] = '제휴업체 목록';
$perPage = 10;
$data = $this->getPartnerList($request, $perPage, false);
return $this->setView('admin.partner.index', $data);
}
/**
* 제휴업체 등록
*
* @Verb : GET
* @Path : /cms/partner/create
* @Path : /cms/partner/modify/{uid}
* @param string $uid
* @return View
*/
public function create($uid = '')
{
$data = $this->createPartner($uid);
$this->page['subTitle'] = ($data->mode == 'modify') ? '제휴업체 변경' : '제휴업체 등록';
return $this->setView('admin.partner.create', compact('data'));
}
/**
* 제휴업체 저장
*
* @Verb : POST
* @Path : /cms/partner/store
* @param Request $request
* @param CrossFileService $fileService
* @return JsonResponse
*/
public function store(Request $request, CrossFileService $fileService)
{
$result = $this->storePartner($request, $fileService);
return $this->sendJson($result['message'], $result['code']);
}
/**
* 제휴업체 삭제
*
* Verb : POST
* Path : /cms/partner/delete
* @param Request $request
* @return JsonResponse
*/
public function delete(Request $request)
{
$result = $this->deletePartner($request);
return $this->sendJson($result['message'], $result['code']);
}
}