50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace lib\Controllers\DBMS\Client;
|
|
|
|
use lib\Services\MemberService;
|
|
use lib\Services\OnetimeService;
|
|
use lib\Utils\Pagination;
|
|
|
|
class OnetimeController extends ClientController
|
|
{
|
|
private ?OnetimeService $_onetimeService = null;
|
|
private ?MemberService $_memberService = null;
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->getView()->setPath('onetime');
|
|
} //
|
|
|
|
public function getOnetimeService(): OnetimeService
|
|
{
|
|
if ($this->_onetimeService === null) {
|
|
$this->_onetimeService = new OnetimeService();
|
|
}
|
|
return $this->_onetimeService;
|
|
}
|
|
public function getMemberService(): MemberService
|
|
{
|
|
if ($this->_memberService === null) {
|
|
$this->_memberService = new MemberService();
|
|
}
|
|
return $this->_memberService;
|
|
}
|
|
//domain_buy_list.php
|
|
//CLI 접속방법 : php index.php site/counpon
|
|
//WEB 접속방법 : http://localhost/site/coupon
|
|
public function coupon()
|
|
{
|
|
//쿠폰내역
|
|
$this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1);
|
|
$this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE);
|
|
[$this->total, $this->entities] = $this->getOnetimeService()->getEntitiesForDomainCoupon($this->curPage, $this->perPage);
|
|
$this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage);
|
|
//전체 고객정보
|
|
$this->clients = $this->getClientService()->getEntities();
|
|
//전체 관리자정보(등록자)
|
|
$this->members = $this->getMemberService()->getEntities();
|
|
return $this->render(__FUNCTION__);
|
|
}
|
|
} //Class
|