사용후기 건수 반영후 검색에서 사용후기 많은순으로 기능 추가
This commit is contained in:
@ -194,7 +194,7 @@ $pg_anchor ='<ul class="anchor">
|
|||||||
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
|
<input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">
|
||||||
<span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
|
<span class="frm_ca_id"><?php echo $it['it_id']; ?></span>
|
||||||
<a href="<?php echo G5_SHOP_URL; ?>/item.php?it_id=<?php echo $it_id; ?>" class="btn_frmline">상품확인</a>
|
<a href="<?php echo G5_SHOP_URL; ?>/item.php?it_id=<?php echo $it_id; ?>" class="btn_frmline">상품확인</a>
|
||||||
<a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemuselist.php?sel_field=a.it_id&search=<?php echo $it_id; ?>" class="btn_frmline">사용후기</a>
|
<a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemuselist.php?sfl=a.it_id&stx=<?php echo $it_id; ?>" class="btn_frmline">사용후기</a>
|
||||||
<a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemqalist.php?sel_field=a.it_id&search=<?php echo $it_id; ?>" class="btn_frmline">상품문의</a>
|
<a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemqalist.php?sel_field=a.it_id&search=<?php echo $it_id; ?>" class="btn_frmline">상품문의</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -29,6 +29,7 @@ $qstr = 'page='.$page.'&sort1='.$sort1.'&sort2='.$sort2;
|
|||||||
<form name="fitemuseform" method="post" action="./itemuseformupdate.php" onsubmit="return fitemuseform_submit(this);">
|
<form name="fitemuseform" method="post" action="./itemuseformupdate.php" onsubmit="return fitemuseform_submit(this);">
|
||||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||||
<input type="hidden" name="is_id" value="<?php echo $is_id; ?>">
|
<input type="hidden" name="is_id" value="<?php echo $is_id; ?>">
|
||||||
|
<input type="hidden" name="it_id" value="<?php echo $is['is_id']; ?>">
|
||||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||||
|
|||||||
@ -20,6 +20,8 @@ if ($w == "u")
|
|||||||
where is_id = '$is_id' ";
|
where is_id = '$is_id' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
|
|
||||||
|
update_use_cnt($_POST['it_id']);
|
||||||
|
|
||||||
goto_url("./itemuseform.php?w=$w&is_id=$is_id&$qstr");
|
goto_url("./itemuseform.php?w=$w&is_id=$is_id&$qstr");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -133,6 +133,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
|||||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['is_subject']) ?> 사용후기</label>
|
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['is_subject']) ?> 사용후기</label>
|
||||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||||
<input type="hidden" name="is_id[<?php echo $i; ?>]" value="<?php echo $row['is_id']; ?>">
|
<input type="hidden" name="is_id[<?php echo $i; ?>]" value="<?php echo $row['is_id']; ?>">
|
||||||
|
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||||
</td>
|
</td>
|
||||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
|
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
|
||||||
<td class="td_name"><?php echo $name; ?></td>
|
<td class="td_name"><?php echo $name; ?></td>
|
||||||
|
|||||||
@ -9,30 +9,31 @@ if (!count($_POST['chk'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST['act_button'] == "선택수정") {
|
if ($_POST['act_button'] == "선택수정") {
|
||||||
|
|
||||||
auth_check($auth[$sub_menu], 'w');
|
auth_check($auth[$sub_menu], 'w');
|
||||||
|
} else if ($_POST['act_button'] == "선택삭제") {
|
||||||
|
auth_check($auth[$sub_menu], 'd');
|
||||||
|
} else {
|
||||||
|
alert("선택수정이나 선택삭제 작업이 아닙니다.");
|
||||||
|
}
|
||||||
|
|
||||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||||
|
{
|
||||||
// 실제 번호를 넘김
|
$k = $_POST['chk'][$i]; // 실제 번호를 넘김
|
||||||
$k = $_POST['chk'][$i];
|
|
||||||
|
if ($_POST['act_button'] == "선택수정")
|
||||||
|
{
|
||||||
$sql = "update {$g5['g5_shop_item_use_table']}
|
$sql = "update {$g5['g5_shop_item_use_table']}
|
||||||
set is_confirm = '{$_POST['is_confirm'][$k]}'
|
set is_confirm = '{$_POST['is_confirm'][$k]}'
|
||||||
where is_id = '{$_POST['is_id'][$k]}' ";
|
where is_id = '{$_POST['is_id'][$k]}' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
}
|
}
|
||||||
} else if ($_POST['act_button'] == "선택삭제") {
|
else if ($_POST['act_button'] == "선택삭제")
|
||||||
|
{
|
||||||
auth_check($auth[$sub_menu], 'd');
|
|
||||||
|
|
||||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
|
||||||
// 실제 번호를 넘김
|
|
||||||
$k = $_POST['chk'][$i];
|
|
||||||
|
|
||||||
$sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$_POST['is_id'][$k]}' ";
|
$sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$_POST['is_id'][$k]}' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_use_cnt($_POST['it_id'][$k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
goto_url("./itemuselist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
goto_url("./itemuselist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||||
|
|||||||
@ -241,14 +241,11 @@ for ($i=0; $i<count($_POST['chk']); $i++)
|
|||||||
change_status($od_id, '배송', '완료');
|
change_status($od_id, '배송', '완료');
|
||||||
|
|
||||||
// 완료인 경우에만 상품구입 합계수량을 상품테이블에 저장한다.
|
// 완료인 경우에만 상품구입 합계수량을 상품테이블에 저장한다.
|
||||||
$sql2 = " select ct_id, ct_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
|
$sql2 = " select it_id, sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_status = '완료' group by it_id ";
|
||||||
$result2 = sql_query($sql2);
|
$result2 = sql_query($sql2);
|
||||||
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
|
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
|
||||||
$sql3 = " select it_id, sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where ct_id = '{$row2['ct_id']}' ";
|
$sql3 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row3['it_id']}' ";
|
||||||
$row3 = sql_fetch($sql3);
|
sql_query($sql3);
|
||||||
|
|
||||||
$sql4 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row3['it_id']}' ";
|
|
||||||
sql_query($sql4);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -1796,6 +1796,15 @@ function check_itemuse_write($close=true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 사용후기의 확인된 건수를 상품테이블에 저장합니다.
|
||||||
|
function update_use_cnt($it_id)
|
||||||
|
{
|
||||||
|
global $g5;
|
||||||
|
$row = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_use_table']} where it_id = '{$it_id}' and is_confirm = 1 ");
|
||||||
|
return sql_query(" update {$g5['g5_shop_item_table']} set it_use_cnt = '{$row['cnt']}' where it_id = '{$it_id}' ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// 주문포인트를 적립한다.
|
// 주문포인트를 적립한다.
|
||||||
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
|
// 설정일이 지난 포인트 부여되지 않은 배송완료된 장바구니 자료에 포인트 부여
|
||||||
|
|||||||
@ -16,6 +16,7 @@ $qid = escape_trim($_GET['qid']);
|
|||||||
$qcaid = escape_trim($_GET['qcaid']);
|
$qcaid = escape_trim($_GET['qcaid']);
|
||||||
$qfrom = escape_trim($_GET['qfrom']);
|
$qfrom = escape_trim($_GET['qfrom']);
|
||||||
$qto = escape_trim($_GET['qto']);
|
$qto = escape_trim($_GET['qto']);
|
||||||
|
$qsort = escape_trim($_GET['qsort']);
|
||||||
|
|
||||||
// QUERY 문에 공통적으로 들어가는 내용
|
// QUERY 문에 공통적으로 들어가는 내용
|
||||||
// 상품명에 검색어가 포한된것과 상품판매가능인것만
|
// 상품명에 검색어가 포한된것과 상품판매가능인것만
|
||||||
@ -35,7 +36,8 @@ if ($q) {
|
|||||||
for ($i=0; $i<count($arr); $i++) {
|
for ($i=0; $i<count($arr); $i++) {
|
||||||
$word = trim($arr[$i]);
|
$word = trim($arr[$i]);
|
||||||
if (!$word) continue;
|
if (!$word) continue;
|
||||||
|
|
||||||
|
/*
|
||||||
$or = array();
|
$or = array();
|
||||||
if ($search_all || $qname)
|
if ($search_all || $qname)
|
||||||
$or[] = " a.it_name like '%$word%' ";
|
$or[] = " a.it_name like '%$word%' ";
|
||||||
@ -43,15 +45,26 @@ if ($q) {
|
|||||||
$or[] = " a.it_explan2 like '%$word%' "; // tag 를 제거한 상품설명을 검색한다.
|
$or[] = " a.it_explan2 like '%$word%' "; // tag 를 제거한 상품설명을 검색한다.
|
||||||
if ($search_all || $qid)
|
if ($search_all || $qid)
|
||||||
$or[] = " a.it_id like '%$word%' ";
|
$or[] = " a.it_id like '%$word%' ";
|
||||||
|
|
||||||
$detail_where[] = "(" . implode(" or ", $or) . ")";
|
$detail_where[] = "(" . implode(" or ", $or) . ")";
|
||||||
|
*/
|
||||||
|
$concat = array();
|
||||||
|
if ($search_all || $qname)
|
||||||
|
$concat[] = "a.it_name";
|
||||||
|
if ($search_all || $qexplan)
|
||||||
|
$concat[] = "a.it_explan2";
|
||||||
|
if ($search_all || $qid)
|
||||||
|
$concat[] = "a.it_id";
|
||||||
|
$concat_fields = "concat(".implode(",' ',",$concat).")";
|
||||||
|
|
||||||
|
$detail_where[] = $concat_fields." like '%$word%' ";
|
||||||
|
|
||||||
// 인기검색어
|
// 인기검색어
|
||||||
$sql = " insert into {$g5['popular_table']} set pp_word = '$word', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
$sql = " insert into {$g5['popular_table']} set pp_word = '$word', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||||
sql_query($sql, FALSE);
|
sql_query($sql, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
$where[] = "(".implode(" or ", $detail_where).")";
|
$where[] = "(".implode(" and ", $detail_where).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($qcaid)
|
if ($qcaid)
|
||||||
@ -63,25 +76,37 @@ if ($qfrom || $qto)
|
|||||||
$sql_where = " where " . implode(" and ", $where);
|
$sql_where = " where " . implode(" and ", $where);
|
||||||
|
|
||||||
// 상품 출력순서가 있다면
|
// 상품 출력순서가 있다면
|
||||||
if ($sort != "")
|
$order_by = "";
|
||||||
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
|
if ($qsort != "") {
|
||||||
|
$order_by = ' order by ' . $qsort . ' ' . $qorder . ' , it_order, it_id desc';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 총몇개 = 한줄에 몇개 * 몇줄
|
||||||
|
$items = $default['de_search_list_mod'] * $default['de_search_list_row'];
|
||||||
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
||||||
|
if ($page == "") $page = 1;
|
||||||
|
// 시작 레코드 구함
|
||||||
|
$from_record = ($page - 1) * $items;
|
||||||
|
|
||||||
// 검색된 내용이 몇행인지를 얻는다
|
// 검색된 내용이 몇행인지를 얻는다
|
||||||
$sql = " select COUNT(*) as cnt $sql_common $sql_where ";
|
$sql = " select COUNT(*) as cnt $sql_common $sql_where ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
$total_count = $row['cnt'];
|
$total_count = $row['cnt'];
|
||||||
|
$total_page = ceil($total_count / $items); // 전체 페이지 계산
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- 검색결과 시작 { -->
|
<!-- 검색결과 시작 { -->
|
||||||
<div id="ssch">
|
<div id="ssch">
|
||||||
|
|
||||||
<div id="ssch_frm">
|
<div id="ssch_frm">
|
||||||
<form name="frmdetailsearch" onsubmit="return detail_search_submit(this);">
|
<form name="frmdetailsearch">
|
||||||
|
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||||
|
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||||
<div>
|
<div>
|
||||||
<strong>검색범위</strong>
|
<strong>검색범위</strong>
|
||||||
<input type="checkbox" name="qname" class="frm_input" <?php echo isset($qname)?'checked="checked"':'';?>> 상품명
|
<label><input type="checkbox" name="qname" class="frm_input" <?php echo isset($qname)?'checked="checked"':'';?>> 상품명</label>
|
||||||
<input type="checkbox" name="qexplan" class="frm_input" <?php echo isset($qexplan)?'checked="checked"':'';?>> 상품설명
|
<label><input type="checkbox" name="qexplan" class="frm_input" <?php echo isset($qexplan)?'checked="checked"':'';?>> 상품설명</label>
|
||||||
<input type="checkbox" name="qid" class="frm_input" <?php echo isset($qid)?'checked="checked"':'';?>> 상품코드<br>
|
<label><input type="checkbox" name="qid" class="frm_input" <?php echo isset($qid)?'checked="checked"':'';?>> 상품코드</label><br>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>상품가격</strong>
|
<strong>상품가격</strong>
|
||||||
@ -93,13 +118,26 @@ $total_count = $row['cnt'];
|
|||||||
<input type="text" name="q" value="<?php echo $q; ?>" class="frm_input" size="40" maxlength="30">
|
<input type="text" name="q" value="<?php echo $q; ?>" class="frm_input" size="40" maxlength="30">
|
||||||
<input type="submit" value="검색" class="btn_submit">
|
<input type="submit" value="검색" class="btn_submit">
|
||||||
</div>
|
</div>
|
||||||
<p>상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.</p>
|
<p>
|
||||||
|
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||||
|
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function set_sort(qsort, qorder)
|
||||||
|
{
|
||||||
|
var f = document.frmdetailsearch;
|
||||||
|
f.qsort.value = qsort;
|
||||||
|
f.qorder.value = qorder;
|
||||||
|
f.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<ul id="ssch_sort">
|
<ul id="ssch_sort">
|
||||||
<li><a href="#" class="btn01">판매량 많은순</a></li>
|
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매량 많은순</a></li>
|
||||||
<li><a href="#" class="btn01">선호도 높은순</a></li>
|
<li><a href="#" class="btn01">선호도 높은순</a></li>
|
||||||
<li><a href="#" class="btn01">사용후기 많은순</a></li>
|
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">사용후기 많은순</a></li>
|
||||||
<li><a href="#" class="btn01">최근 등록순</a></li>
|
<li><a href="#" class="btn01">최근 등록순</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -114,18 +152,11 @@ $total_count = $row['cnt'];
|
|||||||
$list_file = G5_SHOP_SKIN_PATH.'/'.$default['de_search_list_skin'];
|
$list_file = G5_SHOP_SKIN_PATH.'/'.$default['de_search_list_skin'];
|
||||||
if (file_exists($list_file)) {
|
if (file_exists($list_file)) {
|
||||||
|
|
||||||
// 총몇개 = 한줄에 몇개 * 몇줄
|
|
||||||
$items = $default['de_search_list_mod'] * $default['de_search_list_row'];
|
|
||||||
// 페이지가 없으면 첫 페이지 (1 페이지)
|
|
||||||
if ($page == "") $page = 1;
|
|
||||||
// 시작 레코드 구함
|
|
||||||
$from_record = ($page - 1) * $items;
|
|
||||||
|
|
||||||
$list = new item_list($default['de_search_list_skin'], $default['de_search_list_mod'], $default['de_search_list_row'], $default['de_search_img_width'], $default['de_search_img_height']);
|
$list = new item_list($default['de_search_list_skin'], $default['de_search_list_mod'], $default['de_search_list_row'], $default['de_search_img_width'], $default['de_search_img_height']);
|
||||||
$list->set_query(" select * $sql_common $sql_where limit $from_record, $items ");
|
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||||
$list->set_is_page(true);
|
$list->set_is_page(true);
|
||||||
$list->set_order_by($order_by);
|
//$list->set_order_by($order_by);
|
||||||
$list->set_from_record($from_record);
|
//$list->set_from_record($from_record);
|
||||||
$list->set_view('it_img', true);
|
$list->set_view('it_img', true);
|
||||||
$list->set_view('it_id', true);
|
$list->set_view('it_id', true);
|
||||||
$list->set_view('it_name', true);
|
$list->set_view('it_name', true);
|
||||||
@ -136,12 +167,14 @@ $total_count = $row['cnt'];
|
|||||||
$list->set_view('sns', true);
|
$list->set_view('sns', true);
|
||||||
echo $list->run();
|
echo $list->run();
|
||||||
|
|
||||||
|
/*
|
||||||
// where 된 전체 상품수
|
// where 된 전체 상품수
|
||||||
$sql = " select count(*) as cnt $sql_common $sql_where ";
|
$sql = " select count(*) as cnt $sql_common $sql_where ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
$total_count = $row['cnt'];
|
$total_count = $row['cnt'];
|
||||||
// 전체 페이지 계산
|
// 전체 페이지 계산
|
||||||
$total_page = ceil($total_count / $items);
|
$total_page = ceil($total_count / $items);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,11 +187,9 @@ $total_count = $row['cnt'];
|
|||||||
echo '<div>'.$error.'</div>';
|
echo '<div>'.$error.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$qstr1 .= 'ca_id='.$ca_id;
|
$query_string .= 'ca_id='.$ca_id;
|
||||||
if($skin)
|
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||||
$qstr1 .= '&skin='.$skin;
|
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
|
||||||
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
|
||||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user