본문으로 건너뛰기

주문 적용 쿠폰 회원 다운로드 발급 방식 추가

PHP 8 · GODO25
변경 파일 수: 41개
변경 파일 목록
총 41개
data (20)
coupon.cssskin/front/moment/css/event/couponzone.htmlskin/front/moment/event/layer_coupon_down.htmlskin/front/moment/goods/coupon.cssskin/front/mygreek/css/event/couponzone.htmlskin/front/mygreek/event/layer_coupon_down.htmlskin/front/mygreek/goods/gd_contents.cssskin/front/story_g/css/couponzone.htmlskin/front/story_g/event/layer_coupon_down.htmlskin/front/story_g/goods/coupon.cssskin/mobile/moment/css/event/event.cssskin/mobile/moment/css/event/couponzone.htmlskin/mobile/moment/event/layer_coupon_down.htmlskin/mobile/moment/goods/coupon.cssskin/mobile/mygreek/css/event/couponzone.htmlskin/mobile/mygreek/event/layer_coupon_down.htmlskin/mobile/mygreek/goods/gd_contents.cssskin/mobile/story_g/css/couponzone.htmlskin/mobile/story_g/event/layer_coupon_down.htmlskin/mobile/story_g/goods/icon-check-black.pngskin/mobile/story_g/img/icon/
변경 파일 코드
추가삭제
Admin/promotion/coupon_list.php+2-1
변경 전coupon_list.php
 
<form id="frmCouponList" action="../promotion/coupon_ps.php" method="post">
<input type="hidden" name="mode" value="deleteCouponList"/>
 
