分离在线和离线用途信息

This commit is contained in:
wlx 2011-12-03 08:36:38 +00:00
parent d52d49a88b
commit 704116c7e6
2 changed files with 5 additions and 2 deletions

View File

@ -609,7 +609,7 @@ class DataController extends Zend_Controller_Action
$sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10";
$this->view->related=$this->db->fetchAll($sql,array($id,$id));
//用户下载记录
$sql = "select o.ts_created,m.uuid,u.realname,u.unit,(oa.project || fa.project ) as project
$sql = "select o.ts_created,m.uuid,u.realname,u.unit,oa.project as onlineproject, fa.project as offlineproject
from dataorder as o left join metadata as m on o.uuid = m.uuid left join users as u on o.userid=u.id
left join onlineapp oa on o.onlineappid=oa.id left join offlineapp fa on o.offlineappid=fa.id
where m.uuid = '$uuid' and (o.status=0 or o.status=5) and u.realname IS NOT NULL order by o.ts_created desc limit 10";

View File

@ -257,7 +257,10 @@ endforeach;
<?php
foreach($this->downhistory as $v){
echo '<li>'.date("Y-m-d",strtotime($v->ts_created))." ".$v->unit." ".$v->realname;
if (!empty($v->project)) echo ' 用途:'.$v->project;
if (!empty($v->offlineproject))
echo ' 用途:'.$v->offlineproject;
elseif (!empty($v->onlineproject))
echo ' 用途:'.$v->onlineproject;
echo '</li>';
}
?>