From 53c820faa0026da19f809d8acc39744d36d1c419 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 25 Jul 2013 09:13:57 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0wsn=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=BC=B9=E7=AA=97=E6=8E=A7=E4=BB=B6=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=8D=E5=8A=A1=E9=80=89=E6=8B=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 46 +++++++- .../default/views/scripts/data/view.phtml | 10 +- .../default/views/scripts/heihe/view.phtml | 13 ++- application/models/data/DataService.php | 35 ++++++ .../models/order/mount/OrderOperate.php | 4 +- htdocs/js/lib/custom/models/dataservice.js | 100 ++++++++++++++++++ 6 files changed, 201 insertions(+), 7 deletions(-) create mode 100644 application/models/data/DataService.php create mode 100644 htdocs/js/lib/custom/models/dataservice.js diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 44f628fe..422fdee2 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -668,6 +668,9 @@ class DataController extends Zend_Controller_Action $fund = new Fund($this->db); $this->view->fund = $fund->fetch($uuid); + //判断特殊数据服务 + $this->view->dataService= $this->checkDataService($uuid); + //自动跳转 $sql="select s.* from datasource d left join source s on d.sourceid=s.id where d.uuid=?"; $row=$this->db->fetchRow($this->db->quoteInto($sql,$uuid)); @@ -677,7 +680,48 @@ class DataController extends Zend_Controller_Action { $this->_helper->viewRenderer($row->code.'/view',null,true); } - } //viewAction + } //viewAction + + //检查特殊数据服务是否存在 + private function checkDataService($uuid) + { + $order = new \order\mount\OrderOperate(); + $service = $order->getDataService($uuid); + + if(empty($service)) + { + return NULL; + }else{ + if($order->checkOrderHas($uuid)) + { + return NULL; + }else{ + return $service; + } + } + }//checkDataService + + //特殊数据服务 + public function dataserviceAction() + { + $uuid = $this->_getParam('uuid'); + + if(empty($uuid)) + { + $this->jsonexit(array("error"=>"参数错误")); + } + + $dataservice = new \data\DataService(); + $info = $dataservice->get($uuid); + + //暂时只有wsn + $data = array( + "type"=>"wsn", //服务类型 + "info"=>$info, //信息 dataservice 表中的字段 + "callback"=>"" //成功后的js回调函数 + ); + + } /* getversionAction() 获取数据版本 diff --git a/application/default/views/scripts/data/view.phtml b/application/default/views/scripts/data/view.phtml index 17f010d0..755772e4 100755 --- a/application/default/views/scripts/data/view.phtml +++ b/application/default/views/scripts/data/view.phtml @@ -336,9 +336,13 @@ endforeach; 在线下载 - - 放入数据篮 - + dataService)) { ?> + + + + + 放入数据篮 + 收藏此数据 diff --git a/application/default/views/scripts/heihe/view.phtml b/application/default/views/scripts/heihe/view.phtml index 20f54780..b8d819e7 100755 --- a/application/default/views/scripts/heihe/view.phtml +++ b/application/default/views/scripts/heihe/view.phtml @@ -11,6 +11,9 @@ $this->headLink()->appendStylesheet('/css/water.css'); $this->theme->AppendPlus($this,'google_map_v3'); $this->theme->AppendPlus($this,'colorbox'); + if(!empty($this->dataService)) { + $this->theme->AppendModel($this,"dataservice"); + } ?> render('breadcrumbs.phtml') ?>