function getPiaoDetail($spotid, $tickettypeid, $kindname) { Helper_Archive::loadModule('common'); $_model = new CommonModule('#@__spot_ticket'); $arr = $_model->getAll("spotid='{$spotid}' and tickettypeid='{$tickettypeid}' and number!=0", "displayorder asc"); $out = ''; foreach ($arr as $row) { $savemoney = $row['sellprice'] - $row['ourprice']; $award1 = !empty($row['jifentprice']) ? $row['jifentprice'] : '无'; $award2 = !empty($row['jifenbook']) ? $row['jifenbook'] : '无'; $award3 = !empty($row['jifencomment']) ? $row['jifencomment'] : '无'; $bookurl = "booking.php?spotid={$row['spotid']}&ticketid={$row['id']}"; $out .= '<dl> <dt class="dl_title"><a href="javascript:void()">' . $row['title'] . '</a></dt> <dd class="dd1">¥' . $row['sellprice'] . '</dd> <dd class="dd2">¥' . $row['ourprice'] . '</dd> <dd class="dd3"><span>' . $award1 . '</span></dd> <dd class="dd4"><span>' . $award2 . '</span></dd> <dd class="dd5"><span>' . $award3 . '</span></dd> <dd class="dd6"><a href="' . $bookurl . '" class="btn_ding" data-ticketid="' . $row['id'] . '">预定</a></dd> </dl> <div class="con_hide"> <s class="s_bg"></s> <p>' . $row['description'] . '</p> </div>'; } return $out; }
function getNickName($mid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__member'); $membername = $model->getField('nickname', "mid='{$mid}'"); return $membername ? $membername : '匿名'; }
function getTemplet($spotid) { Helper_Archive::loadModule('common'); $_model = new CommonModule('#@__spot_ticket'); $arr = $_model->getAll("spotid='{$spotid}'"); $num = count($arr); $templet = $num > 0 ? 'spot_show_ticket.htm' : 'spot_show.htm'; return $templet; }
function getDestChildHtml($pid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__destinations'); $arr = $model->getAll("pid='{$pid}' and isopen=1", "displayorder asc"); $out = ''; foreach ($arr as $row) { $num = $model->getCount("pid='{$row['id']}'"); $class = $num ? " class='haschild'" : ""; $url = $GLOBALS['cfg_basehost'] . '/' . $row['pinyin'] . '/'; $out .= '<dd><a href="' . $url . '" target="_blank"' . $class . ' data-id="' . $row['id'] . '">' . $row['kindname'] . '</a></dd>'; } return $out; }
public function getMobileShowUrl($type, $aid) { $info = Helper_Archive::getSlineWebInfo(); if (!empty($info['webid'])) { $table = $this->tables[$type][0]; $where = "aid='{$aid}' and webid='{$info['webid']}'"; Helper_Archive::loadModule('common'); $model = new CommonModule($table); $id = $model->getField('id', $where); $url = $GLOBALS['cfg_basehost'] . '/shouji/' . $this->tables[$type][1] . '/show/id/' . $id; } else { //子战跳转 $table = $this->tables[$type][0]; $where = "aid='{$aid}' and webid='{$info['id']}'"; Helper_Archive::loadModule('common'); $model = new CommonModule($table); $id = $model->getField('id', $where); $url = $GLOBALS['cfg_basehost'] . '/shouji/' . $this->tables[$type][1] . '/show/id/' . $id; } return $url; }
function getHotelExistAttr($attrid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__hotel_attr'); $arr = explode(',', $attrid); $group = array(); foreach ($arr as $id) { $row = $model->getOne("id='{$id}'"); $attrname = $row['attrname']; $groupname = $model->getField('attrname', "id='{$row['pid']}'"); $group[$groupname][] = $attrname; } foreach ($group as $key => $value) { $out .= "<p>" . $key . ":" . implode(',', $value) . '</p>'; } return $out; }
function getPeopleGroup($suitid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__line_suit'); $group = $model->getOne("id='{$suitid}'", null, 'propgroup,jifentprice,jifenbook'); return $group; }
<?php require_once dirname(__FILE__) . "/../include/common.inc.php"; Helper_Archive::loadModule('common'); //获取相册信息 function getPhotoInfo($aid) { global $dsql; $sql = "select a.*,b.attrname from #@__photo a left join #@__photo_attr b on a.attrid=b.aid where a.aid={$aid} and a.webid='0'"; $row = $dsql->GetOne($sql); return $row; } //获取相册图片数量 function getPhotoNum($aid) { global $dsql; $sql = "select count(*) as num from #@__photo_picture where webid='0' and pid='{$aid}'"; $count = $dsql->GetOne($sql); return $count; } function getPD($type, $pid) { global $dsql; if ($type == 'pre') { $sql = "select max(id) as imgid from #@__photo_picture where pid='{$pid}' and webid='0'"; } else { if ($type == 'next') { $sql = "select min(id) as imgid from #@__photo_picture where pid='{$pid}' and webid='0'"; } } $row = $dsql->GetOne($sql);
function refundStorage($orderid, $op) { global $dsql; Helper_Archive::loadModule('common'); $_model = new CommonModule('#@__member_order'); $row = $_model->getOne("id='{$orderid}'"); if (isset($row)) { $dingnum = intval($row['dingnum']) + intval($row['childnum']); $suitid = $row['suitid']; $productid = $row['productautoid']; $typeid = $row['typeid']; $usedate = strtotime($row['usedate']); $storage_table = array('1' => 'sline_line_suit_price', '2' => 'sline_hotel_room_price', '3' => 'sline_car_suit_price', '5' => 'sline_spot_ticket', '8' => 'sline_visa', '13' => 'sline_tuan'); $table = $storage_table[$typeid]; //加库存 if ($op == 'plus') { if ($typeid == 1 || $typeid == 2 || $typeid == 3) { $sql = "update {$table} set number=number+{$dingnum} where day='{$usedate}' and suitid='{$suitid}'"; } else { $sql = "update {$table} set number=number+{$dingnum} where id={$productid}"; } } else { if ($op == 'minus') { if ($typeid == 1 || $typeid == 2 || $typeid == 3) { $sql = "update {$table} set number=number-{$dingnum} where day='{$usedate}' and suitid='{$suitid}'"; } else { $sql = "update {$table} set number=number-{$dingnum} where id={$productid}"; } } } $dsql->ExecNoneQuery($sql); } }
function getSuitNumberByDay($suitid, $day) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__car_suit_price'); $number = $model->getField('number', "day='" . strtotime($day) . "' and suitid=" . $suitid); return intval($number); }
function getExtendModelInfo($typeid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__model'); $row = $model->getOne("id='{$typeid}'"); return $row; }
function getLeftNav($where, $typeid) { Helper_Archive::loadModule('common'); $model = new CommonModule('#@__search'); $arr = array(array('typeid' => 1, 'channelname' => '线路'), array('typeid' => 2, 'channelname' => '酒店'), array('typeid' => 3, 'channelname' => '车辆'), array('typeid' => 4, 'channelname' => '攻略'), array('typeid' => 5, 'channelname' => '门票'), array('typeid' => 6, 'channelname' => '相册'), array('typeid' => 8, 'channelname' => '签证'), array('typeid' => 13, 'channelname' => '团购')); // $where = "title like'%{$keyword}%'"; //取得全部的查询数量 $allnum = $model->getCount($where); //全部数量 $out = array(); $out[] = array('channelname' => '全部', 'num' => $allnum, 'typeid' => 0); foreach ($arr as $row) { $wh = " ({$where}) and typeid = '{$row['typeid']}'"; $num = $model->getCount($wh); $out[] = array('channelname' => $row['channelname'], 'num' => $num, 'typeid' => $row['typeid']); } return $out; }
function getHotelService($attrid, $groupid) { global $dsql; Helper_Archive::loadModule('common'); $_model = new CommonModule('#@__hotel_attr'); $attr = explode(',', $attrid); foreach ($attr as $id) { $name = $_model->getField('attrname', "pid='{$groupid}' and id='{$id}'"); $out .= !empty($name) ? $name . '|' : ''; } return $out; }
function addInsurance($productcasecode, $bookordersn, $num, $memberid, $usedate, $lineday, $tourer) { global $dsql; $info = $dsql->GetOne("select * from #@__insurance where productcode='{$productcasecode}'"); if (empty($info)) { return false; } Helper_Archive::loadModule('common'); $curtime = time(); $model = new CommonModule('#@__insurance_booking'); $arr['bookordersn'] = $bookordersn; $arr['productcasecode'] = $productcasecode; $arr['insurednum'] = $num; $arr['memberid'] = $memberid; $arr['payprice'] = $info['ourprice'] * $num * $lineday; $arr['begindate'] = $usedate; $arr['enddate'] = date('Y-m-d', strtotime($usedate) + ($lineday - 1) * 24 * 3600); $arr['ordersn'] = 'INS' . $curtime . mt_rand(11, 99); $arr['addtime'] = $curtime; $arr['modtime'] = $curtime; $result = $model->add($arr); if ($result) { $index = 1; foreach ($tourer as $k => $v) { $insuredModel = new CommonModule('#@__insurance_booking_tourer'); $row = array(); $row['name'] = $v['tourername' . $index]; $row['sex'] = $v['tourersex' . $index] == '女' ? 0 : 1; $row['mobile'] = $v['tourermobile' . $index]; $row['cardcode'] = $v['tourercard' . $index]; $row['cardtype'] = getCardType($v['tourercardtype' . $index]); $row['orderid'] = $result; $row['count'] = 1; $row['insurantrelation'] = 6; $insuredModel->add($row); $index++; } } return $result; }