Exemplo n.º 1
0
    $GLOBALS['condition']['_hasbeibao'] = 1;
}
if (in_array(8, $paytypeArr)) {
    $GLOBALS['condition']['_hasweixin'] = 1;
}
if (is_array($row)) {
    $row['enddatetime'] = date('Y/m/d H:i:s', $row['endtime']);
    //截止时间
    $row['discount'] = floor($row['price'] / $row['sellprice'] * 100) / 10;
    //折扣
    $row['piclist'] = getImgList($row['piclist']);
    //获取轮播图片
    $row['seokeyword'] = empty($row['keyword']) ? '' : "<meta name=\"keywords\" content=\"{$row['keyword']}\"/>";
    $row['seodescription'] = empty($row['description']) ? '' : "<meta name=\"description\" content=\"{$row['description']}\"/>";
    $row['seotitle'] = empty($row['seotitle']) ? $row['title'] : $row['seotitle'];
    $row['booknum'] = Helper_Archive::getSellNum($row['id'], 13) + $row['virtualnum'];
    $row['typename'] = GetTypeName($typeid);
    $row['satisfyscore'] = empty($row['satisfyscore']) ? $row['satisfyscore'] : $row['satisfyscore'] . '%';
    foreach ($row as $k => $v) {
        $pv->Fields[$k] = $v;
        //模板变量赋值
    }
}
$templets = $row['templet'];
if (strpos($templets, 'uploadtemplets') !== false) {
    $templet = SLINETEMPLATE . '/smore/' . $templets . '/index.htm';
    //使用自定义模板
} else {
    $templet = SLINETEMPLATE . "/" . $cfg_df_style . "/" . "tuan/tuan_show.htm";
    //系统标准模板
}
Exemplo n.º 2
0
//根据目的地id获取相应的线路(线路首页用)
if ($dopost == 'getLineByDestId') {
    $where = " where a.ishidden=0 and FIND_IN_SET({$dest_id},a.kindlist)";
    $leftjoin = "left join #@__kindorderlist b on(a.id = b.aid and b.classid = {$dest_id} and b.typeid=1)";
    $sql = "select a.* from #@__line a {$leftjoin} {$where} order by b.isding desc,b.isjian desc,case when b.displayorder is null then 9999 end,b.displayorder asc,a.addtime desc limit 0,6";
    $arr = $dsql->getAll($sql);
    $out = $left = $right = '';
    $k = 1;
    foreach ($arr as $row) {
        $url = GetWebURLByWebid($row['webid']) . '/lines/show_' . $row['aid'] . '.html';
        $litpic = getUploadFileUrl($row['litpic']);
        $startcity = getStartCityName($row['startcity']);
        $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">
Exemplo n.º 3
0
 $row['bigpiclist'] = $pic_arr[0];
 //大图
 $row['thumblist'] = $pic_arr[1];
 //获取后台满意度拼接%
 // $row['satisfyscore'] = !empty($row['satisfyscore'])?$row['satisfyscore'] : "";
 if (!empty($row['satisfyscore'])) {
     if (strpos($row['satisfyscore'], '%') === false) {
         $row['satisfyscore'] = $row['satisfyscore'] . '%';
     }
 }
 //$row['price']=!empty($row['lineprice'])?"<span class=\"rmb_1\">¥</span>".$row['lineprice']."</span>":"电询</span>";
 $row['storeprice'] = !empty($row['storeprice']) ? $row['storeprice'] : "<span>无</span>";
 $row['seodescription'] = !empty($row['description']) ? "<meta name=\"description\" content=\"" . $row['description'] . "\"/>" : "";
 $row['seokeyword'] = !empty($row['keyword']) ? "<meta name=\"keywords\" content=\"" . $row['keyword'] . "\"/>" : "";
 $row['seotitle'] = !empty($row['seotitle']) ? $row['seotitle'] : $row['title'];
 $row['sellnum'] = Helper_Archive::getSellNum($row['id'], 1) + $row['bookcount'];
 //销售数量
 $row['lineseries'] = getSeries($row['id'], '01');
 //编号
 $row['pkname'] = get_par_value($row['kindlist'], $typeid);
 //上一级
 //$row['pkname'] = getOrderKindlist($row['kindlist'],$typeid);
 $GLOBALS['lineattach'] = $row['linedoc'] ? $row['linedoc'] : '';
 //支付方式
 $paytypeArr = explode(',', $GLOBALS['cfg_pay_type']);
 if (in_array(1, $paytypeArr)) {
     $GLOBALS['condition']['_haszhifubao'] = 1;
 }
 if (in_array(2, $paytypeArr)) {
     $GLOBALS['condition']['_haskuaiqian'] = 1;
 }
Exemplo n.º 4
0
function lib_getlinelist(&$ctag, &$refObj)
{
    global $startcity;
    global $dsql;
    include SLINEDATA . "/webinfo.php";
    $attlist = "row|8,flag|,type|top,sonid|,limit|0,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $webid = 0;
    $innertext = trim($ctag->GetInnertext());
    $revalue = '';
    $basefield = "a.aid,a.id,a.webid,a.title,a.seotitle,a.sellpoint,a.litpic,a.storeprice,a.price,a.linedate,a.features,a.transport,a.lineday,a.startcity,a.overcity,a.shownum,a.satisfyscore,a.bookcount,a.attrid,a.kindlist,a.color,a.iconlist";
    if ($type == 'top' && empty($flag)) {
        return '';
    }
    //如果调用二级栏目则必须在显示类里指定sonid
    $limit = !empty($limit) ? $limit : 0;
    if ($type == 'startcity') {
        $sql = "select  {$basefield} from #@__line as a left join #@__kindorderlist as c on (a.id=c.aid) where a.ishidden=0 and c.typeid=1 and startcity='{$startcity}' and c.classid={$sonid} and FIND_IN_SET({$sonid},a.kindlist) {$orderby}  limit {$limit},{$row}";
    }
    if ($type == 'mdd') {
        if ($flag == 'hot') {
            $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc';
        } else {
            if ($flag == 'recommend') {
                $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc';
            } else {
                if ($flag == 'specical') {
                    $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc ';
                } else {
                    $orderby = 'order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc';
                }
            }
        }
        $sonid = isset($definekind) ? $definekind : $refObj->Fields['kindid'];
        //这里增加子站的判断
        if ($GLOBALS['sys_child_webid'] != 0) {
            $dest_id = $GLOBALS['sys_child_webid'];
        }
        $sonid = $sonid ? $sonid : $dest_id;
        $shownum = isset($row) ? $row : $refObj->Fields['shownum'];
        $shownum = empty($shownum) ? 6 : $shownum;
        if (isset($sonid)) {
            $number = isset($refObj->Fields['shownumber']) ? $refObj->Fields['shownumber'] : $row;
            //如果模块设置了显示数量则使用.
            $sql = "select {$basefield},c.isjian,c.istejia,c.isding  from #@__line as a left join #@__kindorderlist as c on (c.classid={$sonid} and a.id=c.aid  and c.typeid=1) where a.ishidden=0 and  FIND_IN_SET({$sonid},a.kindlist) {$orderby}  limit {$limit},{$shownum}";
        } else {
            return '';
        }
    } else {
        if ($type == 'searchrec') {
            if ($GLOBALS['childid'] != 0) {
                $kchild = $GLOBALS['childid'];
                $sql = "select  distinct {$basefield}  from #@__line as a left join #@__kindorderlist as c on (c.classid={$kchild} and a.id=c.aid  and c.typeid=1) where a.ishidden=0 and c.isjian=1 and FIND_IN_SET({$kchild},a.kindlist) order by case when c.displayorder is null then 9999 end,c.displayorder asc,a.modtime desc,a.addtime desc  limit 0,4";
            } else {
                $sql = "select {$basefield} a from #@__line where a.ishidden=0 and a.isjian=1  order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
            }
        } else {
            if ($type == 'destsearchrec') {
                if ($GLOBALS['destid'] != 0) {
                    $kchild = $GLOBALS['destid'];
                    $sql = "select {$basefield} from #@__line as a left join #@__kindorderlist as c on (c.classid={$kchild} and a.id=c.aid  and c.typeid=1) where  a.ishidden=0 and FIND_IN_SET({$kchild},a.kindlist) {$orderby}  limit 0,4";
                } else {
                    $sql = "select {$basefield} from #@__line a where a.ishidden=0 and a.isjian=1  order by a.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
                }
            } else {
                if ($type == 'top') {
                    if ($flag == 'recommend') {
                        $sql = "select {$basefield},b.isding,b.istejia,b.displayorder from #@__line as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=1) 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 == 'specical') {
                            $sql = "select {$basefield},b.isding,b.istejia,b.displayorder from #@__line as a left join #@__allorderlist b on (a.id=b.aid and b.typeid=1) where a.ishidden=0 order by b.displayorder asc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
                        } else {
                            if ($flag == 'hot') {
                                $sql = "select {$basefield} from #@__line a where a.ishidden=0  order by a.shownum desc,a.modtime desc,a.addtime desc limit {$limit},{$row}";
                            } else {
                                if ($flag == 'attribute') {
                                    if (empty($attrid)) {
                                        $attrid = $refObj->Fields['attrid'];
                                    }
                                    $sql = "select {$basefield} from #@__line a where FIND_IN_SET('{$attrid}',a.attrid) and a.ishidden=0  order by a.displayorder asc,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) ";
                                        $sql = "select {$basefield} from #@__line a where {$where} and a.ishidden=0 order by a.shownum desc,a.modtime desc,a.addtime desc limit 0,{$row}";
                                    } else {
                                        if ($flag == 'listexcept') {
                                            $sql = "select aid from #@__line where isjian=1 and a.ishidden=0 order by isjian desc,displayorder asc limit 0,5";
                                            $dsql->Execute("list", $sql);
                                            $a = "";
                                            while ($str = $dsql->GetArray("list")) {
                                                $a .= $str["aid"] . ",";
                                            }
                                            $a = substr($a, 0, -1);
                                            if (!$a == "") {
                                                $a = "and aid not in ({$a})";
                                            }
                                            $sql = "select {$basefield} from #@__line a where {$a} order by  a.shownum desc limit {$limit},{$row}";
                                        }
                                    }
                                }
                            }
                        }
                    }
                } else {
                    if ($type == 'theme') {
                        $themeid = $refObj->Fields['themeid'];
                        if (empty($themeid)) {
                            return '';
                        }
                        $sql = "select {$basefield} from #@__line a where a.ishidden=0 and FIND_IN_SET({$themeid},a.themelist) order by a.modtime desc,a.addtime desc limit 0,{$row}";
                    } else {
                        if ($type = "day") {
                            $dayid = $refObj->Fields['groupid'];
                            if (empty($dayid)) {
                                return '';
                            }
                            $sql = "select {$basefield} from #@__line a where a.ishidden=0 and a.lineday={$dayid} order by a.modtime desc,a.addtime desc limit 0,{$row}";
                        }
                    }
                }
            }
        }
    }
    $dsql->SetQuery($sql);
    $dsql->Execute();
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    $num = 0;
    while ($row = $dsql->GetArray()) {
        $GLOBALS['autoindex']++;
        $webroot = GetWebURLByWebid($row['webid']);
        $url = $webroot . "/lines/show_{$row['aid']}.html";
        $row['url'] = $url;
        $row['bookurl'] = "{$webroot}/lines/booking_{$row['aid']}.html";
        $startcity = getStartCityName($row['startcity']);
        $startcity = !empty($startcity) ? "[{$startcity}出发]" : '';
        if (!empty($GLOBALS['cfg_startcity_open'])) {
            $row['title'] = "{$startcity}{$row['title']}";
        } else {
            $row['title'] = "{$row['title']}";
        }
        $row['startcity'] = $startcity;
        $row['color'] = !empty($row['color']) ? "color:{$row['color']}" : '';
        $real = getLineRealPrice($row['aid'], $row['webid']);
        $row['lineprice'] = $real ? $real : $row['price'];
        $row['commentnum'] = Helper_Archive::getCommentNum($row['id'], 1);
        //评论次数
        $row['sellnum'] = Helper_Archive::getSellNum($row['id'], 1);
        //销售数量
        //$row['satisfyscore']=Helper_Archive::getSatisfyScore($row['id'],1); //满意度
        //获取后台满意度拼接%
        $row['satisfyscore'] = !empty($row['satisfyscore']) ? $row['satisfyscore'] . "%" : "";
        if (!empty($row['lineprice']) && !empty($row['storeprice'])) {
            $row['discount'] = abs((int) $row['storeprice'] - (int) $row['price']);
        } else {
            $row['discount'] = 0;
        }
        $row['price'] = empty($row['lineprice']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>&yen;</span><span class='rmb_2'>" . $row['lineprice'] . '</span>';
        $row['price2'] = empty($row['lineprice']) ? '<span>电询</span>' : '<span>&yen;</span><strong>' . $row['lineprice'] . '</strong><i>起</i>';
        $row['agentprice'] = intval($row['storeprice']);
        $row['sellprice'] = empty($row['lineprice']) ? '0' : $row['lineprice'];
        //没有HTML标识的价格
        $row['storeprice'] = !empty($row['storeprice']) ? "<span class=\"rmb_2\">&yen;</span>" . $row['storeprice'] : "<span class=\"rmb_1\">电询</span>";
        $row['lineseries'] = getSeries($row['id'], '01');
        //$row['lit240']=getPicByName($row['linepic'],'lit240');
        //$row['lit160']=getPicByName($row['linepic'],'lit160');
        $row['litpic'] = getUploadFileUrl($row['litpic']);
        $row['lit240'] = getUploadFileUrl(str_replace('litimg', 'lit240', $row['litpic']));
        $row['lit160'] = getUploadFileUrl(str_replace('litimg', 'lit160', $row['litpic']));
        $row['jifentprice'] = !empty($row['jifentprice']) ? '&yen;' . $row['jifentprice'] : '无';
        $row['startdate'] = getLine_StartDate($row);
        //团期
        $row['jifentprice'] = MLine::getMinTprice($row['id']);
        $row['list'] = $num;
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                $ctp->Assign($tagid, $row[$ctag->GetName()]);
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
Exemplo n.º 5
0
/**
 * 调用团购显示数据标签
 *
 * @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;
}
Exemplo n.º 6
0
/**
 * 调用酒店数据标签
 *
 * @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']) ? '电询' : '&yen;' . $row['price'] . '起';
        //样式2
        $row['price3'] = empty($row['price']) ? '电询' : '<strong>&yen;' . $row['price'] . '</strong><span>起</span>';
        $row['price4'] = empty($row['price']) ? '电询' : '<span>&yen;</span><strong>' . $row['price'] . '</strong><i>起</i>';
        //目的地页面用
        $row['price'] = empty($row['price']) ? '<span class="rmb_1">电询</span>' : "<span class='rmb_1'>&yen;</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;
}
Exemplo n.º 7
0
    $pv->Fields['seodescription'] = !empty($destinfo['description']) ? "<meta name=\"description\" content=\"" . $destinfo['description'] . "\"/>" : "";
    $pv->Fields['seotitle'] = !empty($destinfo['seotitle']) ? $destinfo['seotitle'] : $pv->Fields['seotitle'];
}
if (!empty($dest_id)) {
    $where .= " and find_in_set({$dest_id},a.kindlist)";
}
if (!empty($attrid)) {
    $attrid_arr = explode(',', $attrid);
    foreach ($attrid_arr as $k => $v) {
        $where .= " and find_in_set({$v},a.attrid)";
    }
}
$mianbao = getTuanMianBao($dest_id);
$destlist = getTuanChildDest($dest_id);
//获取上级开启了导航的目的地
getTopNavDest($dest_id);
$virtual_arr = $dsql->GetOne("select sum(ifnull(virtualnum,0)) as number from #@__tuan");
$booknum = Helper_Archive::getSellNum(0, 13) + $virtual_arr['number'];
$sql = "select a.* from #@__tuan a left join #@__allorderlist b on (a.id=b.aid and b.typeid={$typeid} and a.webid=b.webid) where {$where} order by ifnull(b.displayorder,9999) asc,a.addtime desc";
$pv->pagesize = 16;
//分页条数.
$pv->SetSql($sql);
$pv->SetParameter('dest_id', $dest_id);
$pv->SetParameter('status', $status);
$pv->SetParameter('attrid', $attrid);
$templet = Helper_Archive::getUseTemplet('tuan_index');
//获取首页使用模板
$templet = !empty($templet) ? $templet : SLINETEMPLATE . "/" . $cfg_df_style . "/" . "tuan/" . "tuan_index.htm";
$pv->SetTemplet($templet);
$pv->Display();
exit;