Jelajahi Sumber

故障分类筛选功能

q 1 tahun lalu
induk
melakukan
9808133153

+ 26 - 2
webmain/model/flow/repair_faultModel.php

@@ -8,6 +8,7 @@ class flow_repair_faultClassModel extends flowModel
     {
         $this->hstate = array('未处理', '已处理');
         $this->hcolor = array('#ff6600','green');
+        $this->defaultorder = 'handle_state,asc,optdt,desc';
     }
 
     // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页
@@ -71,8 +72,7 @@ class flow_repair_faultClassModel extends flowModel
 
     public function flowwesearchdata($lx)
     {
-        $pid = m("repair_type")->type_pid;
-        if($lx==1)return $this->option->getselectdata($pid, true);
+        if($lx==1)  return m("repair_type")->getall("1=1");
         return array(
             'typename' => '所有分类',
             'searchmsg' => '标题/分类',
@@ -80,6 +80,30 @@ class flow_repair_faultClassModel extends flowModel
     }
 
 
+    // 移动端筛选
+    protected function flowbillwhere($uid, $lx)
+    {
+        $key 	= $this->rock->post('key');
+        if ($this->ismobile) {
+            $typeid 	= (int)$this->rock->post('type_id','0');
+            $keywere= '';
+            if(!isempt($key))$keywere.=" and (`title` like '%$key%' or `type`='$key')";
+            $whyere = '';
+
+            if($typeid>0){
+                $whyere.=" and `type_id`='$typeid'";
+            }
+
+            return array(
+                'order' 	=> '`handle_state` asc,`optdt` desc',
+                'keywere' 	=> $keywere,
+                'where' 	=> $whyere,
+                'fields'	=> '*'
+            );
+        }
+        return null;
+    }
+
     public function getstatezt($zt)
     {
         $colors = ["#ff8b1a", "#00c959", "#ff4974"];

+ 14 - 14
webmain/we/ying/yingyong/repair_fault.js

@@ -1,14 +1,14 @@
-// function myyingsinit(){
-//     var s = '<select id="type_id" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
-//     $('#searsearch_bar').prepend(s);
-//     $('#type_id').change(function(){
-//         yy.search({'type_id':this.value});
-//     });
-// }
-// // 生成下拉选项
-// yy.onshowdata=function(da){
-//     if(da.typearr){
-//         js.setselectdata(get('type_id'), da.typearr, 'id');
-//     }
-// }
-// myyingsinit();
+function myyingsinit(){
+    var s = '<select id="type_id" style="width:100px;border:none;background:white;font-size:14px"><option value="">所有分类</option></select>';
+    $('#searsearch_bar').prepend(s);
+    $('#type_id').change(function(){
+        yy.search({'type_id':this.value});
+    });
+}
+// 生成下拉选项
+yy.onshowdata=function(da){
+    if(da.typearr){
+        js.setselectdata(get('type_id'), da.typearr, 'id');
+    }
+}
+myyingsinit();