瀏覽代碼

certs admin finish

huangdong 6 年之前
父節點
當前提交
afc34ce999
共有 2 個文件被更改,包括 26 次插入2 次删除
  1. 12 1
      admin/control/index.php
  2. 14 1
      admin/templates/default/layout/index_layout.php

+ 12 - 1
admin/control/index.php

@@ -21,13 +21,24 @@ class indexControl extends SystemControl
 		Tpl::output('admin_info',$this->getAdminInfo());
 		//输出菜单
 		$this->getNav('',$top_nav,$left_nav,$map_nav);
+		$this->init_notice($notice);
 		Tpl::output('top_nav',$top_nav);
 		Tpl::output('left_nav',$left_nav);
 		Tpl::output('map_nav',$map_nav);
-
+		Tpl::output('notice',$notice);
 		Tpl::showpage('index','index_layout');
 	}
 
+	private function init_notice(&$notice)
+    {
+	    $certs = Model('room')->roomCerts(['cstatus'=>0],'cert_id',false);
+	    if(empty($certs)){
+            $notice['certs_num'] = 0;
+        }else{
+            $notice['certs_num'] = count($certs);
+        }
+    }
+
 	/**
 	 * 退出
 	 */

+ 14 - 1
admin/templates/default/layout/index_layout.php

@@ -280,4 +280,17 @@ function addFavorite(url, title) {
   </tbody>
 </table>
 </body>
-</html>
+<script>
+    init_notice();
+
+    function init_notice(){
+        var room_certs = "<?php echo $output['notice']['certs_num']; ?>";
+
+        if(room_certs > 0) {
+            var html = '<span>群聊('+room_certs+')</span>';
+            $("#nav_room").html(html);
+        }
+    }
+
+</script>
+</html>