<table class="table table-rows promotion-coupon-list">
<thead>
<tr>
method: "POST",
cache: false,
url: "../promotion/coupon_ps.php",
data: "mode=modifyCouponList&couponNo=" + couponNo + "&couponType=" + couponType,
dataType: 'json'
}).success(function (data) {
BootstrapDialog.alert({
 
변경 후coupon_list.php
 
<form id="frmCouponList" action="../promotion/coupon_ps.php" method="post">
<input type="hidden" name="mode" value="deleteCouponList"/>
<input type="hidden" name="couponListToken" value="<?= $couponListToken ?>"/>
<table class="table table-rows promotion-coupon-list">
<thead>
<tr>
method: "POST",
cache: false,
url: "../promotion/coupon_ps.php",
data: "mode=modifyCouponList&couponNo=" + couponNo + "&couponType=" + couponType + "&couponListToken=" + $('input[name=couponListToken]').val(),
dataType: 'json'
}).success(function (data) {
BootstrapDialog.alert({
 
Admin/promotion/coupon_manage.php+3-2
변경 전coupon_manage.php
<tbody>
<tr>
<th>쿠폰명</th>
<td><?= $getData['couponNm']; ?></td>
</tr>
<tr>
<th>쿠폰설명</th>
<td><?= $getData['couponDescribed']; ?></td>
</tr>
<tr>
<th>사용기간</th>
 
<form id="frmMemberCouponList" action="../promotion/coupon_ps.php" method="post">
<input type="hidden" name="mode" value="deleteCouponManage" />
 
<input type="hidden" name="couponNo" value="<?= $getData['couponNo']; ?>" />
<table class="table table-rows">
<colgroup>
 
변경 후coupon_manage.php
<tbody>
<tr>
<th>쿠폰명</th>
<td><?= gd_htmlspecialchars($getData['couponNm']); ?></td>
</tr>
<tr>
<th>쿠폰설명</th>
<td><?= gd_htmlspecialchars($getData['couponDescribed']); ?></td>
</tr>
<tr>
<th>사용기간</th>
 
<form id="frmMemberCouponList" action="../promotion/coupon_ps.php" method="post">
<input type="hidden" name="mode" value="deleteCouponManage" />
<input type="hidden" name="couponManageToken" value="<?= $couponManageToken ?>" />
<input type="hidden" name="couponNo" value="<?= $getData['couponNo']; ?>" />
<table class="table table-rows">
<colgroup>
 
Admin/promotion/coupon_regist.php+5-8
변경 전coupon_regist.php
<input type="hidden" name="ypage" value="<?= $ypage; ?>"/>
<input type="hidden" name="couponNo" value="<?= $couponData['couponNo']; ?>"/>
<input type="hidden" name="couponKind" value="<?= $couponData['couponKind']; ?>"/>
 
<input type="hidden" name="couponType" value="<?= $couponData['couponType']; ?>"/>
 
<div class="page-header js-affix">
쿠폰명
</th>
<td colspan="3">
<input type="text" name="couponNm" value="<?= $couponData['couponNm'] ?>" class="form-control width-xl" maxlength="30"/>
</td>
</tr>
<tr>
쿠폰설명
</th>
<td colspan="3">
<input type="text" name="couponDescribed" value="<?= $couponData['couponDescribed'] ?>" class="form-control width100p" maxlength="50"/>
</td>
</tr>
<tr class="tr_auto">
// 발급방식
$('input:radio[name="couponSaveType"]:eq(0)').prop("disabled", false);
$('input:radio[name="couponSaveType"]:eq(1)').prop("disabled", false);
$('input:radio[name="couponSaveType"]:eq(2)').prop("disabled", true);
if ($('input:radio[name="couponSaveType"]:checked').val() == 'down') {
$('input:radio[name="couponSaveType"]:eq(2)').prop("checked", false);
$('input:radio[name="couponSaveType"]:eq(0)').prop("checked", true);
}
$('#labelCouponSaveTypeManual').show();
$('#labelCouponSaveTypeAuto').show();
$('#labelCouponSaveTypeDown').hide();
// 혜택구분
$('input:radio[name="couponKindType"]:eq(0)').prop("disabled", false);
if ($('input:radio[name="couponKindType"]:checked').val() == 'delivery') {
 
변경 후coupon_regist.php
<input type="hidden" name="ypage" value="<?= $ypage; ?>"/>
<input type="hidden" name="couponNo" value="<?= $couponData['couponNo']; ?>"/>
<input type="hidden" name="couponKind" value="<?= $couponData['couponKind']; ?>"/>
<input type="hidden" name="couponRegistToken" value="<?= $couponRegistToken ?>"/>
<input type="hidden" name="couponType" value="<?= $couponData['couponType']; ?>"/>
 
<div class="page-header js-affix">
쿠폰명
</th>
<td colspan="3">
<input type="text" name="couponNm" value="<?= gd_htmlspecialchars($couponData['couponNm']) ?>" class="form-control width-xl" maxlength="30"/>
</td>
</tr>
<tr>
쿠폰설명
</th>
<td colspan="3">
<input type="text" name="couponDescribed" value="<?= gd_htmlspecialchars($couponData['couponDescribed']) ?>" class="form-control width100p" maxlength="50"/>
</td>
</tr>
<tr class="tr_auto">
// 발급방식
$('input:radio[name="couponSaveType"]:eq(0)').prop("disabled", false);
$('input:radio[name="couponSaveType"]:eq(1)').prop("disabled", false);
$('input:radio[name="couponSaveType"]:eq(2)').prop("disabled", false);
 
 
 
 
$('#labelCouponSaveTypeManual').show();
$('#labelCouponSaveTypeAuto').show();
$('#labelCouponSaveTypeDown').show();
// 혜택구분
$('input:radio[name="couponKindType"]:eq(0)').prop("disabled", false);
if ($('input:radio[name="couponKindType"]:checked').val() == 'delivery') {
 
Component/Coupon/CouponAdmin.php+154-121
변경 전CouponAdmin.php
use Component\Sms\SmsAdmin;
use Component\Sms\SmsAutoCode;
use Component\Validator\Validator;
 
use Framework\File\FileHandler;
use Framework\ObjectStorage\Service\ImageUploadService;
use Framework\Utility\ArrayUtils;
use Framework\Utility\ProducerUtils;
 
use Globals;
use Origin\Enum\ApiClient\Notification\SmsPersonalInfoAccessLogEventType;
use Origin\Service\WebHook\PromotionWebHookService;
*/
public function getCouponAdminList($mode = null, $addSaveTypeWhere = '')
{
$getValue = Request::get()->toArray();
$this->setCouponAdminSearch($getValue);
 
$sort['fieldName'] = gd_isset($getValue['sort']['name']);
$sort['sortMode'] = gd_isset($getValue['sort']['mode']);
if (empty($sort['fieldName']) || empty($sort['sortMode'])) {
$sort['fieldName'] = 'c.regDt';
$sort['sortMode'] = 'desc';
} else {
$sort['fieldName'] = 'c' . $sort['fieldName'];
}
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($sort['fieldName'], self::ALLOWED_SORT_FIELDS_COUPON, true)) {
$sort['fieldName'] = 'c.regDt';
}
if (!in_array($sort['sortMode'], self::ALLOWED_SORT_MODES, true)) {
$sort['sortMode'] = 'desc';
}
 
 
// 레이어에서 자바스크립트 페이징 처리시 사용되는 구문
if (gd_isset($getValue['pagelink'])) {
$getValue['page'] = (int) str_replace('page=', '', preg_replace('/^{page=[0-9]+}/', '', gd_isset($getValue['pagelink'])));
}
gd_isset($getValue['page'], 1);
gd_isset($getValue['pageNum'], 10);
 
$page = \App::load('\\Component\\Page\\Page', $getValue['page']);
$page->page['list'] = $getValue['pageNum'];
 
if (!$mode) {
$mode = 'online';
}
 
if ($addSaveTypeWhere != '') {
$this->arrWhere[] = 'c.couponSaveType = ?';
$this->db->bind_param_push($this->arrBind, $this->fieldTypes['coupon']['couponSaveType'], $addSaveTypeWhere);
$addSaveTypeWhere = " AND couponSaveType = '".$addSaveTypeWhere."'";
}
 
if ($mode == 'all') {
$this->arrWhere[] = '1';
$amountSql = 'SELECT count(couponNo) FROM ' . DB_COUPON . ' WHERE 1' . $addSaveTypeWhere;
} else {
$this->arrWhere[] = 'c.couponKind = ?';
$this->db->bind_param_push($this->arrBind, $this->fieldTypes['coupon']['couponKind'], $mode);
$amountSql = 'SELECT count(couponNo) FROM ' . DB_COUPON . ' WHERE couponKind = "' . $mode . '"' . $addSaveTypeWhere;
}
list($page->recode['amount']) = $this->db->fetch($amountSql, 'row');
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
 
 
 
 
 
 
 
 
 
$this->db->strField = "c.*";
$this->db->strWhere = gd_implode(' AND ', gd_isset($this->arrWhere));
$this->db->strOrder = $sort['fieldName'] . ' ' . $sort['sortMode'];
if($getValue['couponUseLayer'] != 'attendance_detail') { // 출석체크 쿠폰 혜택지급 레이어에서는 전체 쿠폰리스트 필요하여 limit 삭제
$this->db->strLimit = $page->recode['start'] . ',' . $getValue['pageNum'];
}
// 검색 카운트
$strSQL = ' SELECT COUNT(c.couponNo) AS cnt FROM ' . DB_COUPON .' as c ' . ' WHERE ' . $this->db->strWhere;
$res = $this->db->query_fetch($strSQL, $this->arrBind, false);
$page->recode['total'] = $res['cnt']; // 검색 레코드 수
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$query = $this->db->query_complete();
$strSQL = 'SELECT ' . array_shift($query) . ',m.isDelete FROM ' . DB_COUPON . ' as c LEFT OUTER JOIN ' . DB_MANAGER . " as m ON c.managerNo = m.sno" . gd_implode(' ', $query);
// \Logger::debug($strSQL, $this->arrBind);
$data = $this->db->query_fetch($strSQL, $this->arrBind);
Manager::displayListData($data);
 
$getData['data'] = gd_htmlspecialchars_stripslashes(gd_isset($data));
 
 
$getData['sort'] = $sort;
$getData['search'] = gd_htmlspecialchars($this->search);
$getData['checked'] = $this->checked;
 
return $getData;
 
 
 
 
}
 
/**
*/
public function getMemberCouponAdminList()
{
$getValue = Request::get()->toArray();
$this->setMemberCouponAdminSearch($getValue);
 
$sort['fieldName'] = gd_isset($getValue['sort']['name']);
$sort['sortMode'] = gd_isset($getValue['sort']['mode']);
if (empty($sort['fieldName']) || empty($sort['sortMode'])) {
$sort['fieldName'] = 'mc.regDt';
$sort['sortMode'] = 'desc';
} else {
$sort['fieldName'] = 'mc.' . $sort['fieldName'];
}
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($sort['fieldName'], self::ALLOWED_SORT_FIELDS_MEMBER_COUPON, true)) {
$sort['fieldName'] = 'mc.regDt';
}
if (!in_array($sort['sortMode'], self::ALLOWED_SORT_MODES, true)) {
$sort['sortMode'] = 'desc';
}
 
 
gd_isset($getValue['page'], 1);
gd_isset($getValue['pageNum'], 10);
 
$page = \App::load('\\Component\\Page\\Page', $getValue['page']);
$page->page['list'] = $getValue['pageNum'];
$arrBindTotal = [];
$this->db->bind_param_push($arrBindTotal, 'i', $getValue['couponNo']);
$total = $this->db->query_fetch('SELECT count(mc.memNo) as total FROM ' . DB_MEMBER_COUPON . ' as mc WHERE mc.couponNo = ?', $arrBindTotal, false);
$page->recode['amount'] = $total['total'];
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$this->db->strField = "mc.*, c.couponNm, c.couponDescribed, c.couponSaveType, ";
$this->db->strField .= " m.memId, m.memNm, m.groupSno, IF(ms.connectFl='y', ms.snsTypeFl, '') AS snsTypeFl";
$this->db->strWhere = gd_implode(' AND ', gd_isset($this->arrWhere));
$this->db->strJoin = 'LEFT JOIN ' . DB_MEMBER . ' as m ON m.memNo = mc.memNo ';
$this->db->strJoin .= 'LEFT JOIN ' . DB_MEMBER_SNS . ' as ms ON mc.memNo = ms.memNo ';
$this->db->strJoin .= ' LEFT JOIN ' . DB_COUPON . ' as c ON c.couponNo = mc.couponNo';
$this->db->strOrder = $sort['fieldName'] . ' ' . $sort['sortMode'];
$this->db->strLimit = $page->recode['start'] . ',' . $getValue['pageNum'];
 
// 검색 카운트
$strSQL = ' SELECT COUNT(mc.memNo) AS cnt FROM ' . DB_MEMBER_COUPON .' as mc ' . $this->db->strJoin . ' WHERE ' . $this->db->strWhere;
$res = $this->db->query_fetch($strSQL, $this->arrBind, false);
$page->recode['total'] = $res['cnt']; // 검색 레코드 수
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$query = $this->db->query_complete();
$strSQL = 'SELECT ' . array_shift($query) . ' FROM ' . DB_MEMBER_COUPON . ' as mc ' . gd_implode(' ', $query);
$data = $this->db->query_fetch($strSQL, $this->arrBind);
 
$getData['data'] = gd_htmlspecialchars_stripslashes(gd_isset($data));
$getData['sort'] = $sort;
$getData['search'] = gd_htmlspecialchars($this->search);
$getData['checked'] = $this->checked;
return $getData;
 
 
 
 
}
 
/**
// 발급방식에 따른 체크
// 회원다운로드 일 경우
if ($arrData['couponSaveType'] == 'down') {
if ($arrData['couponUseType'] == 'order' || $arrData['couponUseType'] == 'delivery') { // 쿠폰유형–상품쿠폰(‘product’),주문쿠폰(‘order’),배송비쿠폰('delivery')
throw new \Exception(__('회원다운로드 발급은 상품 쿠폰만 생성할 수 있습니다.'));
}
$validator->add('couponDisplayType', 'yn', true); // 상세노출기간종류–즉시(‘n’),예약(‘y’)
if ($arrData['couponDisplayType'] == 'y') {
}
}
 
 
$validator->add('couponNm', null, true); // 쿠폰명
// $validator->add('couponNm', 'maxlen', true, null, 30); // 쿠폰명 최대 30자
$validator->add('couponDescribed', '', null); // 쿠폰설명
}
 
// 발급 가능 회원등급 선택
$arrData['couponApplyMemberGroupDisplayType'] = 'n';
$validator->add('couponApplyMemberGroupDisplayType', null, null); // 발급/사용 가능한 회원등급에게만 쿠폰노출
 
 
 
if ($arrData['couponSaveType'] == 'manual') { // 발급방식이 '수동발급' 경우
$arrData['couponApplyMemberGroup'] = '';
$validator->add('couponApplyMemberGroup', null, null); // 선택된 회원등급
// 키워드 검색
if ($this->search['key'] && $this->search['keyword']) {
if(empty($getValue['couponUseType']) === true) { // 출석체크 상세보기 레이어에서는 쿠폰검색이 아닌 회원검색이므로 해당 where절 포함안함
 
 
 
 
if ($this->search['key'] == 'all') {
$tmpWhere = ['couponNm', 'couponDescribed', 'couponInsertAdminId'];
$arrWhereAll = [];
}
// 키워드 검색
if ($this->search['key'] && $this->search['keyword']) {
 
 
 
 
if ($this->search['key'] == 'all') {
$tmpWhere = ['memId', 'memNm'];
$arrWhereAll = [];
 
변경 후CouponAdmin.php
use Component\Sms\SmsAdmin;
use Component\Sms\SmsAutoCode;
use Component\Validator\Validator;
use Framework\Debug\Exception\DatabaseException;
use Framework\File\FileHandler;
use Framework\ObjectStorage\Service\ImageUploadService;
use Framework\Utility\ArrayUtils;
use Framework\Utility\ProducerUtils;
use Framework\Utility\StringUtils;
use Globals;
use Origin\Enum\ApiClient\Notification\SmsPersonalInfoAccessLogEventType;
use Origin\Service\WebHook\PromotionWebHookService;
*/
public function getCouponAdminList($mode = null, $addSaveTypeWhere = '')
{
try {
$getValue = Request::get()->toArray();
$this->setCouponAdminSearch($getValue);
 
$sort['fieldName'] = gd_isset($getValue['sort']['name']);
$sort['sortMode'] = gd_isset($getValue['sort']['mode']);
if (empty($sort['fieldName']) || empty($sort['sortMode'])) {
$sort['fieldName'] = 'c.regDt';
$sort['sortMode'] = 'desc';
} else {
$sort['fieldName'] = 'c' . $sort['fieldName'];
}
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($sort['fieldName'], self::ALLOWED_SORT_FIELDS_COUPON, true)) {
$sort['fieldName'] = 'c.regDt';
}
if (!in_array($sort['sortMode'], self::ALLOWED_SORT_MODES, true)) {
$sort['sortMode'] = 'desc';
}
 
// 레이어에서 자바스크립트 페이징 처리시 사용되는 구문
if (gd_isset($getValue['pagelink'])) {
$getValue['page'] = (int) str_replace('page=', '', preg_replace('/^{page=[0-9]+}/', '', gd_isset($getValue['pagelink'])));
}
gd_isset($getValue['page'], 1);
gd_isset($getValue['pageNum'], 10);
 
$page = \App::load('\\Component\\Page\\Page', $getValue['page']);
$page->page['list'] = $getValue['pageNum'];
 
if (!$mode) {
$mode = 'online';
}
 
$hasSaveTypeWhere = ($addSaveTypeWhere != '');
if ($hasSaveTypeWhere) {
$this->arrWhere[] = 'c.couponSaveType = ?';
$this->db->bind_param_push($this->arrBind, $this->fieldTypes['coupon']['couponSaveType'], $addSaveTypeWhere);
}
 
// 페이징 총계 쿼리 — SQL Injection 방지: 문자열 보간 대신 바인딩 재사용(SEC-POL-001, Dooray 1308)
$amountBind = [];
if ($mode == 'all') {
$this->arrWhere[] = '1';
$amountWhereParts = ['1'];
} else {
$this->arrWhere[] = 'c.couponKind = ?';
$this->db->bind_param_push($this->arrBind, $this->fieldTypes['coupon']['couponKind'], $mode);
$amountWhereParts = ['couponKind = ?'];
$this->db->bind_param_push($amountBind, $this->fieldTypes['coupon']['couponKind'], $mode);
}
if ($hasSaveTypeWhere) {
$amountWhereParts[] = 'couponSaveType = ?';
$this->db->bind_param_push($amountBind, $this->fieldTypes['coupon']['couponSaveType'], $addSaveTypeWhere);
}
$amountSql = 'SELECT count(couponNo) as cnt FROM ' . DB_COUPON . ' WHERE ' . implode(' AND ', $amountWhereParts);
$amountRow = $this->db->query_fetch($amountSql, $amountBind, false);
$page->recode['amount'] = $amountRow['cnt'];
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$this->db->strField = "c.*";
$this->db->strWhere = gd_implode(' AND ', gd_isset($this->arrWhere));
$this->db->strOrder = $sort['fieldName'] . ' ' . $sort['sortMode'];
if($getValue['couponUseLayer'] != 'attendance_detail') { // 출석체크 쿠폰 혜택지급 레이어에서는 전체 쿠폰리스트 필요하여 limit 삭제
$this->db->strLimit = $page->recode['start'] . ',' . $getValue['pageNum'];
}
// 검색 카운트
$strSQL = ' SELECT COUNT(c.couponNo) AS cnt FROM ' . DB_COUPON .' as c ' . ' WHERE ' . $this->db->strWhere;
$res = $this->db->query_fetch($strSQL, $this->arrBind, false);
$page->recode['total'] = $res['cnt']; // 검색 레코드 수
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$query = $this->db->query_complete();
$strSQL = 'SELECT ' . array_shift($query) . ',m.isDelete FROM ' . DB_COUPON . ' as c LEFT OUTER JOIN ' . DB_MANAGER . " as m ON c.managerNo = m.sno" . gd_implode(' ', $query);
// \Logger::debug($strSQL, $this->arrBind);
$data = $this->db->query_fetch($strSQL, $this->arrBind);
Manager::displayListData($data);
 
$getData['data'] = gd_htmlspecialchars(gd_isset($data));
 
 
$getData['sort'] = $sort;
$getData['search'] = gd_htmlspecialchars($this->search);
$getData['checked'] = $this->checked;
 
return $getData;
} catch (DatabaseException $e) {
\App::getInstance('logger')->channel('coupon')->error('쿠폰 목록 조회 실패', ['exception' => $e]);
throw new \Exception(__('쿠폰 목록 조회에 실패하였습니다.'));
}
}
 
/**
*/
public function getMemberCouponAdminList()
{
try {
$getValue = Request::get()->toArray();
$this->setMemberCouponAdminSearch($getValue);
 
$sort['fieldName'] = gd_isset($getValue['sort']['name']);
$sort['sortMode'] = gd_isset($getValue['sort']['mode']);
if (empty($sort['fieldName']) || empty($sort['sortMode'])) {
$sort['fieldName'] = 'mc.regDt';
$sort['sortMode'] = 'desc';
} else {
$sort['fieldName'] = 'mc.' . $sort['fieldName'];
}
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($sort['fieldName'], self::ALLOWED_SORT_FIELDS_MEMBER_COUPON, true)) {
$sort['fieldName'] = 'mc.regDt';
}
if (!in_array($sort['sortMode'], self::ALLOWED_SORT_MODES, true)) {
$sort['sortMode'] = 'desc';
}
 
gd_isset($getValue['page'], 1);
gd_isset($getValue['pageNum'], 10);
 
$page = \App::load('\\Component\\Page\\Page', $getValue['page']);
$page->page['list'] = $getValue['pageNum'];
$arrBindTotal = [];
$this->db->bind_param_push($arrBindTotal, 'i', $getValue['couponNo']);
$total = $this->db->query_fetch('SELECT count(mc.memNo) as total FROM ' . DB_MEMBER_COUPON . ' as mc WHERE mc.couponNo = ?', $arrBindTotal, false);
$page->recode['amount'] = $total['total'];
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$this->db->strField = "mc.*, c.couponNm, c.couponDescribed, c.couponSaveType, ";
$this->db->strField .= " m.memId, m.memNm, m.groupSno, IF(ms.connectFl='y', ms.snsTypeFl, '') AS snsTypeFl";
$this->db->strWhere = gd_implode(' AND ', gd_isset($this->arrWhere));
$this->db->strJoin = 'LEFT JOIN ' . DB_MEMBER . ' as m ON m.memNo = mc.memNo ';
$this->db->strJoin .= 'LEFT JOIN ' . DB_MEMBER_SNS . ' as ms ON mc.memNo = ms.memNo ';
$this->db->strJoin .= ' LEFT JOIN ' . DB_COUPON . ' as c ON c.couponNo = mc.couponNo';
$this->db->strOrder = $sort['fieldName'] . ' ' . $sort['sortMode'];
$this->db->strLimit = $page->recode['start'] . ',' . $getValue['pageNum'];
 
// 검색 카운트
$strSQL = ' SELECT COUNT(mc.memNo) AS cnt FROM ' . DB_MEMBER_COUPON .' as mc ' . $this->db->strJoin . ' WHERE ' . $this->db->strWhere;
$res = $this->db->query_fetch($strSQL, $this->arrBind, false);
$page->recode['total'] = $res['cnt']; // 검색 레코드 수
$page->setPage();
$page->setUrl(\Request::getQueryString());
 
$query = $this->db->query_complete();
$strSQL = 'SELECT ' . array_shift($query) . ' FROM ' . DB_MEMBER_COUPON . ' as mc ' . gd_implode(' ', $query);
$data = $this->db->query_fetch($strSQL, $this->arrBind);
 
$getData['data'] = gd_htmlspecialchars(gd_isset($data));
$getData['sort'] = $sort;
$getData['search'] = gd_htmlspecialchars($this->search);
$getData['checked'] = $this->checked;
return $getData;
} catch (DatabaseException $e) {
\App::getInstance('logger')->channel('coupon')->error('쿠폰별 회원 목록 조회 실패', ['exception' => $e]);
throw new \Exception(__('쿠폰별 회원 목록 조회에 실패하였습니다.'));
}
}
 
/**
// 발급방식에 따른 체크
// 회원다운로드 일 경우
if ($arrData['couponSaveType'] == 'down') {
if ($arrData['couponUseType'] === 'delivery' || $arrData['couponUseType'] === 'gift') { // 쿠폰유형–상품쿠폰('product'),주문쿠폰('order'),배송비쿠폰('delivery'),기프트쿠폰('gift') → delivery·gift는 회원다운로드 불가
throw new \Exception(__('회원다운로드 발급은 상품·주문 쿠폰만 생성할 수 있습니다.'));
}
$validator->add('couponDisplayType', 'yn', true); // 상세노출기간종류–즉시(‘n’),예약(‘y’)
if ($arrData['couponDisplayType'] == 'y') {
}
}
 
$arrData['couponNm'] = StringUtils::xssClean($arrData['couponNm']);
$validator->add('couponNm', null, true); // 쿠폰명
// $validator->add('couponNm', 'maxlen', true, null, 30); // 쿠폰명 최대 30자
$validator->add('couponDescribed', '', null); // 쿠폰설명
}
 
// 발급 가능 회원등급 선택
// 회원다운로드는 다운로드 목록 노출에 사용하므로 전송값 유지함
if ($arrData['couponSaveType'] !== 'down') {
$arrData['couponApplyMemberGroupDisplayType'] = 'n';
$validator->add('couponApplyMemberGroupDisplayType', null, null); // 발급/사용 가능한 회원등급에게만 쿠폰노출
}
if ($arrData['couponSaveType'] == 'manual') { // 발급방식이 '수동발급' 경우
$arrData['couponApplyMemberGroup'] = '';
$validator->add('couponApplyMemberGroup', null, null); // 선택된 회원등급
// 키워드 검색
if ($this->search['key'] && $this->search['keyword']) {
if(empty($getValue['couponUseType']) === true) { // 출석체크 상세보기 레이어에서는 쿠폰검색이 아닌 회원검색이므로 해당 where절 포함안함
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($this->search['key'], array_keys($this->search['combineSearch']), true)) {
throw new \Exception(__('올바르지 않은 검색 조건입니다.'));
}
if ($this->search['key'] == 'all') {
$tmpWhere = ['couponNm', 'couponDescribed', 'couponInsertAdminId'];
$arrWhereAll = [];
}
// 키워드 검색
if ($this->search['key'] && $this->search['keyword']) {
// 화이트리스트 검증 — SQL Injection 방지
if (!in_array($this->search['key'], array_keys($this->search['combineSearch']), true)) {
throw new \Exception(__('올바르지 않은 검색 조건입니다.'));
}
if ($this->search['key'] == 'all') {
$tmpWhere = ['memId', 'memNm'];
$arrWhereAll = [];
 
Component/Coupon/CouponDAO.php+80
변경 전CouponDAO.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후CouponDAO.php
<?php
/*
* Copyright (C) 2026 NHN COMMERCE. - All Rights Reserved
*
* Unauthorized copying or redistribution of this file in source and binary forms via any medium
* is strictly prohibited.
*/
 
namespace Bundle\Component\Coupon;
 
use App;
use Component\Database\DBTableField;
use Framework\Database\DBTool;
use Exception;
 
class CouponDAO
{
/** @var DBTool $db */
protected $db;
protected $fieldTypes;
protected $logger;
 
public function __construct()
{
$this->db = App::load('DB');
$this->fieldTypes['coupon'] = DBTableField::getFieldTypes('tableCoupon');
$this->logger = App::getInstance('logger');
}
 
/**
* 설정수량 검증과 회원쿠폰 등록을 하나의 트랜잭션으로 처리
*
* @param array $arrData 회원쿠폰 등록 데이터
*
* @throws Exception
*/
public function insertMemberCoupon(array $arrData): void
{
$arrBind = [];
try {
$this->db->begin_tran();
if (!$this->updateCouponSaveCount($arrData['couponNo'])) {
throw new Exception();
}
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
$this->db->commit();
} catch (\Throwable $e) {
$this->db->rollback();
$this->logger->channel('coupon')->warning('회원쿠폰 발급 실패', ['couponNo' => $arrData['couponNo'], 'exception' => $e]);
throw new Exception('발급 조건이 맞지 않습니다.');
} finally {
unset($arrBind);
}
}
 
/**
* 조건부 UPDATE로 설정수량 초과 여부를 원자적으로 검증
*
* @param int $couponNo 쿠폰 고유 번호
*
* @return bool 설정수량 이내에서 발급 수 증가 성공 여부
*/
protected function updateCouponSaveCount($couponNo): bool
{
$arrBind = [];
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponNo'], $couponNo);
$affectedRows = $this->db->set_update_db(
DB_COUPON,
'couponSaveCount = couponSaveCount+1',
"couponNo = ? AND (couponAmountType != 'y' OR couponSaveCount < couponAmount)",
$arrBind,
false,
false
);
unset($arrBind);
 
return $affectedRows >= 1;
}
}
 
Component/Coupon/Coupon.php+371-179
변경 전Coupon.php
use Component\Storage\Storage;
use Component\Cart\CartAdmin;
use Framework\Object\SimpleStorage;
 
use Framework\Utility\ArrayUtils;
use Globals;
use Request;
{
const ERROR_VIEW = 'ERROR_VIEW';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
const ECT_ALREADY_GIVE = 'Coupon.ECT_ALREADY_GIVE';
const ECT_NOTMATCH_SERIAL = 'Coupon.ECT_NOTMATCH_SERIAL';
const ECT_WRONG_EXPIREDATE = 'Coupon.ECT_WRONG_EXPIREDATE';
protected $goodsCouponDownList;
protected $changeStatusAuto;
 
 
 
/**
* 생성자
*/
// 발급여부 쿠폰(발급중)
$arrWhere[] = 'c.couponType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponType'], 'y');
// 상품 쿠폰
$arrWhere[] = 'c.couponUseType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponUseType'], 'product');
 
 
// 회원다운로드 쿠폰
$arrWhere[] = 'c.couponSaveType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponSaveType'], 'down');
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 공급사
if ($val['couponExceptProviderType'] == 'y') {
$exceptProviderGroupArr = explode(INT_DIVISION, $val['couponExceptProvider']);
if (gd_array_search($goodsData['scmNo'], $exceptProviderGroupArr) !== false) {//공급사 존재
$removeKey[] = $key;
continue;
} else {//공급사 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 카테고리
if ($val['couponExceptCategoryType'] == 'y') {
$exceptCategoryGroupArr = explode(INT_DIVISION, $val['couponExceptCategory']);
$matchCateData = 0;
foreach ($cateCdArr as $cateKey => $cateVal) {
if (gd_array_search($cateVal, $exceptCategoryGroupArr) !== false) {//카테고리 존재
$matchCateData++;
} else {//카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
if ($matchCateData > 0) {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재
$removeKey[] = $key;
continue;
} else {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
 
 
 
 
 
 
 
 
 
 
 
 
}
}
// 발급 제외 브랜드
if ($val['couponExceptBrandType'] == 'y') {
$exceptBrandGroupArr = explode(INT_DIVISION, $val['couponExceptBrand']);
if (gd_array_search($goodsData['brandCd'], $exceptBrandGroupArr) !== false) {//브랜드 존재
$removeKey[] = $key;
continue;
} else {//브랜드 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 상품
if ($val['couponExceptGoodsType'] == 'y') {
$exceptGoodsGroupArr = explode(INT_DIVISION, $val['couponExceptGoods']);
if (gd_array_search($goodsNo, $exceptGoodsGroupArr) !== false) {//상품 존재
$removeKey[] = $key;
continue;
} else {//상품 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 허용 체크
if ($val['couponApplyProductType'] == 'all') {//전체 발급
 
} else if ($val['couponApplyProductType'] == 'provider') {//공급사 발급
$applyProviderGroupArr = explode(INT_DIVISION, $val['couponApplyProvider']);
if (gd_array_search($goodsData['scmNo'], $applyProviderGroupArr) !== false) {//공급사 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//공급사 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'category') {//카테고리 발급
$applyCategoryGroupArr = explode(INT_DIVISION, $val['couponApplyCategory']);
$matchCateData = 0;
foreach ($cateCdArr as $cateKey => $cateVal) {
if (gd_array_search($cateVal, $applyCategoryGroupArr) !== false) {//카테고리 존재
$matchCateData++;
} else {//카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}
}
if ($matchCateData > 0) {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'brand') {//브랜드 발급
$applyBrandGroupArr = explode(INT_DIVISION, $val['couponApplyBrand']);
if (gd_array_search($goodsData['brandCd'], $applyBrandGroupArr) !== false) {//브랜드 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//브랜드 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'goods') {//상품 발급
$applyGoodsGroupArr = explode(INT_DIVISION, $val['couponApplyGoods']);
if (gd_array_search($goodsNo, $applyGoodsGroupArr) !== false) {//상품 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//상품 존재안함
$removeKey[] = $key;
continue;
}
}
if ($memNo) {
}
unset($removeKey);
 
 
 
 
 
 
 
return $couponListData;
}
 
}
}
// 쿠폰 사용 회원등급
$data = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = " . $couponData['couponNo'] . " ORDER BY couponUseMemberGroup");
 
 
if ($data) {
foreach ($data as $key => $val) {
$groupNm = GroupUtil::getGroupName('sno=' . $val['couponUseMemberGroup']);
}
} else {
// 쿠폰 사용 회원등급
$data = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = " . $couponVal['couponNo'] . " ORDER BY couponUseMemberGroup");
 
 
if ($data) {
unset($couponArrData[$couponKey]['couponApplyMemberGroup']);
foreach ($data as $key => $val) {
unset($this->arrBind);
unset($this->arrWhere);
 
$memberCouponData['data'] = gd_htmlspecialchars_stripslashes(gd_isset($data));
$memberCouponData['sort'] = $sort;
$memberCouponData['search'] = gd_htmlspecialchars($this->search);
$memberCouponData['selected'] = $this->selected;
unset($this->arrBind);
unset($this->arrWhere);
 
$memberCouponData['data'] = gd_htmlspecialchars_stripslashes(gd_isset($data));
 
return $memberCouponData;
}
} else if ($val['couponSaveType'] == 'manual') {
$convertCouponArrData[$key]['couponSaveType'] = '수동발급';
}
 
 
if ($val['couponUseType'] == 'product') {
$convertCouponArrData[$key]['couponUseType'] = '상품적용쿠폰';
} else if ($val['couponUseType'] == 'order') {
unset($arrBind);
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**
* 상품에 적용된 회원다운로드 쿠폰을 발급 받기
*
public function setGoodsCouponMemberSave($couponNo, $goodsNo, $memNo, $memGroupNo, $scmNo = null, $brandCd = null)
{
$checkCoupon = false;
 
$goodsMemberCouponArrData = $this->getGoodsCouponDownList($goodsNo, $memNo, $memGroupNo, null, null, $scmNo, $brandCd);
 
 
foreach ($goodsMemberCouponArrData as $val) {
 
if ($val['chkMemberCoupon'] == 'YES') {
$couponNoData[] = $val['couponNo'];
}
}
 
if (is_array($couponNo)) {
 
 
 
 
 
 
foreach ($couponNo as $val) {
$checkCoupon = gd_in_array($val, $couponNoData);
 
if ($checkCoupon == true) {
$arrData = [];
$arrData['couponNo'] = $val;
$arrData['couponSaveAdminId'] = $goodsNo . '의 상품쿠폰';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($val);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($val);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', gd_array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
$this->setCouponMemberSaveCount($val);
 
 
 
 
 
 
 
 
 
 
 
 
 
} else {
 
throw new \Exception('발급 조건이 맞지 않는 쿠폰이있습니다. 쿠폰다운창을 다시 열고 받아주세요.');
}
}
$checkCoupon = gd_in_array($couponNo, $couponNoData);
 
if ($checkCoupon == true) {
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = $goodsNo . '의 상품쿠폰';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = Session::get('member.memNo');
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', gd_array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
$this->setCouponMemberSaveCount($couponNo);
 
 
 
 
 
 
 
 
 
 
 
 
 
} else {
 
throw new \Exception('발급 조건이 맞지 않습니다.');
}
}
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**
* 회원다운로드 쿠폰의 링크클릭으로 쿠폰 발급
*
*/
public function setCouponLinkDown($couponNo, $memNo, $memGroupNo)
{
$couponLinkDownData = $this->getCouponLinkDownUsable($couponNo, $memNo, $memGroupNo);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = '회원다운로드쿠폰 링크 다운';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', gd_array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
 
unset($arrData);
unset($arrBind);
// 쿠폰 발급 카운트 증가
$this->setCouponMemberSaveCount($couponNo);
} else {
throw new \Exception($couponLinkDownData);
 
 
 
 
 
 
 
}
}
 
return gd_htmlspecialchars_stripslashes($getData);
}
 
 
 
 
 
 
 
 
 
 
 
/**
* 상품의 해당 쿠폰 리스트용 전체 쿠폰 리스트 추출
*
// 발급여부 쿠폰(발급중)
$arrWhere[] = 'c.couponType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponType'], 'y');
// 상품 쿠폰
$arrWhere[] = 'c.couponUseType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponUseType'], 'product');
 
 
 
// 회원다운로드 쿠폰
$arrWhere[] = 'c.couponSaveType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponSaveType'], 'down');
// 쿠폰 노출 기간
$arrWhere[] = ' ( couponDisplayType = \'n\' OR ( couponDisplayType = \'y\' AND couponDisplayStartDate < now() AND couponDisplayEndDate > now()) )';
// 쿠폰 사용 기간 만료 체크
$arrWhere[] = ' ((couponUsePeriodType = \'period\' and couponUsePeriodEndDate <> \'0000-00-00 00:00:00\' and couponUsePeriodEndDate > now()) OR (couponUsePeriodType = \'day\' and (couponUseDateLimit is not null or couponUseDateLimit = \'0000-00-00 00:00:00\' or couponUseDateLimit > now())))';
 
$this->db->strLimit = 20;
if($couponConfig['couponzoneSort'] != 'custom') $this->db->strOrder = $couponConfig['couponzoneSort'];
}
}
 
 
 
 
 
 
 
 
 
return $list;
}
/**
}
 
if (is_array($couponNo)) {
 
 
 
 
 
 
$success = 0;
foreach ($couponNo as $val) {
$couponLinkDownData = $this->getCouponLinkDownUsable($val, $memNo, $memGroupNo, true);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $val;
$arrData['couponSaveAdminId'] = '쿠폰존';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($val);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($val);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', gd_array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
 
if ($barcodeDisplayFl === 'y') {
//바코드 발급. - 2018.11.07 parkjs
$memCouponNo = $this->db->insert_id();
$barcodeResult = $barcodeCoupon->setCouponNo([$arrData['couponNo']])->setMemberCouponNo($memCouponNo)->couponBarcodeGenarator('give');
}
 
 
 
 
 
 
 
unset($arrData);
unset($arrBind);
// 쿠폰 발급 카운트 증가
$this->setCouponMemberSaveCount($val);
$success++;
 
 
 
}
}
$return['return'] = true;
$return['success'] = $success;
return $return;
} else {
$couponLinkDownData = $this->getCouponLinkDownUsable($couponNo, $memNo, $memGroupNo);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = '쿠폰존';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$arrBind = $this->db->get_binding(DBTableField::tableMemberCoupon(), $arrData, 'insert', gd_array_keys($arrData), ['memberCouponNo']);
$this->db->set_insert_db(DB_MEMBER_COUPON, $arrBind['param'], $arrBind['bind'], 'y');
 
if ($barcodeDisplayFl === 'y') {
//바코드 발급. - 2018.11.07 parkjs
$memCouponNo = $this->db->insert_id();
$barcodeResult = $barcodeCoupon->setCouponNo([$arrData['couponNo']])->setMemberCouponNo($memCouponNo)->couponBarcodeGenarator('give');
}
 
 
 
 
 
 
unset($arrData);
unset($arrBind);
// 쿠폰 발급 카운트 증가
$this->setCouponMemberSaveCount($couponNo);
$return['return'] = true;
$return['success'] = 1;
return $return;
} else {
throw new \Exception($couponLinkDownData);
 
 
 
}
}
}
public function getCouponUseMemberGroup($couponNo)
{
if ($couponNo) {
$memberGroup = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = " . $couponNo);
 
 
if ($memberGroup) {
$resultMemberGroup = array();
foreach ($memberGroup as $val) {
 
변경 후Coupon.php
use Component\Storage\Storage;
use Component\Cart\CartAdmin;
use Framework\Object\SimpleStorage;
use Framework\SimpleCache\SimpleCache;
use Framework\Utility\ArrayUtils;
use Globals;
use Request;
{
const ERROR_VIEW = 'ERROR_VIEW';
 
/** 발급 잠금 키 접두사 */
const MEMBER_SAVE_LOCK_KEY_PREFIX = 'coupon_member_save_';
 
/** 반복 발급 카운트 키 접두사 */
const ISSUE_COUNT_CACHE_KEY_PREFIX = 'coupon_issue_count_';
 
/** 반복 발급 요청 수를 세는 기준 시간(초) */
const ISSUE_RATE_LIMIT_WINDOW_SECONDS = 60;
 
/** 기준 시간 안에 같은 회원·쿠폰으로 허용하는 최대 발급 요청 횟수 (초과 시 거부) */
const ISSUE_RATE_LIMIT_MAX_COUNT = 30;
 
/** [전체 다운받기]로 한 번에 요청할 수 있는 쿠폰 개수의 상한 */
const COUPON_DOWN_ALL_MAX = 300;
 
/** 한 번에 요청한 쿠폰 수가 상한을 넘었을 때의 안내 문구 */
const COUPON_DOWN_ALL_EXCEED_MESSAGE = '쿠폰 발급 개수가 초과되어 발급할 수 없습니다.';
 
const ECT_ALREADY_GIVE = 'Coupon.ECT_ALREADY_GIVE';
const ECT_NOTMATCH_SERIAL = 'Coupon.ECT_NOTMATCH_SERIAL';
const ECT_WRONG_EXPIREDATE = 'Coupon.ECT_WRONG_EXPIREDATE';
protected $goodsCouponDownList;
protected $changeStatusAuto;
 
protected array $couponUseTypes = ['product'];
 
/**
* 생성자
*/
// 발급여부 쿠폰(발급중)
$arrWhere[] = 'c.couponType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponType'], 'y');
$arrPlaceHolder = implode(',', array_fill(0, count($this->couponUseTypes), '?'));
$arrWhere[] = 'c.couponUseType IN (' . $arrPlaceHolder . ')';
foreach ($this->couponUseTypes as $couponUseType) {
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponUseType'], $couponUseType);
}
// 회원다운로드 쿠폰
$arrWhere[] = 'c.couponSaveType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponSaveType'], 'down');
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
if ($val['couponUseType'] !== 'order') { // 주문쿠폰은 상품 무관 — 상품범위 제외·허용 판정 비적용
// 발급 제외 공급사
if ($val['couponExceptProviderType'] == 'y') {
$exceptProviderGroupArr = explode(INT_DIVISION, $val['couponExceptProvider']);
if (gd_array_search($goodsData['scmNo'], $exceptProviderGroupArr) !== false) {//공급사 존재
$removeKey[] = $key;
continue;
} else {//공급사 존재안함
 
 
 
 
 
 
 
 
 
 
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 카테고리
if ($val['couponExceptCategoryType'] == 'y') {
$exceptCategoryGroupArr = explode(INT_DIVISION, $val['couponExceptCategory']);
$matchCateData = 0;
foreach ($cateCdArr as $cateKey => $cateVal) {
if (gd_array_search($cateVal, $exceptCategoryGroupArr) !== false) {//카테고리 존재
$matchCateData++;
} else {//카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
if ($matchCateData > 0) {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재
$removeKey[] = $key;
continue;
} else {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 브랜드
if ($val['couponExceptBrandType'] == 'y') {
$exceptBrandGroupArr = explode(INT_DIVISION, $val['couponExceptBrand']);
if (gd_array_search($goodsData['brandCd'], $exceptBrandGroupArr) !== false) {//브랜드 존재
$removeKey[] = $key;
continue;
} else {//브랜드 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 제외 상품
if ($val['couponExceptGoodsType'] == 'y') {
$exceptGoodsGroupArr = explode(INT_DIVISION, $val['couponExceptGoods']);
if (gd_array_search($goodsNo, $exceptGoodsGroupArr) !== false) {//상품 존재
$removeKey[] = $key;
continue;
} else {//상품 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
// 발급 허용 체크
if ($val['couponApplyProductType'] == 'all') {//전체 발급
 
 
} else if ($val['couponApplyProductType'] == 'provider') {//공급사 발급
$applyProviderGroupArr = explode(INT_DIVISION, $val['couponApplyProvider']);
if (gd_array_search($goodsData['scmNo'], $applyProviderGroupArr) !== false) {//공급사 존재
 
 
 
 
 
 
 
 
 
 
 
 
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//공급사 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'category') {//카테고리 발급
$applyCategoryGroupArr = explode(INT_DIVISION, $val['couponApplyCategory']);
$matchCateData = 0;
foreach ($cateCdArr as $cateKey => $cateVal) {
if (gd_array_search($cateVal, $applyCategoryGroupArr) !== false) {//카테고리 존재
$matchCateData++;
} else {//카테고리 존재안함
$couponListData[$key]['chkMemberCoupon'] = 'YES';
}
}
if ($matchCateData > 0) {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {// 상품의 적용된 카테고리와 쿠폰 허용 카테고리 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'brand') {//브랜드 발급
$applyBrandGroupArr = explode(INT_DIVISION, $val['couponApplyBrand']);
if (gd_array_search($goodsData['brandCd'], $applyBrandGroupArr) !== false) {//브랜드 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//브랜드 존재안함
$removeKey[] = $key;
continue;
}
} else if ($val['couponApplyProductType'] == 'goods') {//상품 발급
$applyGoodsGroupArr = explode(INT_DIVISION, $val['couponApplyGoods']);
if (gd_array_search($goodsNo, $applyGoodsGroupArr) !== false) {//상품 존재
$couponListData[$key]['chkMemberCoupon'] = 'YES';
} else {//상품 존재안함
$removeKey[] = $key;
continue;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}
}
if ($memNo) {
}
unset($removeKey);
 
foreach ($couponListData as $key => $couponRow) {
if (isset($couponRow['couponNm'])) {
$couponListData[$key]['couponNm'] = gd_htmlspecialchars($couponRow['couponNm']);
}
}
 
return $couponListData;
}
 
}
}
// 쿠폰 사용 회원등급
$useMemberGroupBind = [];
$this->db->bind_param_push($useMemberGroupBind, 'i', $couponData['couponNo']);
$data = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = ? ORDER BY couponUseMemberGroup", $useMemberGroupBind);
if ($data) {
foreach ($data as $key => $val) {
$groupNm = GroupUtil::getGroupName('sno=' . $val['couponUseMemberGroup']);
}
} else {
// 쿠폰 사용 회원등급
$useMemberGroupBind = [];
$this->db->bind_param_push($useMemberGroupBind, 'i', $couponVal['couponNo']);
$data = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = ? ORDER BY couponUseMemberGroup", $useMemberGroupBind);
if ($data) {
unset($couponArrData[$couponKey]['couponApplyMemberGroup']);
foreach ($data as $key => $val) {
unset($this->arrBind);
unset($this->arrWhere);
 
$memberCouponData['data'] = gd_htmlspecialchars(gd_isset($data));
$memberCouponData['sort'] = $sort;
$memberCouponData['search'] = gd_htmlspecialchars($this->search);
$memberCouponData['selected'] = $this->selected;
unset($this->arrBind);
unset($this->arrWhere);
 
$memberCouponData['data'] = gd_htmlspecialchars(gd_isset($data));
 
return $memberCouponData;
}
} else if ($val['couponSaveType'] == 'manual') {
$convertCouponArrData[$key]['couponSaveType'] = '수동발급';
}
// 배지 유형 판별용 원값 보존(아래 한글 라벨 변환 전)
$convertCouponArrData[$key]['couponUseTypeCode'] = $val['couponUseType'];
if ($val['couponUseType'] == 'product') {
$convertCouponArrData[$key]['couponUseType'] = '상품적용쿠폰';
} else if ($val['couponUseType'] == 'order') {
unset($arrBind);
}
 
/**
* 회원 다운로드 발급 거부 감사로그 (실패 시도만 기록 / 성공 발급은 es_memberCoupon 적재)
*
* @param mixed $couponNo 쿠폰고유번호(단건 또는 배열)
* @param int $memNo 회원고유번호
* @param string $reason 거부 사유
*/
protected function logCouponDownFail($couponNo, $memNo, $reason)
{
\App::getInstance('logger')->channel('coupon')->warning('쿠폰 발급 실패', array_merge(
$this->couponDownLogContext($couponNo, $memNo),
['reason' => $reason]
));
}
 
/**
* 회원 다운로드 발급 성공 감사로그
*
* @param mixed $couponNo 쿠폰고유번호(단건 또는 배열)
* @param integer $memNo 회원고유번호
*/
protected function logCouponDownSuccess($couponNo, $memNo)
{
\App::getInstance('logger')->channel('coupon')->info('쿠폰 발급 성공', $this->couponDownLogContext($couponNo, $memNo));
}
 
/**
* 발급 감사로그 공통 컨텍스트(행위자·쿠폰번호·접속지 정보)
*
* @param mixed $couponNo
* @param integer $memNo
* @return array
*/
protected function couponDownLogContext($couponNo, $memNo)
{
$request = \App::getInstance('request');
return [
'couponNo' => $couponNo,
'memNo' => $memNo,
'ip' => $request->getRemoteAddress(),
'userAgent' => $request->getUserAgent(),
'uri' => $request->getRequestUri(),
];
}
 
/**
* 상품에 적용된 회원다운로드 쿠폰을 발급 받기
*
public function setGoodsCouponMemberSave($couponNo, $goodsNo, $memNo, $memGroupNo, $scmNo = null, $brandCd = null)
{
$checkCoupon = false;
$this->setCouponUseTypes(['product', 'order']);
$goodsMemberCouponArrData = $this->getGoodsCouponDownList($goodsNo, $memNo, $memGroupNo, null, null, $scmNo, $brandCd);
$this->setCouponUseTypes(['product']);
$couponUseTypeMap = [];
foreach ($goodsMemberCouponArrData as $val) {
$couponUseTypeMap[$val['couponNo']] = $val['couponUseType'];
if ($val['chkMemberCoupon'] == 'YES') {
$couponNoData[] = $val['couponNo'];
}
}
 
if (is_array($couponNo)) {
// 동일 쿠폰번호 중복 삽입을 1건으로 축약
$couponNo = array_values(array_unique($couponNo));
if (count($couponNo) > self::COUPON_DOWN_ALL_MAX) {
$this->logCouponDownFail($couponNo, $memNo, self::COUPON_DOWN_ALL_EXCEED_MESSAGE);
throw new \Exception(self::COUPON_DOWN_ALL_EXCEED_MESSAGE);
}
foreach ($couponNo as $val) {
$checkCoupon = gd_in_array($val, $couponNoData);
 
if ($checkCoupon == true) {
$redisKey = sprintf(self::MEMBER_SAVE_LOCK_KEY_PREFIX . '%s_%s', $val, $memNo);
try {
SimpleCache::init(SimpleCache::REDIS)->executeWithLock($redisKey, 'coupon', function () use ($val, $memNo, $memGroupNo, $goodsNo, $couponUseTypeMap) {
$this->checkRapidReissueRequest($val, $memNo);
// 중복 발급 방지 재확인
$this->getCouponLinkDownUsable($val, $memNo, $memGroupNo);
$arrData = [];
$arrData['couponNo'] = $val;
$couponUseType = $couponUseTypeMap[$val] ?? 'product';
$arrData['couponSaveAdminId'] = $goodsNo . ($couponUseType === 'order' ? '의 주문쿠폰' : '의 상품쿠폰');
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($val);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($val);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$couponDao = \App::load('\\Component\\Coupon\\CouponDAO');
$couponDao->insertMemberCoupon($arrData);
$this->checkCouponType($arrData['couponNo']); // 발급 수 증가로 발급종료 상태로 변경 될 수 있어 실행
});
$this->logCouponDownSuccess($val, $memNo);
} catch (\Exception $e) {
$this->logCouponDownFail($val, $memNo, $e->getMessage());
throw $e;
}
} else {
$this->logCouponDownFail($val, $memNo, '발급 조건이 맞지 않는 쿠폰이있습니다. 쿠폰다운창을 다시 열고 받아주세요.');
throw new \Exception('발급 조건이 맞지 않는 쿠폰이있습니다. 쿠폰다운창을 다시 열고 받아주세요.');
}
}
$checkCoupon = gd_in_array($couponNo, $couponNoData);
 
if ($checkCoupon == true) {
$couponUseType = $couponUseTypeMap[$couponNo] ?? 'product';
$saveMemNo = Session::get('member.memNo');
$redisKey = sprintf(self::MEMBER_SAVE_LOCK_KEY_PREFIX . '%s_%s', $couponNo, $saveMemNo);
try {
SimpleCache::init(SimpleCache::REDIS)->executeWithLock($redisKey, 'coupon', function () use ($couponNo, $saveMemNo, $memGroupNo, $goodsNo, $couponUseType) {
$this->checkRapidReissueRequest($couponNo, $saveMemNo);
$this->getCouponLinkDownUsable($couponNo, $saveMemNo, $memGroupNo);
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = $goodsNo . ($couponUseType === 'order' ? '의 주문쿠폰' : '의 상품쿠폰');
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $saveMemNo;
$couponDao = \App::load('\\Component\\Coupon\\CouponDAO');
$couponDao->insertMemberCoupon($arrData);
$this->checkCouponType($arrData['couponNo']); // 발급 수 증가로 발급종료 상태로 변경 될 수 있어 실행
});
$this->logCouponDownSuccess($couponNo, $saveMemNo);
} catch (\Exception $e) {
$this->logCouponDownFail($couponNo, $saveMemNo, $e->getMessage());
throw $e;
}
} else {
$this->logCouponDownFail($couponNo, $saveMemNo, '발급 조건이 맞지 않습니다.');
throw new \Exception('발급 조건이 맞지 않습니다.');
}
}
}
}
 
/**
* 같은 회원·쿠폰의 짧은 시간 내 반복 발급 요청 차단
*
* @param int $couponNo 쿠폰고유번호
* @param int $memNo 회원고유번호
*
* @throws \Exception 기준 시간 안에 허용 횟수를 초과한 반복 요청일 때
*/
protected function checkRapidReissueRequest($couponNo, $memNo)
{
$cache = SimpleCache::init(SimpleCache::REDIS);
$countKey = self::ISSUE_COUNT_CACHE_KEY_PREFIX . $couponNo . '_' . $memNo;
$count = (int) $cache->get($countKey, fn() => 0);
if ($count >= self::ISSUE_RATE_LIMIT_MAX_COUNT) {
throw new \Exception('잠시 후 다시 시도해주십시오.');
}
$cache->set($countKey, $count + 1, self::ISSUE_RATE_LIMIT_WINDOW_SECONDS);
}
 
/**
* 회원다운로드 쿠폰의 링크클릭으로 쿠폰 발급
*
*/
public function setCouponLinkDown($couponNo, $memNo, $memGroupNo)
{
$redisKey = sprintf(self::MEMBER_SAVE_LOCK_KEY_PREFIX . '%s_%s', $couponNo, $memNo);
try {
SimpleCache::init(SimpleCache::REDIS)->executeWithLock($redisKey, 'coupon', function () use ($couponNo, $memNo, $memGroupNo) {
$this->checkRapidReissueRequest($couponNo, $memNo);
$couponLinkDownData = $this->getCouponLinkDownUsable($couponNo, $memNo, $memGroupNo);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = '회원다운로드쿠폰 링크 다운';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$couponDao = \App::load('\\Component\\Coupon\\CouponDAO');
$couponDao->insertMemberCoupon($arrData);
$this->checkCouponType($arrData['couponNo']); // 발급 수 증가로 발급종료 상태로 변경 될 수 있어 실행
unset($arrData);
} else {
throw new \Exception($couponLinkDownData ?: '발급 조건이 맞지 않습니다.');
}
});
$this->logCouponDownSuccess($couponNo, $memNo);
} catch (\Exception $e) {
$this->logCouponDownFail($couponNo, $memNo, $e->getMessage());
throw $e;
}
}
 
return gd_htmlspecialchars_stripslashes($getData);
}
 
/**
* 쿠폰 사용 유형 설정
*
* @param array $types 쿠폰 사용 유형 배열 (ex: ['product'], ['product', 'order'])
*/
public function setCouponUseTypes(array $types)
{
$this->couponUseTypes = $types;
}
 
/**
* 상품의 해당 쿠폰 리스트용 전체 쿠폰 리스트 추출
*
// 발급여부 쿠폰(발급중)
$arrWhere[] = 'c.couponType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponType'], 'y');
// 쿠폰 적용 대상 유형(product=상품, order=주문 등)
$arrPlaceHolder = implode(',', array_fill(0, count($this->couponUseTypes), '?'));
$arrWhere[] = 'c.couponUseType IN (' . $arrPlaceHolder . ')';
foreach ($this->couponUseTypes as $couponUseType) {
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponUseType'], $couponUseType);
}
// 회원다운로드 쿠폰
$arrWhere[] = 'c.couponSaveType=?';
$this->db->bind_param_push($arrBind, $this->fieldTypes['coupon']['couponSaveType'], 'down');
// 쿠폰 노출 기간
$arrWhere[] = ' ( couponDisplayType = \'n\' OR ( couponDisplayType = \'y\' AND couponDisplayStartDate < now() AND couponDisplayEndDate > now()) )';
// 쿠폰 사용 기간 만료 체크
$arrWhere[] = ' ((couponUsePeriodType = \'period\' and couponUsePeriodEndDate <> \'0000-00-00 00:00:00\' and couponUsePeriodEndDate > now()) OR (couponUsePeriodType = \'day\' and (couponUseDateLimit is null or couponUseDateLimit = \'0000-00-00 00:00:00\' or couponUseDateLimit > now())))';
 
$this->db->strLimit = 20;
if($couponConfig['couponzoneSort'] != 'custom') $this->db->strOrder = $couponConfig['couponzoneSort'];
}
}
 
foreach ($list as $key => $zoneData) {
foreach ($zoneData['list'] as $cKey => $couponRow) {
if (isset($couponRow['couponNm'])) {
$list[$key]['list'][$cKey]['couponNm'] = gd_htmlspecialchars($couponRow['couponNm']);
}
}
}
 
return $list;
}
/**
}
 
if (is_array($couponNo)) {
// 동일 쿠폰번호 중복 삽입을 1건으로 축약
$couponNo = array_values(array_unique($couponNo));
if (count($couponNo) > self::COUPON_DOWN_ALL_MAX) {
$this->logCouponDownFail($couponNo, $memNo, self::COUPON_DOWN_ALL_EXCEED_MESSAGE);
throw new \Exception(self::COUPON_DOWN_ALL_EXCEED_MESSAGE);
}
$success = 0;
foreach ($couponNo as $val) {
$redisKey = sprintf(self::MEMBER_SAVE_LOCK_KEY_PREFIX . '%s_%s', $val, $memNo);
// 실패 항목은 건너뜀
try {
SimpleCache::init(SimpleCache::REDIS)->executeWithLock($redisKey, 'coupon', function () use ($val, $memNo, $memGroupNo, $barcodeDisplayFl, &$barcodeCoupon, &$success) {
$this->checkRapidReissueRequest($val, $memNo);
$couponLinkDownData = $this->getCouponLinkDownUsable($val, $memNo, $memGroupNo, true);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $val;
$arrData['couponSaveAdminId'] = '쿠폰존';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($val);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($val);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$couponDao = \App::load('\\Component\\Coupon\\CouponDAO');
$couponDao->insertMemberCoupon($arrData);
$this->checkCouponType($arrData['couponNo']); // 발급 수 증가로 발급종료 상태로 변경 될 수 있어 실행
 
if ($barcodeDisplayFl === 'y') {
//바코드 발급
$memCouponNo = $this->db->insert_id();
$barcodeResult = $barcodeCoupon->setCouponNo([$arrData['couponNo']])->setMemberCouponNo($memCouponNo)->couponBarcodeGenarator('give');
}
 
unset($arrData);
$success++;
$this->logCouponDownSuccess($val, $memNo);
}
});
} catch (\Exception $e) {
$this->logCouponDownFail($val, $memNo, $e->getMessage());
continue;
}
}
$return['return'] = true;
$return['success'] = $success;
return $return;
} else {
$redisKey = sprintf(self::MEMBER_SAVE_LOCK_KEY_PREFIX . '%s_%s', $couponNo, $memNo);
try {
return SimpleCache::init(SimpleCache::REDIS)->executeWithLock($redisKey, 'coupon', function () use ($couponNo, $memNo, $memGroupNo, $barcodeDisplayFl, &$barcodeCoupon) {
$this->checkRapidReissueRequest($couponNo, $memNo);
$couponLinkDownData = $this->getCouponLinkDownUsable($couponNo, $memNo, $memGroupNo);
if ($couponLinkDownData) {
$arrData = [];
$arrData['couponNo'] = $couponNo;
$arrData['couponSaveAdminId'] = '쿠폰존';
$arrData['memberCouponStartDate'] = $this->getMemberCouponStartDate($couponNo);
$arrData['memberCouponEndDate'] = $this->getMemberCouponEndDate($couponNo);
$arrData['memberCouponState'] = 'y';
$arrData['memNo'] = $memNo;
$couponDao = \App::load('\\Component\\Coupon\\CouponDAO');
$couponDao->insertMemberCoupon($arrData);
$this->checkCouponType($arrData['couponNo']); // 발급 수 증가로 발급종료 상태로 변경 될 수 있어 실행
 
if ($barcodeDisplayFl === 'y') {
//바코드 발급
$memCouponNo = $this->db->insert_id();
$barcodeResult = $barcodeCoupon->setCouponNo([$arrData['couponNo']])->setMemberCouponNo($memCouponNo)->couponBarcodeGenarator('give');
}
 
unset($arrData);
$return['return'] = true;
$return['success'] = 1;
$this->logCouponDownSuccess($couponNo, $memNo);
return $return;
} else {
throw new \Exception($couponLinkDownData ?: '발급 조건이 맞지 않습니다.');
}
});
} catch (\Exception $e) {
$this->logCouponDownFail($couponNo, $memNo, $e->getMessage());
throw $e;
}
}
}
public function getCouponUseMemberGroup($couponNo)
{
if ($couponNo) {
$useMemberGroupBind = [];
$this->db->bind_param_push($useMemberGroupBind, 'i', $couponNo);
$memberGroup = $this->db->query_fetch("SELECT couponUseMemberGroup FROM " . DB_COUPON_USE_MEMBER_GROUP . " WHERE couponNo = ?", $useMemberGroupBind);
if ($memberGroup) {
$resultMemberGroup = array();
foreach ($memberGroup as $val) {
 
Component/Goods/Goods.php+12-1
변경 전Goods.php
// 쿠폰 할인 금액
if ($couponConfig['couponUseType'] == 'y' && $couponPriceYN && $getData['goodsPrice'] > 0 && empty($getData['goodsPriceString']) === true) {
// 해당 상품의 모든 쿠폰
 
 
 
 
$couponArrData = $this->coupon->getGoodsCouponDownList($getData['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'), null, null, $getData['scmNo'], $getData['brandCd']);
 
 
 
 
// 상품의 해당 쿠폰 리스트 저장 (2022.06 상품리스트 및 상세 성능개선)
if (gd_count($couponArrData) > 0) {
$this->coupon->setGoodsCouponDownInfo($couponArrData);
}
 
 
 
 
 
// 해당 상품의 쿠폰가
$getData['couponDcPrice'] = $couponSalePrice = $this->coupon->getGoodsCouponDisplaySalePrice($couponArrData, $getData['goodsPrice']);
if ($couponSalePrice) {
$getData['couponPrice'] = $getData['goodsPrice'] - $couponSalePrice;
$getData['couponSalePrice'] = $couponSalePrice;
 
변경 후Goods.php
// 쿠폰 할인 금액
if ($couponConfig['couponUseType'] == 'y' && $couponPriceYN && $getData['goodsPrice'] > 0 && empty($getData['goodsPriceString']) === true) {
// 해당 상품의 모든 쿠폰
$supportsCouponUseTypeFilter = method_exists($this->coupon, 'setCouponUseTypes');
if ($supportsCouponUseTypeFilter) {
$this->coupon->setCouponUseTypes(['product', 'order']);
}
$couponArrData = $this->coupon->getGoodsCouponDownList($getData['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'), null, null, $getData['scmNo'], $getData['brandCd']);
if ($supportsCouponUseTypeFilter) {
$this->coupon->setCouponUseTypes(['product']);
}
 
// 상품의 해당 쿠폰 리스트 저장 (2022.06 상품리스트 및 상세 성능개선)
if (gd_count($couponArrData) > 0) {
$this->coupon->setGoodsCouponDownInfo($couponArrData);
}
 
$goodsCouponArrData = array_filter($couponArrData ?: [], function ($downCoupon) {
return ($downCoupon['couponUseType'] ?? 'product') !== 'order';
});
 
// 해당 상품의 쿠폰가
$getData['couponDcPrice'] = $couponSalePrice = $this->coupon->getGoodsCouponDisplaySalePrice($goodsCouponArrData, $getData['goodsPrice']);
if ($couponSalePrice) {
$getData['couponPrice'] = $getData['goodsPrice'] - $couponSalePrice;
$getData['couponSalePrice'] = $couponSalePrice;
 
Component/Worker/NaverDbUrl3.php+28
변경 전NaverDbUrl3.php
/** @var null|\Bundle\Component\Goods\DefineGoods */
private $_defineGoods = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/**
* init
*
 
변경 후NaverDbUrl3.php
/** @var null|\Bundle\Component\Goods\DefineGoods */
private $_defineGoods = null;
 
/**
* 사용가능한 네이버 EP 쿠폰 목록 조회
*
* 네이버 EP에서 사용 가능한 상품·주문 다운로드 쿠폰을 조회
* PC·모바일 각각의 쿠폰 목록을 별도 조회하여 저장
*
* @override
*/
protected function loadCoupon()
{
$where[] = "couponMinOrderPrice = 0 ";
$where[] = "couponAmountType = 'n' ";
$where[] = "(couponApplyMemberGroup = '' or couponApplyMemberGroup is null) ";
 
$canSetCouponUseTypes = method_exists($this->componentCoupon, 'setCouponUseTypes');
// 네이버 EP는 상품·주문 다운로드 쿠폰을 조회 대상에 포함
if ($canSetCouponUseTypes) {
$this->componentCoupon->setCouponUseTypes(['product', 'order']);
}
$this->couponForEpPcList = $this->componentCoupon->getGoodsCouponDownListAll($where, "pc");
$this->couponForEpMobileList = $this->componentCoupon->getGoodsCouponDownListAll($where, "mobile");
 
if ($canSetCouponUseTypes) {
$this->componentCoupon->setCouponUseTypes(['product']);
}
unset($where);
}
 
/**
* init
*
 
Controller/Admin/Promotion/CouponListController.php+2
변경 전CouponListController.php
 
use Exception;
use Framework\Debug\Exception\LayerException;
 
use Request;
 
class CouponListController extends \Controller\Admin\Controller
$this->setData('searchKindASelectBox', \Component\Member\Member::getSearchKindASelectBox());
$this->setData('checked', $getData['checked']);
$this->setData('page', $page);
 
}
}
 
변경 후CouponListController.php
 
use Exception;
use Framework\Debug\Exception\LayerException;
use Framework\Security\Token;
use Request;
 
class CouponListController extends \Controller\Admin\Controller
$this->setData('searchKindASelectBox', \Component\Member\Member::getSearchKindASelectBox());
$this->setData('checked', $getData['checked']);
$this->setData('page', $page);
$this->setData('couponListToken', Token::generate('couponListToken'));
}
}
 
Controller/Admin/Promotion/CouponManageController.php+2
변경 전CouponManageController.php
use Component\Database\DBTableField;
use Exception;
use Framework\Debug\Exception\LayerException;
 
use Request;
 
class CouponManageController extends \Controller\Admin\Controller
$this->setData('search', gd_isset($getMemberData['search']));
$this->setData('searchKindASelectBox', \Component\Member\Member::getSearchKindASelectBox());
$this->setData('page', $page);
 
}
}
 
변경 후CouponManageController.php
use Component\Database\DBTableField;
use Exception;
use Framework\Debug\Exception\LayerException;
use Framework\Security\Token;
use Request;
 
class CouponManageController extends \Controller\Admin\Controller
$this->setData('search', gd_isset($getMemberData['search']));
$this->setData('searchKindASelectBox', \Component\Member\Member::getSearchKindASelectBox());
$this->setData('page', $page);
$this->setData('couponManageToken', Token::generate('couponManageToken'));
}
}
 
Controller/Admin/Promotion/CouponPsController.php+45-5
변경 전CouponPsController.php
use Component\Coupon\CouponAdmin;
use Component\Sms\SmsSender;
use Framework\Debug\Exception\LayerNotReloadException;
 
use Message;
use Origin\Service\Sms\OccupancyAuth\SendGateService;
use Request;
$postValue = Request::post()->toArray();
$filesValue = Request::files()->toArray();
if (Request::post()->get('couponKind') == 'online') {
 
 
 
 
$couponAdmin->saveCoupon($postValue, $filesValue);
$this->layer(__('저장이 완료되었습니다.'), 'parent.unload_callback("' . $postValue['couponEventType'] . '");top.location.href="coupon_list.php?page=' . $ypage . '";');
} else if (Request::post()->get('couponKind') == 'offline') {
}
break;
case 'modifyCouponList':
 
 
 
 
 
 
case 'modifyCouponOfflineList':
$couponAdmin->changeCouponType();
break;
case 'deleteCouponList':
 
 
 
 
 
 
 
case 'deleteCouponOfflineList':
$couponAdmin->deleteCoupon();
if (Request::post()->get('mode') == 'deleteCouponList') {
$this->layer(__('삭제 되었습니다.'), 'top.location.reload()');
} else if (Request::post()->get('mode') == 'deleteCouponOfflineList') {
$this->layer(__('삭제 되었습니다.'), 'top.location.href="coupon_offline_list.php";');
}
break;
case 'deleteCouponManage':
 
 
 
 
 
 
 
case 'deleteCouponOfflineManage':
$couponAdmin->deleteMemberCoupon();
$this->layer(__('삭제 되었습니다.'), 'top.location.reload()');
throw new LayerNotReloadException($e->getMessage()); //새로고침안됨
}
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}
 
변경 후CouponPsController.php
use Component\Coupon\CouponAdmin;
use Component\Sms\SmsSender;
use Framework\Debug\Exception\LayerNotReloadException;
use Framework\Security\Token;
use Message;
use Origin\Service\Sms\OccupancyAuth\SendGateService;
use Request;
$postValue = Request::post()->toArray();
$filesValue = Request::files()->toArray();
if (Request::post()->get('couponKind') == 'online') {
// CSRF 토큰 판별 - 미전송·위조 시 로그 수집
$couponRegistToken = Request::post()->get('couponRegistToken');
Token::check('couponRegistToken', ['couponRegistToken' => $couponRegistToken], false, null, true);
$this->validateRequestOrigin();
$couponAdmin->saveCoupon($postValue, $filesValue);
$this->layer(__('저장이 완료되었습니다.'), 'parent.unload_callback("' . $postValue['couponEventType'] . '");top.location.href="coupon_list.php?page=' . $ypage . '";');
} else if (Request::post()->get('couponKind') == 'offline') {
}
break;
case 'modifyCouponList':
// CSRF 토큰 판별 - 미전송·위조 시 로그 수집
$couponListToken = Request::post()->get('couponListToken');
Token::check('couponListToken', ['couponListToken' => $couponListToken], false, null, true);
$this->validateRequestOrigin();
$couponAdmin->changeCouponType();
break;
case 'modifyCouponOfflineList':
$couponAdmin->changeCouponType();
break;
case 'deleteCouponList':
// CSRF 토큰 판별 - 미전송·위조 시 로그 수집
$couponListToken = Request::post()->get('couponListToken');
Token::check('couponListToken', ['couponListToken' => $couponListToken], false, null, true);
$this->validateRequestOrigin();
$couponAdmin->deleteCoupon();
$this->layer(__('삭제 되었습니다.'), 'top.location.reload()');
break;
case 'deleteCouponOfflineList':
$couponAdmin->deleteCoupon();
$this->layer(__('삭제 되었습니다.'), 'top.location.href="coupon_offline_list.php";');
 
 
 
 
break;
case 'deleteCouponManage':
// CSRF 토큰 판별 - 미전송·위조 시 로그 수집
$couponManageToken = Request::post()->get('couponManageToken');
Token::check('couponManageToken', ['couponManageToken' => $couponManageToken], false, null, true);
$this->validateRequestOrigin();
$couponAdmin->deleteMemberCoupon();
$this->layer(__('삭제 되었습니다.'), 'top.location.reload()');
break;
case 'deleteCouponOfflineManage':
$couponAdmin->deleteMemberCoupon();
$this->layer(__('삭제 되었습니다.'), 'top.location.reload()');
throw new LayerNotReloadException($e->getMessage()); //새로고침안됨
}
}
 
/**
* @return void
* @throws LayerNotReloadException
*/
protected function validateRequestOrigin()
{
$httpOrigin = Request::server()->get('HTTP_ORIGIN');
if (empty($httpOrigin)) {
return;
}
 
$originHost = strtolower((string) parse_url($httpOrigin, PHP_URL_HOST));
$allowedHosts = [strtolower((string) Request::getHostNoPort()), strtolower((string) Request::getServerName())];
if (empty($originHost) || !in_array($originHost, $allowedHosts, true)) {
\App::getInstance('logger')->channel('coupon')->warning('허용되지 않은 요청 도메인', ['origin' => $httpOrigin, 'host' => $allowedHosts[0]]);
throw new LayerNotReloadException(__('허용되지 않은 도메인에서의 접근입니다.'));
}
}
}
 
Controller/Admin/Promotion/CouponRegistController.php+4
변경 전CouponRegistController.php
use Component\Database\DBTableField;
use Exception;
use Framework\Debug\Exception\LayerException;
 
use Request;
 
class CouponRegistController extends \Controller\Admin\Controller
'promotion/gd_promotion_common.js',
]);
$this->setData('couponData', gd_isset($couponData));
 
 
 
$this->setData('checked', gd_isset($checked));
$this->setData('selected', gd_isset($selected));
$this->setData('ypage', gd_isset($ypage,1));
 
변경 후CouponRegistController.php
use Component\Database\DBTableField;
use Exception;
use Framework\Debug\Exception\LayerException;
use Framework\Security\Token;
use Request;
 
class CouponRegistController extends \Controller\Admin\Controller
'promotion/gd_promotion_common.js',
]);
$this->setData('couponData', gd_isset($couponData));
if (isset($couponData['couponKind']) && $couponData['couponKind'] == 'online') {
$this->setData('couponRegistToken', Token::generate('couponRegistToken'));
}
$this->setData('checked', gd_isset($checked));
$this->setData('selected', gd_isset($selected));
$this->setData('ypage', gd_isset($ypage,1));
 
Controller/Front/Event/CouponzoneController.php+12
변경 전CouponzoneController.php
use Framework\Debug\Exception\AlertRedirectException;
use Component\Coupon\Coupon;
use Framework\ObjectStorage\Service\ImageUploadService;
 
 
/**
* Class AttendStampController
*/
class CouponzoneController extends \Controller\Front\Controller
{
 
 
 
/**
* @inheritdoc
*/
$couponList = $coupon->getCouponzoneList();
 
$this->setData('couponList', $couponList);
 
 
 
if($couponConfig['couponImageType'] == 'basic') {
$couponConfig['pcCouponImagePath'] = PATH_ADMIN_GD_SHARE . 'img/defaultCouponzonePc.png';
}
$couponConfig['pcContents'] = gd_htmlspecialchars_decode($couponConfig['pcContents']);
$couponConfig['pcContents'] = str_replace('<p>&nbsp;</p>', '', $couponConfig['pcContents']);
 
 
 
 
// 웹취약점 개선사항 상단영역 에디터 업로드 이미지 alt 추가
if ($couponConfig['pcContents']) {
} else {
$couponConfig['mobileContents'] = gd_htmlspecialchars_decode($couponConfig['mobileContents']);
$couponConfig['mobileContents'] = str_replace('<p>&nbsp;</p>', '', $couponConfig['mobileContents']);
 
 
 
}
 
$this->setData('couponConfig', $couponConfig);
 
변경 후CouponzoneController.php
use Framework\Debug\Exception\AlertRedirectException;
use Component\Coupon\Coupon;
use Framework\ObjectStorage\Service\ImageUploadService;
use Framework\Security\Token;
 
/**
* Class AttendStampController
*/
class CouponzoneController extends \Controller\Front\Controller
{
// 에디터를 비워 저장하면 남는 값
protected const EMPTY_EDITOR_CONTENTS = '<p><br></p>';
 
/**
* @inheritdoc
*/
$couponList = $coupon->getCouponzoneList();
 
$this->setData('couponList', $couponList);
// 발급 검증용 쿠폰 전용 토큰
$this->setData('couponToken', Token::generate('couponToken'));
 
if($couponConfig['couponImageType'] == 'basic') {
$couponConfig['pcCouponImagePath'] = PATH_ADMIN_GD_SHARE . 'img/defaultCouponzonePc.png';
}
$couponConfig['pcContents'] = gd_htmlspecialchars_decode($couponConfig['pcContents']);
$couponConfig['pcContents'] = str_replace('<p>&nbsp;</p>', '', $couponConfig['pcContents']);
$couponConfig['pcContents'] = trim(str_replace(self::EMPTY_EDITOR_CONTENTS, '', $couponConfig['pcContents'])) === ''
? ''
: $couponConfig['pcContents'];
 
// 웹취약점 개선사항 상단영역 에디터 업로드 이미지 alt 추가
if ($couponConfig['pcContents']) {
} else {
$couponConfig['mobileContents'] = gd_htmlspecialchars_decode($couponConfig['mobileContents']);
$couponConfig['mobileContents'] = str_replace('<p>&nbsp;</p>', '', $couponConfig['mobileContents']);
$couponConfig['mobileContents'] = trim(str_replace(self::EMPTY_EDITOR_CONTENTS, '', $couponConfig['mobileContents'])) === ''
? ''
: $couponConfig['mobileContents'];
}
 
$this->setData('couponConfig', $couponConfig);
 
Controller/Front/Goods/LayerCouponDownController.php+21-6
변경 전LayerCouponDownController.php
use App;
use Framework\Debug\Exception\WarningException;
 
use Session;
use Request;
use Exception;
$coupon = App::load(\Component\Coupon\Coupon::class);
$post = Request::post()->toArray();
// 상품의 쿠폰리스트
$goodsCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'],Session::get('member.memNo'),Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
// 해당 상품의 모든 쿠폰을 보기용으로 변환
$convertCouponArrData = $coupon->convertCouponArrData($goodsCouponArrData);
// 상품의 다운받을 수 있는 쿠폰의 개수
$goodsCouponCnt = $coupon->getGoodsCouponDownListCount($goodsCouponArrData);
 
 
 
 
 
 
 
 
 
 
$this->setData('goodsCouponArrData', $goodsCouponArrData);
 
$this->setData('convertCouponArrData', $convertCouponArrData);
$this->setData('goodsNo', $post['goodsNo']);
$this->setData('scmNo', $post['scmNo']);
$this->setData('brandCd', $post['brandCd']);
 
$this->setData('goodsCouponCnt', $goodsCouponCnt);
 
 
} else {
$this->json([
'error' => 10,
 
변경 후LayerCouponDownController.php
use App;
use Framework\Debug\Exception\WarningException;
use Framework\Security\Token;
use Session;
use Request;
use Exception;
$coupon = App::load(\Component\Coupon\Coupon::class);
$post = Request::post()->toArray();
$supportsCouponUseTypeFilter = method_exists($coupon, 'setCouponUseTypes');
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product', 'order']);
}
$downCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'],Session::get('member.memNo'),Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product']);
}
$convertCouponArrData = $coupon->convertCouponArrData($downCouponArrData);
$orderCouponArrData = array_filter($downCouponArrData, function ($downCoupon) {
return ($downCoupon['couponUseType'] ?? '') === 'order';
});
$goodsCouponArrData = array_filter($downCouponArrData, function ($downCoupon) {
return ($downCoupon['couponUseType'] ?? '') === 'product';
});
$this->setData('goodsCouponArrData', $goodsCouponArrData);
$this->setData('orderCouponArrData', $orderCouponArrData);
$this->setData('convertCouponArrData', $convertCouponArrData);
$this->setData('goodsNo', $post['goodsNo']);
$this->setData('scmNo', $post['scmNo']);
$this->setData('brandCd', $post['brandCd']);
$goodsCouponCnt = empty($downCouponArrData) ? 0 : $coupon->getGoodsCouponDownListCount($downCouponArrData);
$this->setData('goodsCouponCnt', $goodsCouponCnt);
// 발급 검증용 쿠폰 전용 토큰
$this->setData('couponToken', Token::generate('couponToken'));
} else {
$this->json([
'error' => 10,
 
Controller/Front/Goods/LayerCouponPsController.php+16-1
변경 전LayerCouponPsController.php
use App;
use Framework\Debug\Exception\WarningException;
 
use Session;
use Request;
use Exception;
// 쿠폰 다운
case 'coupon_down':
case 'coupon_down_all':
 
 
 
 
 
 
// --- 쿠폰 class
$coupon = \App::load('\\Component\\Coupon\\Coupon');
$coupon->setGoodsCouponMemberSave(Request::post()->get('couponNo'), Request::post()->get('goodsNo'),Session::get('member.memNo'),Session::get('member.groupSno'), $post['scmNo'], $post['brandCd']);
// 상품의 다운받을 수 있는 쿠폰의 개수
$goodsCouponCnt = $coupon->getGoodsCouponDownListCount(null, $post['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'));
 
 
 
 
 
 
 
 
$this->json([
'code' => 200,
 
변경 후LayerCouponPsController.php
use App;
use Framework\Debug\Exception\WarningException;
use Framework\Security\Token;
use Session;
use Request;
use Exception;
// 쿠폰 다운
case 'coupon_down':
case 'coupon_down_all':
if (Request::getMethod() !== 'POST') {
throw new Exception(__('잘못된 요청입니다.'));
}
// 쿠폰 전용 토큰 판별 - 미전송·위조 시 로그 수집
$couponToken = Request::post()->get('couponToken');
Token::check('couponToken', ['couponToken' => $couponToken], false, null, true);
// --- 쿠폰 class
$coupon = \App::load('\\Component\\Coupon\\Coupon');
$coupon->setGoodsCouponMemberSave(Request::post()->get('couponNo'), Request::post()->get('goodsNo'),Session::get('member.memNo'),Session::get('member.groupSno'), $post['scmNo'], $post['brandCd']);
// 상품의 다운받을 수 있는 쿠폰의 개수
$supportsCouponUseTypeFilter = method_exists($coupon, 'setCouponUseTypes');
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product', 'order']);
}
$downCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product']);
}
$goodsCouponCnt = empty($downCouponArrData) ? 0 : $coupon->getGoodsCouponDownListCount($downCouponArrData);
$this->json([
'code' => 200,
 
Controller/Front/Mypage/CouponPsController.php+7
변경 전CouponPsController.php
use Exception;
use Framework\Debug\Exception\AlertOnlyException;
use Framework\Debug\Exception\AlertReloadException;
 
use App;
use Session;
use Request;
case 'couponDown' :
case 'couponDownAll' :
try {
 
 
 
 
 
 
$result = $coupon->setCouponzoneDown(Request::post()->get('couponNo'), Session::get('member.memNo'), Session::get('member.groupSno'));
 
if ($result['success'] == 0) {
 
변경 후CouponPsController.php
use Exception;
use Framework\Debug\Exception\AlertOnlyException;
use Framework\Debug\Exception\AlertReloadException;
use Framework\Security\Token;
use App;
use Session;
use Request;
case 'couponDown' :
case 'couponDownAll' :
try {
if (Request::getMethod() !== 'POST' || !Request::isAjax()) {
throw new Exception(__('잘못된 요청입니다.'));
}
// 쿠폰 전용 토큰 판별 - 미전송·위조 시 로그 수집
$couponToken = Request::post()->get('couponToken');
Token::check('couponToken', ['couponToken' => $couponToken], false, null, true);
$result = $coupon->setCouponzoneDown(Request::post()->get('couponNo'), Session::get('member.memNo'), Session::get('member.groupSno'));
 
if ($result['success'] == 0) {
 
Controller/Front/Order/LayerCouponApplyOrderController.php+18
변경 전LayerCouponApplyOrderController.php
}
}
 
 
 
 
 
 
 
 
 
$this->setData('memberCouponArrData', $memberCouponArrData);
$this->setData('convertMemberCouponArrData', $convertMemberCouponArrData);
$this->setData('convertMemberCouponPriceArrData', $convertMemberCouponPriceArrData);
}
}
}
 
 
 
 
 
 
 
 
 
$this->setData('goodsCouponArrData', $goodsCouponData['goodsCouponArrData']); // 쿠폰 DB 데이터
$this->setData('convertGoodsCouponArrData', $goodsCouponData['convertGoodsCouponArrData']); // 변환 쿠폰 데이터
$this->setData('convertGoodsCouponPriceArrData', $goodsCouponData['convertGoodsCouponPriceArrData']); // 쿠폰 가격 데이터
 
변경 후LayerCouponApplyOrderController.php
}
}
// 쿠폰명은 원문 저장되어 화면 출력 전 인코딩함
foreach (['order', 'delivery'] as $couponUseType) {
if (is_array($memberCouponArrData[$couponUseType])) {
foreach ($memberCouponArrData[$couponUseType] as &$memberCoupon) {
$memberCoupon['couponNm'] = gd_htmlspecialchars($memberCoupon['couponNm']);
}
unset($memberCoupon);
}
}
$this->setData('memberCouponArrData', $memberCouponArrData);
$this->setData('convertMemberCouponArrData', $convertMemberCouponArrData);
$this->setData('convertMemberCouponPriceArrData', $convertMemberCouponPriceArrData);
}
}
}
if (is_array($goodsCouponData['goodsCouponArrData'])) {
foreach ($goodsCouponData['goodsCouponArrData'] as &$goodsCouponList) {
foreach ($goodsCouponList as &$goodsCoupon) {
$goodsCoupon['couponNm'] = gd_htmlspecialchars($goodsCoupon['couponNm']);
}
unset($goodsCoupon);
}
unset($goodsCouponList);
}
$this->setData('goodsCouponArrData', $goodsCouponData['goodsCouponArrData']); // 쿠폰 DB 데이터
$this->setData('convertGoodsCouponArrData', $goodsCouponData['convertGoodsCouponArrData']); // 변환 쿠폰 데이터
$this->setData('convertGoodsCouponPriceArrData', $goodsCouponData['convertGoodsCouponPriceArrData']); // 쿠폰 가격 데이터
 
Controller/Mobile/Goods/LayerCouponDownController.php+21-6
변경 전LayerCouponDownController.php
use App;
use Framework\Debug\Exception\WarningException;
 
use Session;
use Request;
use Exception;
$coupon = App::load(\Component\Coupon\Coupon::class);
$post = Request::request()->toArray();
// 상품의 쿠폰리스트
$goodsCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'],Session::get('member.memNo'),Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
// 해당 상품의 모든 쿠폰을 보기용으로 변환
$convertCouponArrData = $coupon->convertCouponArrData($goodsCouponArrData);
// 상품의 다운받을 수 있는 쿠폰의 개수
$goodsCouponCnt = $coupon->getGoodsCouponDownListCount($goodsCouponArrData);
 
 
 
 
 
 
 
 
 
 
$this->setData('goodsCouponArrData', $goodsCouponArrData);
 
$this->setData('convertCouponArrData', $convertCouponArrData);
$this->setData('goodsNo', $post['goodsNo']);
$this->setData('scmNo', $post['scmNo']);
$this->setData('brandCd', $post['brandCd']);
 
$this->setData('goodsCouponCnt', $goodsCouponCnt);
 
 
} else {
$this->json([
'error' => 10,
 
변경 후LayerCouponDownController.php
use App;
use Framework\Debug\Exception\WarningException;
use Framework\Security\Token;
use Session;
use Request;
use Exception;
$coupon = App::load(\Component\Coupon\Coupon::class);
$post = Request::request()->toArray();
$supportsCouponUseTypeFilter = method_exists($coupon, 'setCouponUseTypes');
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product', 'order']);
}
$downCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'],Session::get('member.memNo'),Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product']);
}
$convertCouponArrData = $coupon->convertCouponArrData($downCouponArrData);
$orderCouponArrData = array_filter($downCouponArrData, function ($downCoupon) {
return ($downCoupon['couponUseType'] ?? '') === 'order';
});
$goodsCouponArrData = array_filter($downCouponArrData, function ($downCoupon) {
return ($downCoupon['couponUseType'] ?? '') === 'product';
});
$this->setData('goodsCouponArrData', $goodsCouponArrData);
$this->setData('orderCouponArrData', $orderCouponArrData);
$this->setData('convertCouponArrData', $convertCouponArrData);
$this->setData('goodsNo', $post['goodsNo']);
$this->setData('scmNo', $post['scmNo']);
$this->setData('brandCd', $post['brandCd']);
$goodsCouponCnt = empty($downCouponArrData) ? 0 : $coupon->getGoodsCouponDownListCount($downCouponArrData);
$this->setData('goodsCouponCnt', $goodsCouponCnt);
// 발급 검증용 쿠폰 전용 토큰
$this->setData('couponToken', Token::generate('couponToken'));
} else {
$this->json([
'error' => 10,
 
Controller/Mobile/Goods/LayerCouponPsController.php+16-1
변경 전LayerCouponPsController.php
namespace Bundle\Controller\Mobile\Goods;
use App;
 
use Session;
use Request;
use Exception;
// 쿠폰 다운
case 'coupon_down':
case 'coupon_down_all':
 
 
 
 
 
 
// --- 쿠폰 class
$coupon = \App::load('\\Component\\Coupon\\Coupon');
$coupon->setGoodsCouponMemberSave(Request::post()->get('couponNo'), Request::post()->get('goodsNo'),Session::get('member.memNo'),Session::get('member.groupSno'), $post['scmNo'], $post['brandCd']);
// 상품의 다운받을 수 있는 쿠폰의 개수
$goodsCouponCnt = $coupon->getGoodsCouponDownListCount(null, $post['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'));
 
 
 
 
 
 
 
 
$this->json([
'code' => 200,
 
변경 후LayerCouponPsController.php
namespace Bundle\Controller\Mobile\Goods;
use App;
use Framework\Security\Token;
use Session;
use Request;
use Exception;
// 쿠폰 다운
case 'coupon_down':
case 'coupon_down_all':
if (Request::getMethod() !== 'POST') {
throw new Exception(__('잘못된 요청입니다.'));
}
// 쿠폰 전용 토큰 판별 - 미전송·위조 시 로그 수집
$couponToken = Request::post()->get('couponToken');
Token::check('couponToken', ['couponToken' => $couponToken], false, null, true);
// --- 쿠폰 class
$coupon = \App::load('\\Component\\Coupon\\Coupon');
$coupon->setGoodsCouponMemberSave(Request::post()->get('couponNo'), Request::post()->get('goodsNo'),Session::get('member.memNo'),Session::get('member.groupSno'), $post['scmNo'], $post['brandCd']);
// 상품의 다운받을 수 있는 쿠폰의 개수
$supportsCouponUseTypeFilter = method_exists($coupon, 'setCouponUseTypes');
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product', 'order']);
}
$downCouponArrData = $coupon->getGoodsCouponDownList($post['goodsNo'], Session::get('member.memNo'), Session::get('member.groupSno'), null, null, $post['scmNo'], $post['brandCd']);
if ($supportsCouponUseTypeFilter) {
$coupon->setCouponUseTypes(['product']);
}
$goodsCouponCnt = empty($downCouponArrData) ? 0 : $coupon->getGoodsCouponDownListCount($downCouponArrData);
$this->json([
'code' => 200,
 
Controller/Mobile/Mypage/CouponPsController.php+7
변경 전CouponPsController.php
use Exception;
use Framework\Debug\Exception\AlertOnlyException;
use Framework\Debug\Exception\AlertReloadException;
 
use Request;
use Session;
 
case 'couponDown' :
case 'couponDownAll' :
try {
 
 
 
 
 
 
$result = $coupon->setCouponzoneDown(Request::post()->get('couponNo'), Session::get('member.memNo'), Session::get('member.groupSno'));
 
if ($result['success'] == 0) {
 
변경 후CouponPsController.php
use Exception;
use Framework\Debug\Exception\AlertOnlyException;
use Framework\Debug\Exception\AlertReloadException;
use Framework\Security\Token;
use Request;
use Session;
 
case 'couponDown' :
case 'couponDownAll' :
try {
if (Request::getMethod() !== 'POST' || !Request::isAjax()) {
throw new Exception(__('잘못된 요청입니다.'));
}
// 쿠폰 전용 토큰 판별 - 미전송·위조 시 로그 수집
$couponToken = Request::post()->get('couponToken');
Token::check('couponToken', ['couponToken' => $couponToken], false, null, true);
$result = $coupon->setCouponzoneDown(Request::post()->get('couponNo'), Session::get('member.memNo'), Session::get('member.groupSno'));
 
if ($result['success'] == 0) {
 
Controller/Mobile/Order/LayerCouponApplyOrderController.php+18
변경 전LayerCouponApplyOrderController.php
}
}
 
 
 
 
 
 
 
 
 
$this->setData('memberCouponArrData', $memberCouponArrData);
$this->setData('convertMemberCouponArrData', $convertMemberCouponArrData);
$this->setData('convertMemberCouponPriceArrData', $convertMemberCouponPriceArrData);
}
}
}
 
 
 
 
 
 
 
 
 
$this->setData('goodsCouponArrData', $goodsCouponData['goodsCouponArrData']); // 쿠폰 DB 데이터
$this->setData('convertGoodsCouponArrData', $goodsCouponData['convertGoodsCouponArrData']); // 변환 쿠폰 데이터
$this->setData('convertGoodsCouponPriceArrData', $goodsCouponData['convertGoodsCouponPriceArrData']); // 쿠폰 가격 데이터
 
변경 후LayerCouponApplyOrderController.php
}
}
// 쿠폰명은 원문 저장되어 화면 출력 전 인코딩함
foreach (['order', 'delivery'] as $couponUseType) {
if (is_array($memberCouponArrData[$couponUseType])) {
foreach ($memberCouponArrData[$couponUseType] as &$memberCoupon) {
$memberCoupon['couponNm'] = gd_htmlspecialchars($memberCoupon['couponNm']);
}
unset($memberCoupon);
}
}
$this->setData('memberCouponArrData', $memberCouponArrData);
$this->setData('convertMemberCouponArrData', $convertMemberCouponArrData);
$this->setData('convertMemberCouponPriceArrData', $convertMemberCouponPriceArrData);
}
}
}
if (is_array($goodsCouponData['goodsCouponArrData'])) {
foreach ($goodsCouponData['goodsCouponArrData'] as &$goodsCouponList) {
foreach ($goodsCouponList as &$goodsCoupon) {
$goodsCoupon['couponNm'] = gd_htmlspecialchars($goodsCoupon['couponNm']);
}
unset($goodsCoupon);
}
unset($goodsCouponList);
}
$this->setData('goodsCouponArrData', $goodsCouponData['goodsCouponArrData']); // 쿠폰 DB 데이터
$this->setData('convertGoodsCouponArrData', $goodsCouponData['convertGoodsCouponArrData']); // 변환 쿠폰 데이터
$this->setData('convertGoodsCouponPriceArrData', $goodsCouponData['convertGoodsCouponPriceArrData']); // 쿠폰 가격 데이터
 
data/skin/front/moment/css/event/coupon.css+15
변경 전coupon.css
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후coupon.css
@charset "utf-8";
 
/* 쿠폰존 — 사용처 배지 */
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:22px;padding:0 5px;border-radius:2px;margin-bottom:6px;font-size:12px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .date{margin-top:14px;vertical-align:top;}
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.coupon_down_layer .coupon_section_tit{margin:18px 0 0; padding-bottom:6px; color:#222; font-size:15px; font-weight:700; border-bottom:1px solid #333;}
 
/* 쿠폰 다운받기 레이어 */
.coupon_down_layer .coupon_completed.coupon-grade-limit{padding:0; color:#838383; background:none;}
.coupon_down_layer .top_table_type table{table-layout:fixed;}
.coupon_down_layer .top_table_type td:first-child{word-break:keep-all; word-wrap:break-word;}
 
data/skin/front/moment/event/couponzone.html+9-2
변경 전couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<div class="content">
 
<div class="mypage_cont">
<div class="coupon_content">
<h2>쿠폰존</h2>
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="{=__('쿠폰이미지')}" /></div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<div class="content">
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="mypage_cont">
<div class="coupon_content">
<h2>쿠폰존</h2>
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="{=__('쿠폰이미지')}" /></div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/front/moment/goods/layer_coupon_down.html+62-4
변경 전layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
 
<div class="layer_wrap_cont">
<div class="ly_tit">
<h4>
<div class="ly_cont">
<div class="scroll_box">
<!--{ ? gd_is_login() }-->
 
 
<div class="top_table_type">
<table>
<colgroup>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!--{ : }-->
<div class="coupon_down_txt"><p>{=__('로그인하셔야 본 서비스를 이용하실 수 있습니다.')}</p></div>
<!--{ / }-->
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
});
//-->
</script>
<!--{ / }-->
 
변경 후layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="layer_wrap_cont">
<div class="ly_tit">
<h4>
<div class="ly_cont">
<div class="scroll_box">
<!--{ ? gd_is_login() }-->
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<div class="top_table_type">
<table>
<colgroup>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<div class="top_table_type">
<table>
<colgroup>
<col style="width:150px" />
<col style="width:300px" />
<col>
</colgroup>
<thead>
<tr>
<th>{=__('쿠폰')}</th>
<th>{=__('혜택')}</th>
<th>{=__('다운받기')}</th>
</tr>
</thead>
<tbody>
<!--{ @ orderCouponArrData }-->
<tr>
<td>
<strong>{.couponNm}</strong>
</td>
<td class="td_left">
<strong class="coupon_price"><b>{convertCouponArrData[.key_].couponBenefit}</b> { convertCouponArrData[.key_].couponKindType }</strong>
<span class="text_info">
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
- {convertCouponArrData[.key_].couponMaxBenefit}<br />
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
- {convertCouponArrData[.key_].couponMinOrderPrice}<br />
<!--{ / }-->
- {convertCouponArrData[.key_].couponApplyDuplicateType}
</span>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
<div class="btn_down_box">
<span class="btn_gray_list btn_coupon_down" data-coupon-no="{.couponNo}"><a href="#" class="btn_gray_small"><em class="icon_download">{=__('쿠폰 다운받기')}</em></a></span>
<em class="text_info">({convertCouponArrData[.key_].useEndDate})</em>
</div>
<!--{ / }-->
</td>
</tr>
<!--{ / }-->
</tbody>
</table>
</div>
<!--{ / }-->
<!--{ : }-->
<div class="coupon_down_txt"><p>{=__('로그인하셔야 본 서비스를 이용하실 수 있습니다.')}</p></div>
<!--{ / }-->
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
});
//-->
</script>
<!--{ / }-->
 
data/skin/front/mygreek/css/event/coupon.css+19
변경 전coupon.css
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후coupon.css
@charset "utf-8";
 
/* 쿠폰존 — 사용처 배지 */
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:22px;padding:0 5px;border-radius:2px;margin-bottom:6px;font-size:12px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .date{margin-top:14px;vertical-align:top;}
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.coupon_down_layer .coupon_section_tit{margin:18px 0 0; padding-bottom:6px; color:#222; font-size:15px; font-weight:700; border-bottom:1px solid #333;}
 
/* 쿠폰 다운받기 레이어 */
.coupon_down_layer .coupon_completed:not(.coupon-grade-limit){display:inline-block; min-height:17px; padding-left:23px; line-height:17px; background:url('../../img/common/layer/icon_completed.png') no-repeat left center;}
.coupon_down_layer .coupon_completed.coupon-grade-limit{color:#838383;}
.coupon_down_layer .top_table_type table{table-layout:fixed;}
.coupon_down_layer .top_table_type td:first-child{word-break:keep-all; word-wrap:break-word;}
/* 쿠폰존 */
.coupon_content .cp_list_wrap .cp_list{width:920px;}
.coupon_content .cp_list_wrap .cp_list li{margin-right:10px;}
 
data/skin/front/mygreek/event/couponzone.html+9-2
변경 전couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<div class="content">
 
<div class="mypage_cont">
<div class="coupon_content">
<h2>쿠폰존</h2>
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="{=__('쿠폰이미지')}" /></div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<div class="content">
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="mypage_cont">
<div class="coupon_content">
<h2>쿠폰존</h2>
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="{=__('쿠폰이미지')}" /></div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/front/mygreek/goods/layer_coupon_down.html+61-3
변경 전layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
 
<div class="layer_wrap_cont">
<div class="ly_tit">
<h4>
<div class="ly_cont">
<div class="scroll_box">
<!--{ ? gd_is_login() }-->
 
 
<div class="top_table_type">
<table>
<colgroup>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!--{ : }-->
<div class="coupon_down_txt"><p>{=__('로그인하셔야 본 서비스를 이용하실 수 있습니다.')}</p></div>
<!--{ / }-->
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
 
변경 후layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="layer_wrap_cont">
<div class="ly_tit">
<h4>
<div class="ly_cont">
<div class="scroll_box">
<!--{ ? gd_is_login() }-->
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<div class="top_table_type">
<table>
<colgroup>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<div class="top_table_type">
<table>
<colgroup>
<col style="width:150px" />
<col style="width:300px" />
<col>
</colgroup>
<thead>
<tr>
<th>{=__('쿠폰')}</th>
<th>{=__('혜택')}</th>
<th>{=__('다운받기')}</th>
</tr>
</thead>
<tbody>
<!--{ @ orderCouponArrData }-->
<tr>
<td>
<strong>{.couponNm}</strong>
</td>
<td class="td_left">
<strong class="coupon_price"><b>{convertCouponArrData[.key_].couponBenefit}</b> { convertCouponArrData[.key_].couponKindType }</strong>
<span class="text_info">
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
- {convertCouponArrData[.key_].couponMaxBenefit}<br />
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
- {convertCouponArrData[.key_].couponMinOrderPrice}<br />
<!--{ / }-->
- {convertCouponArrData[.key_].couponApplyDuplicateType}
</span>
</td>
<td>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="coupon_completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="coupon_completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
<div class="btn_down_box">
<span class="btn_gray_list btn_coupon_down" data-coupon-no="{.couponNo}"><a href="#" class="btn_gray_small"><em class="icon_download">{=__('쿠폰 다운받기')}</em></a></span>
<em class="text_info">({convertCouponArrData[.key_].useEndDate})</em>
</div>
<!--{ / }-->
</td>
</tr>
<!--{ / }-->
</tbody>
</table>
</div>
<!--{ / }-->
<!--{ : }-->
<div class="coupon_down_txt"><p>{=__('로그인하셔야 본 서비스를 이용하실 수 있습니다.')}</p></div>
<!--{ / }-->
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/front/story_g/css/gd_contents.css+12
변경 전gd_contents.css
/*** 회원가입 사업자 정보 | member/_join_view_business.html ***/
.upload_btn_box {position: relative; display: inline-block;}
.upload_btn_box .file {position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;}
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후gd_contents.css
/*** 회원가입 사업자 정보 | member/_join_view_business.html ***/
.upload_btn_box {position: relative; display: inline-block;}
.upload_btn_box .file {position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;}
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.coupon-down-layer .coupon_section_tit{margin:16px 0 0;padding-bottom:6px;color:#222;font-size:15px;font-weight:700;border-bottom:1px solid #333;text-align:left;}
/* 쿠폰존 — 사용처 배지 */
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:22px;padding:0 5px;border-radius:2px;margin-bottom:8px;font-size:12px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.coupon_content .cp_list_wrap .cp_list li .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.coupon_content .cp_list_wrap .cp_list li .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
.coupon_content .cp_list_wrap .cp_list li .box_coupon .text_wrap .text_info .date{margin-top:14px;vertical-align:top;}
/* 쿠폰 다운받기 레이어 */
.coupon-down-layer .view > p .goods-coupon-cnt{color:#fa2828;}
.coupon-down-layer .view .table1 .guide .coupon-benefit{color:#fa2828;}
.coupon-down-layer .table1 > table tbody td .completed.coupon-grade-limit{padding:0; background:none; color:#838383;}
 
data/skin/front/story_g/event/couponzone.html+8-2
변경 전couponzone.html
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="쿠폰이미지" /></div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
<div class="img_cp"><img src="{=couponConfig.pcCouponImagePath}" alt="쿠폰이미지" /></div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="dis">{..couponBenefit}</span>
<span class="txt">{..couponKindType}</span>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/front/story_g/goods/layer_coupon_down.html+63-4
변경 전layer_coupon_down.html
<p>{=__('다운로드 가능한 총')} <strong class="goods-coupon-cnt"><!--{ goodsCouponCnt }-->{=__('개%s의 쿠폰이 있습니다.', '</strong>')}</p>
 
<div class="scroll-box">
 
 
<div class="table1">
<table>
<colgroup>
<!--<span class="coupon-icon">55,000<b>원</b></span>-->
</td>
<td class="guide">
<strong>{ convertCouponArrData[.key_].couponBenefit } { convertCouponArrData[.key_].couponKindType }</strong>
<div class="msg">
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
<span>- { convertCouponArrData[.key_].couponMaxBenefit }</span>
</td>
<td class="ta-c">
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="completed">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
</div>
<div class="btn">
<button class="skinbtn point1 layer-close btn-close"><em>{=__('취소')}</em></button>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
 
변경 후layer_coupon_down.html
<p>{=__('다운로드 가능한 총')} <strong class="goods-coupon-cnt"><!--{ goodsCouponCnt }-->{=__('개%s의 쿠폰이 있습니다.', '</strong>')}</p>
 
<div class="scroll-box">
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<div class="table1">
<table>
<colgroup>
<!--<span class="coupon-icon">55,000<b>원</b></span>-->
</td>
<td class="guide">
<strong><span class="coupon-benefit">{ convertCouponArrData[.key_].couponBenefit }</span> { convertCouponArrData[.key_].couponKindType }</strong>
<div class="msg">
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
<span>- { convertCouponArrData[.key_].couponMaxBenefit }</span>
</td>
<td class="ta-c">
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
</tbody>
</table>
</div>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<div class="table1">
<table>
<colgroup>
<col style="width:151px"/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>{=__('쿠폰')}</th>
<th>{=__('혜택')}</th>
<th>{=__('다운받기')}</th>
</tr>
</thead>
<tbody>
<!--{ @ orderCouponArrData }-->
<tr>
<td class="ta-c">
<strong>{ .couponNm }</strong>
<!--<span class="coupon-icon">55,000<b>원</b></span>-->
</td>
<td class="guide">
<strong><span class="coupon-benefit">{ convertCouponArrData[.key_].couponBenefit }</span> { convertCouponArrData[.key_].couponKindType }</strong>
<div class="msg">
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
<span>- { convertCouponArrData[.key_].couponMaxBenefit }</span>
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<span>- { convertCouponArrData[.key_].couponMinOrderPrice }</span>
<!--{ / }-->
<span>- <!--{ convertCouponArrData[.key_].couponApplyDuplicateType }--></span>
</div>
</td>
<td class="ta-c">
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<strong class="completed coupon-grade-limit">{=__('해당 회원등급이 아닙니다.')}</strong>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<strong class="completed">{=__('발급완료')}</strong>
<!--{ : .chkMemberCoupon == 'YES' }-->
<button class="normal-btn small1 btn-coupon-down" data-coupon-no="{ .couponNo }">
<em>{=__('쿠폰 다운받기')}<img class="down" src="../img/etc/down.png" alt="{=__('쿠폰 다운받기')}"/></em></button>
<div class="msg">
<span>(<!--{ convertCouponArrData[.key_].useEndDate }-->)</span>
</div>
<!--{ / }-->
</td>
</tr>
<!--{ / }-->
</tbody>
</table>
</div>
<!--{ / }-->
</div>
<div class="btn">
<button class="skinbtn point1 layer-close btn-close"><em>{=__('취소')}</em></button>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/moment/css/event/coupon.css+16
변경 전coupon.css
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후coupon.css
@charset "utf-8";
 
/* 쿠폰존 — 사용처 배지 */
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:20px;padding:0 4px;border-radius:2px;margin-bottom:3px;font-size:11px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.layer_coupon_down .coupon_down_list .coupon_section_tit {margin:14px 0 0; padding-bottom:5px; color:#222; font-size:14px; font-weight:700; border-bottom:1px solid #333;}
 
/* 쿠폰 다운받기 레이어 */
.layer_coupon_down .ly_content .coupondown .my_info ul li:nth-child(1) strong span{color:var(--primary-default);}
.layer_coupon_down .ly_content .coupon_down_list ul li .coupon_left dl dt strong{color:var(--primary-default);}
.layer_coupon_down .coupon_down_list .coupon_left dd .c_red{color:inherit;}
/* 쿠폰존 */
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .tit{height:auto; max-height:38px;}
 
data/skin/mobile/moment/css/event/event.css+1-1
변경 전event.css
.coupon_content .cp_list_wrap .btn_all{padding:0 15px;margin-top:7px;}
.coupon_content .cp_list_none{display:none; text-align:center;padding:65px 0 100px;}
.coupon_content .cp_list_none p{padding-top:102px;font-weight:700;font-size:15px;letter-spacing:-0.05em;color:#222;background:url('../../img/icon/bg_notice.png') no-repeat 50% 0;background-size:80px 80px;}
/* //쿠폰존 페이지 */
 
변경 후event.css
.coupon_content .cp_list_wrap .btn_all{padding:0 15px;margin-top:7px;}
.coupon_content .cp_list_none{display:none; text-align:center;padding:65px 0 100px;}
.coupon_content .cp_list_none p{padding-top:102px;font-weight:700;font-size:15px;letter-spacing:-0.05em;color:#222;background:url('../../img/icon/bg_notice.png') no-repeat 50% 0;background-size:80px 80px;}
/* //쿠폰존 페이지 */
 
data/skin/mobile/moment/event/couponzone.html+9-2
변경 전couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
 
<div class="coupon">
<!-- 20190522 추가 -->
<!-- 쿠폰존 -->
</div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="coupon">
<!-- 20190522 추가 -->
<!-- 쿠폰존 -->
</div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/moment/goods/layer_coupon_down.html+45-3
변경 전layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
 
<div class="layer_coupon_down">
<div class="ly_head">
<h2 class="h_tit">{=__('쿠폰 다운받기')}</h2>
</ul>
</div>
<div class="coupon_down_list">
 
 
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<!--{ convertCouponArrData[.key_].couponApplyDuplicateType }-->
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
</li>
<!--{ / }-->
</ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
</div>
</div>
</div>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
 
변경 후layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="layer_coupon_down">
<div class="ly_head">
<h2 class="h_tit">{=__('쿠폰 다운받기')}</h2>
</ul>
</div>
<div class="coupon_down_list">
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<dd><!--{ convertCouponArrData[.key_].couponApplyDuplicateType }--></dd>
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<ul>
<!--{ @ orderCouponArrData }-->
<li>
<div class="coupon_left">
<dl>
<dt>{ .couponNm } <strong>{ convertCouponArrData[.key_].couponBenefit }</strong> { convertCouponArrData[.key_].couponKindType }</dt>
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
<dd>{ convertCouponArrData[.key_].couponMaxBenefit }</dd>
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<dd><!--{ convertCouponArrData[.key_].couponApplyDuplicateType }--></dd>
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<dd>{=__('해당 회원등급이 아닙니다.')}</dd>
<!--{ / }-->
</dl>
</div>
<div class="coupon_right">
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<span class="coupon_download_no_btn">{=__('발급불가')}</span>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<span class="coupon_download_ok_btn">{=__('발급완료')}</span>
<!--{ : .chkMemberCoupon == 'YES' }-->
<span><a class="coupon_download_btn btn_coupon_down" data-coupon-no="{ .couponNo }">{=__('다운로드')}</a></span>
<!--{ / }-->
</div>
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
</div>
</div>
</div>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/mygreek/css/event/coupon.css+18
변경 전coupon.css
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후coupon.css
@charset "utf-8";
 
/* 쿠폰존 — 사용처 배지 */
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:20px;padding:0 4px;border-radius:2px;margin-bottom:3px;font-size:11px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.layer_coupon_down .coupon_down_list .coupon_section_tit {margin:14px 0 0; padding-bottom:5px; color:#222; font-size:14px; font-weight:700; border-bottom:1px solid #333;}
 
/* 쿠폰 다운받기 레이어 */
.layer_coupon_down .ly_content .coupondown .my_info ul li{vertical-align:middle;}
.layer_coupon_down .ly_content .coupondown .my_info ul li:nth-child(2){padding-bottom:0;}
.layer_coupon_down .ly_content .coupondown .my_info ul li:nth-child(1) strong span{color:var(--primary-default);}
.layer_coupon_down .ly_content .coupon_down_list ul li .coupon_left dl dt strong{color:var(--primary-default);}
.layer_coupon_down .ly_content .coupon_down_list ul li .coupon_left dl dd .chk_img{vertical-align:middle;}
/* 쿠폰존 */
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .tit{height:auto; max-height:38px;}
 
data/skin/mobile/mygreek/event/couponzone.html+9-2
변경 전couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
 
<div class="coupon">
<!-- 20190522 추가 -->
<!-- 쿠폰존 -->
</div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
{*** 쿠폰존 | event/couponzone.php ***}
{ # header }
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="coupon">
<!-- 20190522 추가 -->
<!-- 쿠폰존 -->
</div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/mygreek/goods/layer_coupon_down.html+45-3
변경 전layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
 
<div class="layer_coupon_down">
<div class="ly_head">
<h2 class="h_tit">{=__('쿠폰 다운받기')}</h2>
</ul>
</div>
<div class="coupon_down_list">
 
 
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<!--{ convertCouponArrData[.key_].couponApplyDuplicateType }-->
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
</li>
<!--{ / }-->
</ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
</div>
</div>
</div>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
 
변경 후layer_coupon_down.html
{*** 쿠폰 다운받기 레이어 | goods/layer_coupon_down.php ***}
<link type="text/css" rel="stylesheet" href="{=setBrowserCache('../css/event/coupon.css')}" />
<div class="layer_coupon_down">
<div class="ly_head">
<h2 class="h_tit">{=__('쿠폰 다운받기')}</h2>
</ul>
</div>
<div class="coupon_down_list">
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<dd><!--{ convertCouponArrData[.key_].couponApplyDuplicateType }--></dd>
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<ul>
<!--{ @ orderCouponArrData }-->
<li>
<div class="coupon_left">
<dl>
<dt>{ .couponNm } <strong>{ convertCouponArrData[.key_].couponBenefit }</strong> { convertCouponArrData[.key_].couponKindType }</dt>
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
<dd>{ convertCouponArrData[.key_].couponMaxBenefit }</dd>
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
<dd>{ convertCouponArrData[.key_].couponMinOrderPrice }</dd>
<!--{ / }-->
<dd><!--{ convertCouponArrData[.key_].couponApplyDuplicateType }--></dd>
<!--{ ? .chkMemberCoupon == 'YES' }-->
<dd><img src="../img/icon/icon_chk_red.png" alt="{=__('체크')}" class="chk_img"><span class="c_red"><!--{ convertCouponArrData[.key_].useEndDate }--></span></dd>
<!--{ / }-->
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<dd>{=__('해당 회원등급이 아닙니다.')}</dd>
<!--{ / }-->
</dl>
</div>
<div class="coupon_right">
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<span class="coupon_download_no_btn">{=__('발급불가')}</span>
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<span class="coupon_download_ok_btn">{=__('발급완료')}</span>
<!--{ : .chkMemberCoupon == 'YES' }-->
<span><a class="coupon_download_btn btn_coupon_down" data-coupon-no="{ .couponNo }">{=__('다운로드')}</a></span>
<!--{ / }-->
</div>
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
</div>
</div>
</div>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/story_g/css/gd_contents.css+14
변경 전gd_contents.css
label.check_s[for="certificationDeleteSno"],
label.check_s[for^="comAddiCertDeleteSno"] { min-height: 23px; line-height: 23px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
변경 후gd_contents.css
label.check_s[for="certificationDeleteSno"],
label.check_s[for^="comAddiCertDeleteSno"] { min-height: 23px; line-height: 23px;}
 
 
/* 쿠폰 다운받기 레이어 — 「상품쿠폰」/「주문쿠폰」 섹션 제목 */
.coupondown .cp_bx .coupon_section_tit{margin:0 12px;padding:14px 0 7px;color:#222;font-size:14px;font-weight:700;background:#fff;border-bottom:1px solid #333;}
/* 쿠폰존 — 사용처 배지 */
.cp_list_wrap .cp_list li .text_info .cp_use_badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:20px;padding:0 4px;border-radius:2px;margin-bottom:3px;font-size:11px;font-weight:700;line-height:1;letter-spacing:-0.02em;}
.cp_list_wrap .cp_list li .text_info .cp_use_badge.order{background:#555d87;color:#fff;}
.cp_list_wrap .cp_list li .text_info .cp_use_badge.prod{background:#eef2f6;color:#555;border:1px solid #d4dce4;}
/* 쿠폰 다운받기 레이어 */
.coupondown .cp_bx label .tit .c-red{color:#999999 !important;}
.coupondown .cp_bx label .sale:not(.disabled):not(.complete){background:var(--primary-default);}
.coupondown .cp_bx label .sale.complete{border-color:var(--primary-default); color:var(--primary-default);}
.coupondown .cp_bx li{margin:0 12px;}
/* 쿠폰존 */
.coupon_content .cp_list_wrap .cp_list li .text_wrap .text_info .tit{height:auto; max-height:38px;}
 
data/skin/mobile/story_g/event/couponzone.html+8-2
변경 전couponzone.html
</div>
<div class="text_wrap">
<div class="text_info">
 
 
 
 
 
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo,
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll'
 
};
$.ajax({
method: "POST",
 
변경 후couponzone.html
</div>
<div class="text_wrap">
<div class="text_info">
<!--{ ? ..couponUseTypeCode == 'order' }-->
<span class="cp_use_badge order">{=__('주문 적용')}</span>
<!--{ : ..couponUseTypeCode == 'product' }-->
<span class="cp_use_badge prod">{=__('상품 적용')}</span>
<!--{ / }-->
<span class="tit">{..couponNm}</span>
<span class="date">{..useEndDate}</span>
</div>
method: "POST",
cache: false,
url: "../mypage/coupon_ps.php",
data: "mode=couponDown&couponNo=" + couponNo + "&couponToken=" + encodeURIComponent('{=couponToken}'),
dataType: 'json',
async: false,
success: function (data) {
var params = {
total: total,
couponNo: couponArrData,
mode: 'couponDownAll',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/story_g/goods/layer_coupon_down.html+55-3
변경 전layer_coupon_down.html
<a href="#" class="bn_logout" id="btnAllCouponDown">{=__('전체다운로드')}</a>
</div>
<div class="cp_bx">
 
 
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ convertCouponArrData[.key_].couponApplyDuplicateType }-->
 
<!--{ ? .chkMemberCoupon == 'YES' }-->
<br/> <img src="../img/icon/icon-check-red.png" alt="" class="icon-check-red"><span class="c-red"> <!--{ convertCouponArrData[.key_].useEndDate }--></span>
<!--{ / }-->
 
 
</li>
<!--{ / }-->
</ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
</div>
</div>
<button type="button" class="bn_cls v2 ly_btn_close" ><span class="sp">{=__('닫기')}</span></button>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}'
 
};
$.ajax({
method: "POST",
 
변경 후layer_coupon_down.html
<a href="#" class="bn_logout" id="btnAllCouponDown">{=__('전체다운로드')}</a>
</div>
<div class="cp_bx">
<!--{ ? goodsCouponArrData }-->
<p class="coupon_section_tit">{=__('상품쿠폰')}</p>
<ul>
<!--{ @ goodsCouponArrData }-->
<li>
<!--{ convertCouponArrData[.key_].couponApplyDuplicateType }-->
 
<!--{ ? .chkMemberCoupon == 'YES' }-->
<br/> <img src="../img/icon/icon-check-black.png" alt="" class="icon-check-red"><span class="c-red"> <!--{ convertCouponArrData[.key_].useEndDate }--></span>
<!--{ / }-->
 
 
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
<!--{ ? orderCouponArrData }-->
<p class="coupon_section_tit">{=__('주문쿠폰')}</p>
<ul>
<!--{ @ orderCouponArrData }-->
<li>
<label for="cp1">
<span class="tit">
 
{ .couponNm }
<strong>{ convertCouponArrData[.key_].couponBenefit }</strong> { convertCouponArrData[.key_].couponKindType }<br/>
<span>
<!--{ ? convertCouponArrData[.key_].couponMaxBenefit }-->
{ convertCouponArrData[.key_].couponMaxBenefit }<br/>
<!--{ / }-->
<!--{ ? convertCouponArrData[.key_].couponMinOrderPrice }-->
{ convertCouponArrData[.key_].couponMinOrderPrice }<br/>
<!--{ / }-->
<!--{ convertCouponArrData[.key_].couponApplyDuplicateType }-->
 
<!--{ ? .chkMemberCoupon == 'YES' }-->
<br/> <img src="../img/icon/icon-check-black.png" alt="" class="icon-check-red"><span class="c-red"> <!--{ convertCouponArrData[.key_].useEndDate }--></span>
<!--{ / }-->
 
 
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<br/> {=__('해당 회원등급이 아닙니다.')}
<!--{ / }-->
 
</span>
</span>
<!--{ ? .chkMemberCoupon == 'NO_MEMBER_GROUP' }-->
<span class="sale disabled">
{=__('발급불가')}
<!--{ : .chkMemberCoupon == 'DUPLICATE_COUPON' }-->
<span class="sale complete">
{=__('발급완료')}
<!--{ : .chkMemberCoupon == 'YES' }-->
<span class="sale ">
<a class="btn-coupon-down" data-coupon-no="{ .couponNo }"><em>{=__('다운로드')}</em></a>
<!--{ / }-->
 
</span>
</label>
</li>
<!--{ / }-->
</ul>
<!--{ / }-->
</div>
</div>
<button type="button" class="bn_cls v2 ly_btn_close" ><span class="sp">{=__('닫기')}</span></button>
mode: 'coupon_down',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
mode: 'coupon_down_all',
goodsNo: '{goodsNo}',
scmNo: '{scmNo}',
brandCd: '{brandCd}',
couponToken: '{=couponToken}'
};
$.ajax({
method: "POST",
 
data/skin/mobile/story_g/img/icon/icon-check-black.png
변경 전icon-check-black.png
Binary files /dev/null and b/user/data/skin/mobile/story_g/img/icon/icon-check-black.png differ
 
변경 후icon-check-black.png
Binary files /dev/null and b/user/data/skin/mobile/story_g/img/icon/icon-check-black.png differ