From 867b746458fa7b02471009e5bc7a7176dae2bc78 Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 24 Jun 2014 23:58:46 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A6=BB=E7=BA=BF=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/module/Order/Order.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/module/Order/Order.php b/application/module/Order/Order.php index 187a4ad3..909aca04 100644 --- a/application/module/Order/Order.php +++ b/application/module/Order/Order.php @@ -152,10 +152,14 @@ class Order { $uid = view::User('id'); } + + $sql = "select count(*) as cnt from dataorder where status=1 and uuid in (select uuid from en.mdstatus) and userid=".$uid; + $row=$this->db->FetchRow($sql); + if ($row['cnt']>=$this->config->download->max) return "Reached the maximum limits of one offline application. Please remove some data."; if($id == -1) { - $sql = $this->db->quoteInto("update dataorder set status=2 where status=1 and userid=?",$uid); + $sql = $this->db->quoteInto("update dataorder set status=2 where status=1 and uuid in (select uuid from en.mdstatus) and userid=?",$uid); if($this->db->exec($sql)) { return true; @@ -166,7 +170,7 @@ class Order if($id > 0) { - $sql = $this->db->quoteInto("update dataorder set status=2 where status=1 and userid=$uid and id=?",$id); + $sql = $this->db->quoteInto("update dataorder set status=2 where status=1 and uuid in (select uuid from en.mdstatus) and userid=$uid and id=?",$id); if($this->db->exec($sql)) { return true;