diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 8b89978a..8ca65dc5 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1003,7 +1003,7 @@ class DataController extends Zend_Controller_Action } else { - $sql="select onlineappid,id from dataorder where userid='$userid' and uuid='$uuid' order by id desc"; + $sql="select onlineappid,id from dataorder where status=0 and userid='$userid' and uuid='$uuid' order by id desc"; $re=$this->db->query($sql); $row=$re->fetch(); if(empty($row['onlineappid'])) @@ -1011,12 +1011,13 @@ class DataController extends Zend_Controller_Action $data = array( 'userid' => $userid, 'uuid' => $uuid, - 'onlineappid'=> $onlineappid, + 'onlineappid'=> $onlineappid, + 'ts_approved'=>'now()', ); try {$this->db->insert('dataorder',$data);} catch (Exception $e) {} }else { - $sql="update dataorder set onlineappid='$onlineappid' where id='{$row['id']}'"; + $sql="update dataorder set onlineappid='$onlineappid',ts_approved=now() where id='{$row['id']}'"; try {$this->db->exec($sql);} catch (Exception $e) {} } } @@ -1107,12 +1108,12 @@ class DataController extends Zend_Controller_Action @$this->view->links=$links; //更新下载记录 //todo: 尝试添加一个RULE:若有对应数据存在,则不插入( userid,uuid,status=0,ts_approved:null) - $sql="select * from dataorder where userid=? and uuid=? and status=0 and (ts_approved is null)"; + /*$sql="select * from dataorder where userid=? and uuid=? and status=0 and (ts_approved is null)"; $u=$this->db->fetchRow($sql,array($userid,$uuid)); if (empty($u)) { $sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())"; $this->db->query($sql,array($userid,$uuid)); - } + }*/ } /* * 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表