function lib_getcommentlist(&$ctag, &$refObj) { global $dsql; $attlist = "row|5,flag|all,type|comment,level|0,limit|0,isproduct|0"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); //$commenthomeid=$refObj->Fields['commenthomeid']; //根据aid来获取当前aid的评论 //$commenthomeid=$refObj->Fields['aid']; //获取全部评论 if ($flag == 'all') { $where = 'where typeid!=4 and typeid !=6'; } else { if ($flag == 'line') { $where = 'where typeid = 1'; $commenthomeid = $refObj->Fields['id']; } else { if ($flag == 'hotel') { $where = 'where typeid = 2'; $commenthomeid = $refObj->Fields['id']; } else { if ($flag == 'car') { $where = 'where typeid = 3'; $commenthomeid = $refObj->Fields['id']; } else { if ($flag == 'spot') { $where = 'where typeid = 5'; $commenthomeid = $refObj->Fields['id']; } else { if ($flag == 'visa') { $where = 'where typeid = 8'; $commenthomeid = $refObj->Fields['id']; } else { if ($flag == 'tuan') { $where = 'where typeid = 13'; $commenthomeid = $refObj->Fields['aid']; } else { if ($flag == 'tongyong') { $typeid = $refObj->Fields['typeid']; if (empty($typeid)) { return ''; } $where = "where typeid = {$typeid}"; } } } } } } } } if ($level != 0) { $where .= " and level={$level}"; } if (!empty($commenthomeid)) { $where .= ' and articleid=' . $commenthomeid; } $where .= " and isshow=1 "; $sql = "select * from #@__comment {$where} order by addtime desc limit {$limit},{$row}"; if ($isproduct == 1) { $sql = "select * from #@__comment {$where} group by typeid,articleid order by addtime desc limit {$limit},{$row}"; } $innertext = trim($ctag->GetInnertext()); $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; $revalue = ''; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $awardinfo = getAwardInfo($row['orderid']); $row['jifentprice'] = $awardinfo['jifentprice']; $row['jifencomment'] = $awardinfo['jifencomment']; $row['jifenbook'] = $awardinfo['jifenbook']; $row['score'] = getScore($row); //分数 $row['nickname'] = getMemberName($row['memberid']); //昵称 $row['litpic'] = getMemberPic($row['memberid']); $row['pltime'] = Helper_Archive::formatAddTime($row['addtime']); //评论时间 $row['percent'] = 20 * $row['score'] . '%'; $row['percent1'] = 20 * $row['score1'] . '%'; $row['percent2'] = 20 * $row['score2'] . '%'; $row['percent3'] = 20 * $row['score3'] . '%'; $row['percent4'] = 20 * $row['score4'] . '%'; $row['productname'] = $row['typeid'] != '4' && $row['typeid'] != '6' ? getOrderName2($row['articleid'], $row['typeid'], '', $row['id']) : ''; if ($row['productname'] == '') { continue; } $row['sellnum'] = getSellNum($row['productautoid']); //销售数量 foreach ($ctp->CTags as $tagid => $ctag) { if ($ctag->GetName() == 'array') { $ctp->Assign($tagid, $row); } else { if ($row[$ctag->GetName()]) { $ctp->Assign($tagid, $row[$ctag->GetName()]); } } } $revalue .= $ctp->GetResult(); } return $revalue; }
function lib_getorderlist(&$ctag, &$refObj) { global $dsql; $attlist = "row|5,flag|all,limit|0"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); //获取全部订单 if ($flag == 'all') { $where = ''; } else { if ($flag == 'line') { $where = 'where typeid = 1'; } else { if ($flag == 'hotel') { $where = 'where typeid = 2'; } else { if ($flag == 'car') { $where = 'where typeid = 3'; } else { if ($flag == 'spot') { $where = 'where typeid = 5'; } else { if ($flag == 'visa') { $where = 'where typeid = 8'; } else { if ($flag == 'tuan') { $where = 'where typeid = 13'; } } } } } } } $sql = "select * from #@__member_order {$where} order by addtime desc limit {$limit},{$row}"; $innertext = trim($ctag->GetInnertext()); $dsql->SetQuery($sql); $dsql->Execute(); $ctp = new STTagParse(); $ctp->SetNameSpace("field", "[", "]"); $ctp->LoadSource($innertext); $GLOBALS['autoindex'] = 0; $revalue = ''; while ($row = $dsql->GetArray()) { $GLOBALS['autoindex']++; $row['nickname'] = getNickName($row['memberid']); //昵称 $row['dingtime'] = Helper_Archive::formatAddTime($row['addtime']); //预订时间 $row['productname'] = getProName($row['productautoid'], $row['typeid'], $row['productname']); 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()]); } } } $revalue .= $ctp->GetResult(); } return $revalue; }