lgy 5 år sedan
förälder
incheckning
2bae91afdc
2 ändrade filer med 161 tillägg och 157 borttagningar
  1. 13 9
      application/manage/controller/Counts.php
  2. 148 148
      application/manage/view/counts/index.html

+ 13 - 9
application/manage/controller/Counts.php

@@ -12,19 +12,20 @@ use app\common\library\SysLogs;
 use app\common\library\UUIDs;
 
 /**
- * 
+ *
  */
 class Counts extends Base {
-	public function index(){
+    public function index(){
         return $this->fetch();
-	}
+    }
 
     public function datas(){
         $admin = Session::get('session_manager');
         $institution_id = $admin['institution_id'];
         $request = Request::instance();
         $params = $request->param();
-        $where = ['film_type'=>2];
+        $where = [];
+        $where[] = ' e.film_type=2';
         foreach ($params as $k=>$v) {
             switch($k){
                 case 'upload1':
@@ -80,6 +81,7 @@ class Counts extends Base {
             ->alias('s')
             ->distinct(true)
             ->join(['patient_infos'=>'p'],'p.id=s.patient_id')
+            ->join(['exams'=>'e'],'e.patient_id=p.id')
             ->join(['user_bind'=>'u'],'u.patient_id=s.patient_id','left')
             ->where('s.institution_id='.$institution_id)
             ->where($search)
@@ -88,6 +90,7 @@ class Counts extends Base {
             ->alias('s')
             ->distinct(true)
             ->join(['patient_infos'=>'p'],'p.id=s.patient_id')
+            ->join(['exams'=>'e'],'e.patient_id=p.id')
             ->join(['user_bind'=>'u'],'u.patient_id=s.patient_id','left')
             ->where('s.institution_id='.$institution_id)
             ->where($search)
@@ -106,33 +109,33 @@ class Counts extends Base {
         $institution_id = $admin['institution_id'];
         $request = Request::instance();
         $params = $request->param();
-        $where = ['film_type'=>2];
+        $where[] = ' e.film_type=2';
         foreach ($params as $k=>$v) {
             switch($k){
                 case 'upload_datetime1':
                     if($params['upload_datetime1'] == null){
                         continue;
                     }
-                    $where[] = ' s.createdAt > \''.$params['upload1'].'\' ';
+                    $where[] = ' s.createdAt > \''.$params['upload_datetime1'].'\' ';
                     break;
                 case 'upload_datetime2':
                     if($params['upload_datetime2'] == null){
                         continue;
                     }
-                    $where[] = ' s.createdAt < \''.$params['upload2'].'\' ';
+                    $where[] = ' s.createdAt < \''.$params['upload_datetime2'].'\' ';
                     break;
                 case 'exam_datetime1':
                     if($params['exam_datetime1'] == null){
                         continue;
                     }
-                    $exam1 = str_replace('-', '', $params['exam1']);
+                    $exam1 = str_replace('-', '', $params['exam_datetime1']);
                     $where[] = ' s.studydate > \''.$exam1.'\' ';
                     break;
                 case 'exam_datetime2':
                     if($params['exam_datetime2'] == null){
                         continue;
                     }
-                    $exam2 = str_replace('-', '', $params['exam2']);
+                    $exam2 = str_replace('-', '', $params['exam_datetime2']);
                     $where[] = ' s.studydate < \''.$exam2.'\' ';
                     break;
                 case 'exam_class':
@@ -154,6 +157,7 @@ class Counts extends Base {
             ->alias('s')
             ->distinct(true)
             ->join(['patient_infos'=>'p'],'p.id=s.patient_id')
+            ->join(['exams'=>'e'],'e.patient_id=p.id')
             ->join(['user_bind'=>'u'],'u.patient_id=s.patient_id','left')
             ->where('s.institution_id='.$institution_id)
             ->where($search)

+ 148 - 148
application/manage/view/counts/index.html

@@ -1,170 +1,170 @@
 <!DOCTYPE html>
 <html>
-    <head>
-        <title>TODO supply a title</title>
-        {include file="../application/manage/view/commons/headers.html" }
-        <script >
-            
-            // 编辑窗口
-            var $editWin;
-            var editWinHeight=$(window).height()-35;
-            var editWinWidth=$(window).width()*0.98;
-            
-            $(function(){
-                    $editWin = $('#edit-window').window({
-                        title: '数据统计信息',
-                        width: editWinWidth,height: editWinHeight,
-                        top: ($(window).height() -editWinHeight ) /2 ,
-                        left: ($(window).width() -editWinWidth ) /2 ,
-                        shadow: true,modal: true,
-                        iconCls: 'icon-edit',closed: true,resizable:true,
-                        minimizable: false,maximizable: true,collapsible: false
-                    });
+<head>
+    <title>TODO supply a title</title>
+    {include file="../application/manage/view/commons/headers.html" }
+    <script >
 
+        // 编辑窗口
+        var $editWin;
+        var editWinHeight=$(window).height()-35;
+        var editWinWidth=$(window).width()*0.98;
+
+        $(function(){
+            $editWin = $('#edit-window').window({
+                title: '数据统计信息',
+                width: editWinWidth,height: editWinHeight,
+                top: ($(window).height() -editWinHeight ) /2 ,
+                left: ($(window).width() -editWinWidth ) /2 ,
+                shadow: true,modal: true,
+                iconCls: 'icon-edit',closed: true,resizable:true,
+                minimizable: false,maximizable: true,collapsible: false
             });
 
-            $(window).resize(function() {
-                editWinWidth=$(window).width()*0.98;
-                $('#edit-window').window('resize',{
-                    width: editWinWidth,height: editWinHeight
-                });
+        });
+
+        $(window).resize(function() {
+            editWinWidth=$(window).width()*0.98;
+            $('#edit-window').window('resize',{
+                width: editWinWidth,height: editWinHeight
             });
-            
-            function dateFormatter(date){
-	    	if(typeof date=="undefined"){ return "--"; }
-	    	return new Date(date).format("yy-MM-dd hh:mm");
-	    }
-            
-            function statusFormatter(status){
-                if(status=="1"){
-                    return "正常";
-                }else if(status=="0"){
-                    return "屏蔽";
-                }else{
-                    return "非正常";
-                }
+        });
+
+        function dateFormatter(date){
+            if(typeof date=="undefined"){ return "--"; }
+            return new Date(date).format("yy-MM-dd hh:mm");
+        }
+
+        function statusFormatter(status){
+            if(status=="1"){
+                return "正常";
+            }else if(status=="0"){
+                return "屏蔽";
+            }else{
+                return "非正常";
             }
-            
-            function insFormatter(id,row){
-                for(var i=0;i<institutionsData.length;i++){
-                    var row=institutionsData[i];
-                    if(row.id==id){
-                        return row.name;
-                    }
+        }
+
+        function insFormatter(id,row){
+            for(var i=0;i<institutionsData.length;i++){
+                var row=institutionsData[i];
+                if(row.id==id){
+                    return row.name;
                 }
-	    	return "<font color='#ccc' >顶级机构<font>";
             }
-            
-            function commandsFormatter(id,row){
-	    	var cmdEdit="<a href='#' onclick=\"javascript:showEditWin('"+row.id+"');\" >编辑</a>&nbsp;";
-                cmdEdit+="<a href='#' onclick=\"javascript:deleteRow('"+row.id+"');\" >删除</a>";
-	    	return cmdEdit;
-	    }
-            
-            
-            
-            function statusFormatter(status){
-                if(status=="0"){
-                    return "屏蔽";
-                }else if(status=="1"){
-                    return "正常";
-                }else{
-                    return status;
-                }
+            return "<font color='#ccc' >顶级机构<font>";
+        }
+
+        function commandsFormatter(id,row){
+            var cmdEdit="<a href='#' onclick=\"javascript:showEditWin('"+row.id+"');\" >编辑</a>&nbsp;";
+            cmdEdit+="<a href='#' onclick=\"javascript:deleteRow('"+row.id+"');\" >删除</a>";
+            return cmdEdit;
+        }
+
+
+
+        function statusFormatter(status){
+            if(status=="0"){
+                return "屏蔽";
+            }else if(status=="1"){
+                return "正常";
+            }else{
+                return status;
             }
+        }
 
 
-            function pfromFormatter(source){
-                if(source){
-                    return "绑定";
-                }else if(source==null){
-                    return "未绑定";
-                }else{
-                    return source;
-                }
+        function pfromFormatter(source){
+            if(source){
+                return "绑定";
+            }else if(source==null){
+                return "未绑定";
+            }else{
+                return source;
             }
+        }
 
-            function sfromFormatter(source){
-                if(source=="M"){
-                    return "男";
-                }else if(source=="F"){
-                    return "女";
-                }else{
-                    return source;
-                }
+        function sfromFormatter(source){
+            if(source=="M"){
+                return "男";
+            }else if(source=="F"){
+                return "女";
+            }else{
+                return source;
             }
+        }
 
-            $(function(){
-                
-                var height=$(document).height();
-                $("#dg").height(height);
-                                
-                $('#dg').datagrid({
-                    url:'/manage/counts/datas',
-                    idField:'id',method: 'get',rownumbers: true,showFooter: true,singleSelect:true,selectOnCheck:false,
-                    toolbar: '#tb',pageList: [dgRowSize,dgRowSize*2,50,100],pagination:true,pageSize:dgRowSize,
-                    columns:[[
-                            {field:'name',title:'患者姓名',width:"120",align:'left'},
-                            {field:'sex',title:'患者性别',width:100 , formatter:sfromFormatter  },
-                            {field:'age',title:'患者年龄', hidden:true,width:115  },
-                            {field:'modality',title:'检查类型',width:135  },
-                            {field:'studydate',title:'检查时间',width:200  },
-                            {field:'createdAt',title:'上传时间',width:200 },
-                            {field:'exam_id',title:'是否绑定微信',width:115  , formatter:pfromFormatter  },
-                    ]],
-                    onDblClickRow :function(rowIndex,rowData){
-                        showEditWin(rowData.id);
-                    },
-                });
+        $(function(){
 
+            var height=$(document).height();
+            $("#dg").height(height);
 
+            $('#dg').datagrid({
+                url:'/manage/counts/datas',
+                idField:'id',method: 'get',rownumbers: true,showFooter: true,singleSelect:true,selectOnCheck:false,
+                toolbar: '#tb',pageList: [dgRowSize,dgRowSize*2,50,100],pagination:true,pageSize:dgRowSize,
+                columns:[[
+                    {field:'name',title:'患者姓名',width:"120",align:'left'},
+                    {field:'sex',title:'患者性别',width:100 , formatter:sfromFormatter  },
+                    {field:'age',title:'患者年龄', hidden:true,width:115  },
+                    {field:'modality',title:'检查类型',width:135  },
+                    {field:'studydate',title:'检查时间',width:200  },
+                    {field:'createdAt',title:'上传时间',width:200 },
+                    {field:'exam_id',title:'是否绑定微信',width:115  , formatter:pfromFormatter  },
+                ]],
+                onDblClickRow :function(rowIndex,rowData){
+                    showEditWin(rowData.id);
+                },
             });
-            
-            function reload(){
-                var upload1 = $("#upload1").val();
-                var upload2 = $("#upload2").val();
-                var exam1 = $("#exam1").val();
-                var exam2 = $("#exam2").val();
-                var exam=$('#exam_class').val();
-                var url="/manage/counts/datas?exam_class="+(exam==null?"":exam)+"&upload1="+(upload1==null?"":upload1)+"&upload2="+(upload2==null?"":upload2)+"&exam1="+(exam1==null?"":exam1)+"&exam2="+(exam2==null?"":exam2);
-                $('#dg').datagrid("reload",url);
-            }
 
-            function derive(){
-                var form = $("#form");
-                var upload1 = $("#upload1").val();
-                var upload2 = $("#upload2").val();
-                var exam1 = $("#exam1").val();
-                var exam2 = $("#exam2").val();
-                var exam=$('#exam_class').val();
-                var url="/manage/counts/out?exam_class="+(exam==null?"":exam)+"&upload1="+(upload1==null?"":upload1)+"&upload2="+(upload2==null?"":upload2)+"&exam1="+(exam1==null?"":exam1)+"&exam2="+(exam2==null?"":exam2);
-                form.attr('action',url);
-                form.submit();
-            }
-            
-            $(function(){
-                $('#institution_id').combotree({
-                    required:true,multiple:false,editable:false,
-                    valueField:'id',textField:'name',panelWidth:550,
-                    url:"/manage/institution/insCombobox"
-                });
+
+        });
+
+        function reload(){
+            var upload1 = $("#upload1").val();
+            var upload2 = $("#upload2").val();
+            var exam1 = $("#exam1").val();
+            var exam2 = $("#exam2").val();
+            var exam=$('#exam_class').val();
+            var url="/manage/counts/datas?exam_class="+(exam==null?"":exam)+"&upload1="+(upload1==null?"":upload1)+"&upload2="+(upload2==null?"":upload2)+"&exam1="+(exam1==null?"":exam1)+"&exam2="+(exam2==null?"":exam2);
+            $('#dg').datagrid("reload",url);
+        }
+
+        function derive(){
+            var form = $("#form");
+            var upload1 = $("#upload1").val();
+            var upload2 = $("#upload2").val();
+            var exam1 = $("#exam1").val();
+            var exam2 = $("#exam2").val();
+            var exam=$('#exam_class').val();
+            var url="/manage/counts/out?exam_class="+(exam==null?"":exam)+"&upload1="+(upload1==null?"":upload1)+"&upload2="+(upload2==null?"":upload2)+"&exam1="+(exam1==null?"":exam1)+"&exam2="+(exam2==null?"":exam2);
+            form.attr('action',url);
+            form.submit();
+        }
+
+        $(function(){
+            $('#institution_id').combotree({
+                required:true,multiple:false,editable:false,
+                valueField:'id',textField:'name',panelWidth:550,
+                url:"/manage/institution/insCombobox"
             });
-            
-        </script>
-        
-    </head>
-    <body>
-        <div id="dg" class="easyui-datagrid" style="width:100%;height:auto;" ></div>
-        <div id="tb" class="editform" style="display: none; padding-top: 1px;">&nbsp;
-            <form id="form">
-                检查类型:<input type="text" name="exam_class" id="exam_class" style="width:150px;" />&nbsp;
-                检查时间:<input type="text" id="exam1"  name="exam_datetime1" class="easyui-datebox" style="width: 120px;" />----<input type="text" id="exam2" name="exam_datetime2" class="easyui-datebox" style="width: 120px;" />&nbsp;&nbsp;&nbsp;
-                上传时间:<input type="text" id="upload1"  name="upload_datetime1" class="easyui-datebox" style="width: 120px;" />----<input type="text" id="upload2"  name="upload_datetime2" class="easyui-datebox" style="width: 120px;" />&nbsp;&nbsp;&nbsp;
-                <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px" onclick="reload()" >查询</a>&nbsp;&nbsp;&nbsp;
-                <a id="excel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 140px" onclick="derive()" >导出excel</a>
-            </form>
-        </div>
-        <div id="edit-window" class="easyui-window" style="overflow: hidden" ><iframe src="about:blank" id="editFrame" style="width:100%;height:100%" frameborder="0" scrolling="yes" ></iframe></div>
-        
-    </body>
+        });
+
+    </script>
+
+</head>
+<body>
+<div id="dg" class="easyui-datagrid" style="width:100%;height:auto;" ></div>
+<div id="tb" class="editform" style="display: none; padding-top: 1px;">&nbsp;
+    <form id="form">
+        检查类型:<input type="text" name="exam_class" id="exam_class" style="width:150px;" />&nbsp;
+        检查时间:<input type="text" id="exam1"  name="exam_datetime1" class="easyui-datebox" style="width: 120px;" />----<input type="text" id="exam2" name="exam_datetime2" class="easyui-datebox" style="width: 120px;" />&nbsp;&nbsp;&nbsp;
+        上传时间:<input type="text" id="upload1"  name="upload_datetime1" class="easyui-datebox" style="width: 120px;" />----<input type="text" id="upload2"  name="upload_datetime2" class="easyui-datebox" style="width: 120px;" />&nbsp;&nbsp;&nbsp;
+        <a id="submit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 80px" onclick="reload()" >查询</a>&nbsp;&nbsp;&nbsp;
+        <a id="excel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 140px" onclick="derive()" >导出excel</a>
+    </form>
+</div>
+<div id="edit-window" class="easyui-window" style="overflow: hidden" ><iframe src="about:blank" id="editFrame" style="width:100%;height:100%" frameborder="0" scrolling="yes" ></iframe></div>
+
+</body>
 </html>