作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

XIAOPAN

@@ -125,8 +125,7 @@ class AdminStatisticsController extends AdminBaseController{ @@ -125,8 +125,7 @@ class AdminStatisticsController extends AdminBaseController{
125 125
126 public function getNote(){ 126 public function getNote(){
127 $param=$this->request->param(); 127 $param=$this->request->param();
128 - $data=Db::name('equipment')->where(['hospital'=>$param['hospital'],'is_delete'=>0])->group('note')->select()->toArray();  
129 - 128 + $data=Db::name('equipment')->where(['hospital'=>$param['hospital'],'is_delete'=>0,'note'=>['neq',null]])->group('note')->select()->toArray();
130 return $data; 129 return $data;
131 } 130 }
132 131
@@ -567,13 +567,14 @@ @@ -567,13 +567,14 @@
567 }, 567 },
568 success: function (data) { 568 success: function (data) {
569 var html="<option value=''>全部</option>"; 569 var html="<option value=''>全部</option>";
570 - console.log(data);  
571 - for (var i=0;i<data.length;i++){  
572 - html+='<option value='+data[i]['note']+'>'+data[i]['note']+'</option>'; 570 + if (data!="") {
  571 + for (var i = 0; i < data.length; i++) {
  572 + html += '<option value=' + data[i]['note'] + '>' + data[i]['note'] + '</option>';
573 } 573 }
574 console.log(html); 574 console.log(html);
575 $("#note").html(html); 575 $("#note").html(html);
576 } 576 }
  577 + }
577 }) 578 })
578 }) 579 })
579 </script> 580 </script>