$startcity = !empty($startcity) ? "[{$startcity}出发]" : ''; $linename = "{$startcity}{$row['linename']}"; $award2 = !empty($row['jefentprice']) ? $row['jefentprice'] : 0; $booknum = Helper_Archive::getSellNum($row['id'], 1) + $row['bookcount']; $real = getLineRealPrice($row['aid'], $row['webid']); $row['lineprice'] = $real ? $real : $row['price']; if ($k < 5) { $left .= ' <div class="list_con_sy"> <div class="sy_img"><a class="fl" href="' . $url . '" title="' . $linename . '"><img class="fl" src="' . $litpic . '" width="100" height="80" alt="' . $linename . '" /></a></div> <div class="sy_txt"> <p class="p1"><a href="' . $url . '" target="_blank">' . $linename . '</a></p> <p class="p2">' . $row['sellpoint'] . '</p> <p class="p3"> <span>销量:<b>' . $booknum . '</b>人已购买</span> <span>评论:<b>' . Helper_Archive::getCommentNum($row['id'], 1) . '</b>条评论</span> <span class="sp_star"><strong class="fl">满意度:</strong><b><s style=" width:' . Helper_Archive::getSatisfyScore($row['id'], 1) . '"></s></b></span> </p> </div> <div class="sy_price"> <p class="p1">¥<strong>' . $row['lineprice'] . '</strong><span>起</span></p> <p class="p2"><span>' . $award2 . '</span></p> </div> </div> '; } else { $right .= '<li> <div class="hot_img"><s></s><a class="fl" href="' . $url . '" title="' . $linename . '"><img class="fl" src="' . $litpic . '" width="190" height="140" alt="' . $linename . '" /></a></div> <div class="hot_tit"><a href="' . $url . '" target="_blank">' . $linename . '</a></div> <div class="hot_txt">本季惊爆价:<span>¥' . $row['lineprice'] . '</span>起</div> </li>'; } $k++;
function getSatisfyScore($id) { $rand = mt_rand(3, 5); $score = Helper_Archive::getSatisfyScore($id, 2); return $score; }
if (empty($row['id'])) { head404(); } $templets = $row['templet']; //使用的模板 loadUserFunc($templets); //载入用户自定义函数类 if (is_array($row)) { Helper_Archive::setHistoryCookie($row['id'], 'line'); $real = getLineRealPrice($row['aid'], $row['webid']); $row['price'] = empty($row['price']) ? '<span>电询</span>' : $row['price']; $row['lineprice'] = !empty($real) ? $real : $row['price']; //线路报价 $row['transport'] = $row['transport']; $row['dingjin'] = $row['dj']; $row['score'] = Helper_Archive::getSatisfyScore($row['id'], $typeid); //分数 $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], $typeid); //点评数 $row['commenthomeid'] = $row['id']; if (!empty($row['storeprice']) || $row['storeprice'] > $row['lineprice']) { $row['cheap'] = $row['storeprice'] - $row['lineprice']; //优惠 } else { $row['cheap'] = 0; } $pic_arr = getPiclistArr($row); //读取图片带样式列表 $row['bigpiclist'] = $pic_arr[0]; //大图 $row['thumblist'] = $pic_arr[1];
function lib_getspotlist(&$ctag, &$refObj) { global $dsql; include SLINEDATA . "/webinfo.php"; $attlist = "row|8,flag|,type|top,sonid|,limit|0,kindid|"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = 'a.aid,a.id,a.title,a.litpic,a.area,a.tagword,a.kindlist,a.webid,a.attrid,a.shownum,a.want,a.went,a.sellpoint,a.iconlist'; if ($type == 'top' && empty($flag)) { return ''; } //如果调用二级栏目则必须在显示类里指定sonid //加目的地页面显示条件 $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},kindlist) " : ''; if ($type == 'mdd') { if ($flag == 'recommend') { $orderby = ' order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } else { if ($flag == 'hot') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } else { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc'; } } $orderby .= ",a.modtime desc,a.addtime desc"; //这里增加子站的判断 if ($GLOBALS['sys_child_webid'] != 0) { $dest_id = $GLOBALS['sys_child_webid']; } if (!empty($refObj->Fields['kindid']) || $dest_id) { $sonid = $refObj->Fields['kindid']; $sonid = empty($sonid) ? $dest_id : $sonid; $where = "where FIND_IN_SET({$sonid},a.kindlist) {$orderby} limit {$limit},{$row}"; $sql = "select a.* from #@__spot as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=5) {$where}"; //echo $sql; } else { $sql = "select {$basefield},b.isding as isding,b.isjian,b.displayorder from #@__spot as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=5) order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } } else { if ($type == 'aroundspot') { $kindid = array_remove_value($refObj->Fields['kindlist']); $sql = "select * from #@__spot where FIND_IN_SET({$kindid},kindlist) order by modtime desc,addtime desc limit {$limit},{$row}"; } else { if ($type == 'top') { if ($flag == 'recommend') { $sql = "select a.ishidden,{$basefield},b.isding as isding,b.isjian,b.displayorder from #@__spot as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=5) where a.ishidden=0 order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select {$basefield} from #@__spot a where webid is not null {$destwhere} order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}"; } else { if ($flag == 'want') { $sql = "select {$basefield} from #@__spot a where a.webid is not null {$destwhere} order by a.want desc,a.shownum desc limit {$limit},{$row}"; } else { if ($flag == 'went') { $sql = "select {$basefield} from #@__spot a where a.webid is not null {$destwhere} order by a.went desc limit {$limit},{$row}"; } else { if ($flag == 'attr') { $attrid = $refObj->Fields['attrid']; $sql = "select {$basefield} from #@__spot a where FIND_IN_SET({$attrid},a.attrid) order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = array_remove_value($kindlist); //最后一级. $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; $sql = "select {$basefield} from #@__spot a where {$where} order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}"; } else { return ''; } } } } } } } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select {$basefield} from #@__spot a where FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $webroot = GetWebURLByWebid($row['webid']); $url = $webroot . "/spots/show_{$row['aid']}.html"; $row['url'] = $url; $price = getSpotPrice($row['id']); //本站的价格 $sellprice = getSpotsellPrice($row['id']); //票面价格 $row['title'] = $row['title']; $row['lit240'] = getUploadFileUrl(str_replace('litpic', 'lit240', $row['litpic'])); $row['lit160'] = getUploadFileUrl(str_replace('litpic', 'lit160', $row['litpic'])); $row['litpic'] = getUploadFileUrl($row['litpic']); $row['sellprice'] = $price; $row['oldprice'] = $sellprice; $row['price'] = !empty($price) ? "<b>¥" . $price . "</b>起" : '电询'; $row['price2'] = empty($price) ? '电询' : '<span>¥</span><strong>' . $price . '</strong><i>起</i>'; //目的地页面用 $row['price3'] = $price; $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 5); //满意度 foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if (!empty($row[$ctag->GetName()]) || $row[$ctag->GetName()] == '0') { $ctp->Assign($tagid, $row[$ctag->GetName()]); } else { $ctp->Assign($tagid, ''); } } } $revalue .= $ctp->GetResult(); } return $revalue; }
/** * 调用团购显示数据标签 * * @version $Id: gettuanlist.lib.php netman * @package Stourweb.Taglib * @copyright Copyright (c) 2007 - 2011, Stourweb, Inc. * @link http://www.stourweb.com */ function lib_gettuanlist(&$ctag, &$refObj) { global $dsql; include SLINEDATA . "/webinfo.php"; $attlist = "row|8,flag|,type|top,limit|0,haspic|1,day|"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = 'a.*'; $time = time(); if ($type == 'mdd') { if ($flag == 'recommend') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc'; } else { if ($flag == 'hot') { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc'; } else { if ($flag == 'new') { $orderby = 'order by a.addtime desc'; } else { $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.addtime desc'; } } } if (isset($refObj->Fields['kindid'])) { $sonid = $refObj->Fields['kindid']; $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row; //如果模块设置了显示数量则使用. $where = "a.ishidden=0 and FIND_IN_SET({$sonid},a.kindlist) and a.endtime>{$time} and a.starttime<={$time}"; $where .= !empty($haspic) ? " and a.litpic is not null" : ''; $sql = "select {$basefield} from #@__tuan as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid and c.typeid=4) where {$where} {$orderby} limit {$limit},{$number}"; } else { return ''; } } else { if ($type == 'daytime') { if (!empty($day)) { $day = date('Y-m-d', strtotime($day)); $day = strtotime($day); $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and starttime={$day} and endtime!='' order by a.addtime asc,a.endtime asc limit {$limit},{$row}"; } else { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime>{$time} order by a.starttime asc,a.addtime desc limit {$limit},{$row}"; } } else { if ($flag == 'recommend') { $sql = "select {$basefield},b.isjian,b.isding as isding,b.displayorder from #@__tuan a left join #@__allorderlist b on (a.id=b.aid and b.typeid=13) where a.ishidden=0 and a.endtime>{$time} order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'new') { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.shownum desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'byendtime') { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.endtime asc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'photo') { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and a.litpic !='' and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'nostart') { $sql = "select {$basefield} from #@__tuan a where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime>{$time} order by a.starttime asc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = get_exist_kind($kindlist); //最后一级. $maxkindid = empty($maxkindid) ? 0 : $maxkindid; $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联 $sql = "select a.* from #@__tuan a where find_in_set('{$attrid}',a.attrid) where a.ishidden=0 and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row} "; } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select a.* from #@__tuan a where a.ishidden=0 and FIND_IN_SET({$themeid},a.themelist) and endtime>{$time} and endtime!='' and a.starttime<={$time} order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { return ''; } } } } } } } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $webroot = GetWebURLByWebid($row['webid']); $sonid = $refObj->Fields['sonid']; $row['url'] = $webroot . "/tuan/show_{$row['aid']}.html"; $row['litpic'] = getUploadFileUrl($row['litpic']); $row['lit240'] = str_replace('litimg', 'lit240', $row['litpic']); $row['lit160'] = str_replace('litimg', 'lit160', $row['litpic']); $row['attrname'] = getTuanAttrname($row['attrid']); $row['attrnamearr'] = getTuanAttrname($row['attrid'], true); $row['destname'] = Helper_Archive::getBelongDestName($row['kindlist']); //所属目的地 $row['destid'] = array_remove_value($row['kindlist']); $row['discount'] = floor($row['price'] / $row['sellprice'] * 100) / 10; //折扣 $row['booknum'] = Helper_Archive::getSellNum($row['id'], 13) + $row['virtualnum']; $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 13); //满意度 $row['price'] = $row['price']; foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if (isset($row[$ctag->GetName()])) { $ctp->Assign($tagid, $row[$ctag->GetName()]); } } } $revalue .= $ctp->GetResult(); } return $revalue; }
/** * 调用酒店数据标签 * * @version $Id: gethotellist.lib.php netman * @package Stourweb.Taglib * @copyright Copyright (c) 2007 - 2011, Stourweb, Inc. * @link http://www.stourweb.com */ function lib_gethotellist(&$ctag, &$refObj) { global $dsql; $attlist = "row|8,flag|,type|top,sonid|,limit|0"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = trim($ctag->GetInnertext()); $revalue = ''; $basefield = 'a.id,a.sellpoint,a.aid,a.kindlist,a.title,a.address,a.litpic,a.ishidden,a.hotelrankid,a.webid,a.hotelrankid as hotelrankids,a.shownum,a.iconlist'; if ($type == 'top' && empty($flag)) { return ''; } //如果调用二级栏目则必须在显示类里指定sonid $limit = !empty($limit) ? $limit : 0; //加目的地页面显示条件 $destwhere = isset($refObj->Fields['kindid']) ? "and FIND_IN_SET({$refObj->Fields['kindid']},a.kindlist) " : ''; //用于聚合页面 if ($type == 'mdd') { $sonid = $refObj->Fields['kindid']; if ($GLOBALS['sys_child_webid'] != 0) { $dest_id = $GLOBALS['sys_child_webid']; //当前级目的地id. } $sonid = $sonid ? $sonid : $dest_id; if (!isset($sonid)) { return ''; } if ($flag == 'hot') { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { if ($flag == 'recommend') { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { if ($flag == 'specical') { $orderby = 'case when b.displayorder is null then 9999 end,b.displayorder asc'; } else { $orderby = 'order by case when b.displayorder is null then 9999 end,b.displayorder asc'; } } } $orderby .= ",a.modtime desc,a.addtime desc"; $where = "FIND_IN_SET({$sonid},a.kindlist)"; $sql = "select {$basefield},b.isding,b.isjian,b.istejia from #@__hotel a left join #@__kindorderlist as b on (a.id=b.aid and b.classid='{$sonid}' and b.typeid='2') where " . $where . " and (a.ishidden='0' or a.ishidden is null){$orderby} limit {$limit},{$row}"; } else { if ($type == 'rank') { if (isset($refObj->Fields['sonid'])) { $sonid = $refObj->Fields['sonid']; $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on a.hotelrankid=b.aid where a.webid=0 and a.hotelrankid={$sonid} and a.ishidden='0' order by a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { return ''; } } else { if ($type == 'rankhot') { $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on a.hotelrankid=b.aid where a.ishidden='0' order by a.shownum desc limit {$limit},{$row}"; } else { if ($type == 'theme') { $themeid = $refObj->Fields['themeid']; if (empty($themeid)) { return ''; } $sql = "select a.*,b.hotelrank,a.price as price from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' and FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc,a.shownum desc limit {$limit},{$row}"; } else { if ($type == 'top') { if ($flag == 'recommend') { $sql = "select {$basefield},b.displayorder,b.isding,b.isjian,b.istejia,a.ishidden,a.price from #@__hotel a left join #@__allorderlist b on(a.id=b.aid and b.typeid=2) where a.ishidden='0' order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'special') { $sql = "select {$basefield},b.displayorder,b.isding,b.isjian,b.istejia as istehui,a.ishidden from #@__hotel a left join #@__allorderlist b on(a.id=b.aid and b.typeid=2) order by case when b.displayorder is null then 9999 end,b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'hot') { $sql = "select a.*,b.hotelrank,a.price as price from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' group by a.title order by a.shownum desc,a.modtime desc,a.addtime desc limit {$limit},{$row}"; } else { if ($flag == 'relative') { $kindlist = $refObj->Fields['kindlist']; $maxkindid = array_remove_value($kindlist); //最后一级. $maxkindid = empty($maxkindid) ? $GLOBALS['dest_id'] : $maxkindid; $maxkindid = empty($maxkindid) ? 0 : $maxkindid; $where = " FIND_IN_SET({$maxkindid},a.kindlist) "; //排序顺序:置顶+tag关联》排序+ tag关联》最新更新+tag关联 $sql = "select a.*,b.hotelrank from #@__hotel a left join #@__hotel_rank b on (a.hotelrankid=b.aid and a.webid=b.webid) where a.ishidden='0' and {$where} order by a.modtime desc,a.addtime desc limit {$limit},{$row} "; } else { return ''; } } } } } } } } } $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $urlname = GetPinyin($row['kindname']); $flag != "channel" ? $webroot = GetWebURLByWebid($row['webid']) : ""; $row['url'] = GetWebURLByWebid($row['webid']) . "/hotels/show_{$row['aid']}.html"; $row['title'] = $row['title']; //$row['price']=empty($row['price'])?GetHotelMinPrice($row['webid'],$row['aid']):$row['price']; $row['kindname'] = getHotelKindCity2($row['kindlist']); $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 2); //评论次数 $row['sellnum'] = Helper_Archive::getSellNum($row['id'], 2) + $row['bookcount']; //销售数量 $row['satisfyscore'] = Helper_Archive::getSatisfyScore($row['id'], 2); //满意度 $row['listingprice'] = getHotelSellPrice2($row['id']); //挂牌价 $row['price'] = Helper_Archive::getHotelMinPrice($row['id']); $row['sellprice'] = empty($row['price']) ? '0' : $row['price']; $row['price2'] = empty($row['price']) ? '电询' : '¥' . $row['price'] . '起'; //样式2 $row['price3'] = empty($row['price']) ? '电询' : '<strong>¥' . $row['price'] . '</strong><span>起</span>'; $row['price4'] = empty($row['price']) ? '电询' : '<span>¥</span><strong>' . $row['price'] . '</strong><i>起</i>'; //目的地页面用 $row['price'] = empty($row['price']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>¥</span>" . $row['price'] . "<span>起</span>"; $litpic = getUploadFileUrl($row['litpic']); $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic'])); $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic'])); $row['litpic'] = $litpic; $row['typeurl'] = $GLOBALS['cfg_cmsurl'] . "/hotels/{$urlname}_{$row['id']}.html"; foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if (!empty($row[$ctag->GetName()])) { $ctp->Assign($tagid, $row[$ctag->GetName()]); } else { $ctp->Assign($tagid, ''); } } } $revalue .= $ctp->GetResult(); } return $revalue; }