ss 1 năm trước cách đây
mục cha
commit
f539cdf261

+ 0 - 1
application/admin/view/index/index.html

@@ -492,7 +492,6 @@
                                 </a>
                             </div>
                             <div class="col-xs-12" style="padding: 0 5px!important;">
-
                                 <a href="{:url('index/indexsub',['curmenu'=>1,'menuId'=>41,'curmenuId'=>503,'ct'=>1])}">
                                     <div class="tj-info2">
                                         视频监控

+ 1 - 1
application/api/controller/ue/Energy.php

@@ -320,7 +320,7 @@ class Energy extends Base {
 
     // 监控
     public function monitor(){
-        $lists = Db::name('energy_monitor')->where('org_id',$this->orgId)->where('del',0)->field('id,title,ueid')->select();
+        $lists = Db::name('monitor')->where('org_id',$this->orgId)->where('del',0)->field('id,title,ueid')->select();
         foreach ($lists as $k=>$v){
             $lists[$k]['url'] = url('h5/Index/monitor',['id'=>think_encrypt($v['id'])],false,true);
         }

+ 30 - 9
application/common/model/Article.php

@@ -17,20 +17,41 @@ class Article extends Base
             $this->error = validate($this->validateName)->getError();
             return false;
         }
-        if($data['type']!=2){
+
+        if($data['type'] == 1){ // pdf
             if(empty($data['path'])){
                 $this->error = '文件不能为空';
                 return false;
             }
-            if($data['type']==1){
-                $s = explode('.',$data['path']);
-                $a = $s[count($s)-1];
-                if($a!='pdf'){
-                    $this->error = '只能上传pdf文件';
-                    return false;
-                }
-            }
 
+            $s = explode('.',$data['path']);
+            $a = $s[count($s)-1];
+            if($a!='pdf'){
+                $this->error = '只能上传pdf文件';
+                return false;
+            }
+        }else if($data['type'] == 3){
+            if(empty($data['video'])){
+                $this->error = '文件不能为空';
+                return false;
+            }
+            $s = explode('.',$data['video']);
+            $a = $s[count($s)-1];
+            if($a!='mp4'){
+                $this->error = '只能上传mp4文件';
+                return false;
+            }
+        }else if($data['type'] == 4){
+            if(empty($data['audio'])){
+                $this->error = '文件不能为空';
+                return false;
+            }
+            $s = explode('.',$data['audio']);
+            $a = $s[count($s)-1];
+            if($a!='mp3'){
+                $this->error = '只能上传mp3文件';
+                return false;
+            }
         }
 
         $id = $data['id'];