From 91d0989216e5adae09ecc73a12fb33ed46fc38bc Mon Sep 17 00:00:00 2001 From: wlx Date: Sat, 7 Jan 2012 11:06:27 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E5=9C=A8=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=AE=B0=E5=BD=95=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=8D=B3=E7=BC=BA=E5=B0=91=E5=AF=B9=E5=BA=94onlineapp?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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)); - } + }*/ } /* * 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表