修改了下载时用来判断的键值

添加了用户下载记录中查看详细信息的功能
This commit is contained in:
Li Jianxuan 2011-09-20 03:57:39 +00:00
parent 67e84288ef
commit 97a52d7257
3 changed files with 692 additions and 691 deletions

View File

@ -406,7 +406,7 @@ class Admin_DownController extends Zend_Controller_Action
elseif($show)
{
$select=$this->db->select();
$select->from('dataorder as o',array('id','ts_created','userid','offlineappid'))
$select->from('dataorder as o',array('id','ts_created','userid','offlineappid','onlineappid'))
->joinLeft('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->joinLeft('users as u','u.id=o.userid',array('realname as username'))
->where('o.userid = ?', $show)

View File

@ -45,6 +45,7 @@
<td><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><img src="/images/data.gif" /></a><a href="/admin/down/data/show/<?php echo $item['uuid'];?>"><?php echo $item['title'];?></a></td>
<td><?php echo date('Y-m-d H:i:s', strtotime($item['ts_created'])); ?></td>
<td>
<?php if($item['onlineappid']>0){echo '<a href="/admin/down/online/show/'.$item['onlineappid'].'">详细</a>';} ?>
<?php if ($item['offlineappid']>0) : ?>
<a href='/admin/down/offline/show/<?php echo $item['offlineappid'];?>'>详细</a>
<?php endif; ?>

View File

@ -853,7 +853,7 @@ class DataController extends Zend_Controller_Action
}
else
{
$sql="select onlineappid from dataorder where userid='$userid' and uuid='$uuid'";
$sql="select onlineappid,id from dataorder where userid='$userid' and uuid='$uuid' order by id desc";
$re=$this->db->query($sql);
$row=$re->fetch();
if(empty($row['onlineappid']))
@ -866,7 +866,7 @@ class DataController extends Zend_Controller_Action
try {$this->db->insert('dataorder',$data);} catch (Exception $e) {}
}else
{
$sql="update dataorder set onlineappid='$onlineappid' where userid='$userid' and uuid='$uuid'";
$sql="update dataorder set onlineappid='$onlineappid' where id='{$row['id']}'";
try {$this->db->exec($sql);} catch (Exception $e) {}
}
}