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

添加了用户下载记录中查看详细信息的功能
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

@ -20,13 +20,13 @@ class Admin_DownController extends Zend_Controller_Action
//离线数据申请管理 //离线数据申请管理
function offlineappAction() function offlineappAction()
{ {
$view=(int)$this->_getParam('view'); $view =(int)$this->_getParam('view');
$start=(int)$this->_getParam('start'); $start =(int)$this->_getParam('start');
$finish=(int)$this->_getParam('finish'); $finish =(int)$this->_getParam('finish');
$cancel=(int)$this->_getParam('cancel'); $cancel =(int)$this->_getParam('cancel');
$deny=(int)$this->_getParam('deny'); $deny =(int)$this->_getParam('deny');
$page=(int)$this->_getParam('page'); $page =(int)$this->_getParam('page');
$reset=(int)$this->_getParam('reset'); $reset =(int)$this->_getParam('reset');
if (!$page) $page=1; if (!$page) $page=1;
if ($view) { if ($view) {
@ -406,7 +406,7 @@ class Admin_DownController extends Zend_Controller_Action
elseif($show) elseif($show)
{ {
$select=$this->db->select(); $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('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->joinLeft('users as u','u.id=o.userid',array('realname as username')) ->joinLeft('users as u','u.id=o.userid',array('realname as username'))
->where('o.userid = ?', $show) ->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><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 echo date('Y-m-d H:i:s', strtotime($item['ts_created'])); ?></td>
<td> <td>
<?php if($item['onlineappid']>0){echo '<a href="/admin/down/online/show/'.$item['onlineappid'].'">详细</a>';} ?>
<?php if ($item['offlineappid']>0) : ?> <?php if ($item['offlineappid']>0) : ?>
<a href='/admin/down/offline/show/<?php echo $item['offlineappid'];?>'>详细</a> <a href='/admin/down/offline/show/<?php echo $item['offlineappid'];?>'>详细</a>
<?php endif; ?> <?php endif; ?>

View File

@ -853,7 +853,7 @@ class DataController extends Zend_Controller_Action
} }
else 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); $re=$this->db->query($sql);
$row=$re->fetch(); $row=$re->fetch();
if(empty($row['onlineappid'])) if(empty($row['onlineappid']))
@ -866,7 +866,7 @@ class DataController extends Zend_Controller_Action
try {$this->db->insert('dataorder',$data);} catch (Exception $e) {} try {$this->db->insert('dataorder',$data);} catch (Exception $e) {}
}else }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) {} try {$this->db->exec($sql);} catch (Exception $e) {}
} }
} }