38 次代碼提交 dcdb757da9 ... fbbf1ece60

作者 SHA1 備註 提交日期
  ss fbbf1ece60 Merge branch 'master' of http://121.36.46.135:3000/shangshang/jili2 2 月之前
  ss 47b9cefd54 1 2 月之前
  ss 4891bf8908 Merge branch 'master' of http://121.36.46.135:3000/shangshang/jili2 2 月之前
  ss 8046fa9993 11 2 月之前
  ss 21904e67b5 1 2 月之前
  ss bb42f4c7d7 大屏医废 2 月之前
  hzd 39b02737a2 盘库完成bug 2 月之前
  ss 8e72a69b26 11 2 月之前
  ss e4209311a6 1 2 月之前
  ss a3c1ac119c 1 2 月之前
  ss 2b0e053343 11 2 月之前
  ss 8d4e22c937 11 2 月之前
  ss f5e0bbc761 11 2 月之前
  ss fbf18d3ce8 11 2 月之前
  ss 7f30b3b2b5 1 2 月之前
  ss 216c75aa06 11 2 月之前
  ss 08f7429d55 11 2 月之前
  ss c03ce7441e 1 2 月之前
  hzd 1887c37f7e 修改医废类型bug 2 月之前
  ss 8af370a941 11 3 月之前
  ss 5b18496cc2 1 3 月之前
  hzd 9dceac4b2d 修改 3 月之前
  hzd 4bdb19c747 订单修改 3 月之前
  hzd 9faccf9996 修改 3 月之前
  hzd ff59a14312 需求修改 3 月之前
  hzd e0e507cab3 bug 3 月之前
  hzd 53c9d5c3a6 需求优化 3 月之前
  hzd 40329e2852 需求修改 3 月之前
  hzd 9d34c0f2d0 修改 3 月之前
  hzd aeca21dd6c Merge branch 'master' of http://121.36.46.135:3000/shangshang/jili2 3 月之前
  hzd 44c1c0806d xg 3 月之前
  hzd 6f0820d9b3 优化 3 月之前
  ss df307a2351 1 3 月之前
  ss 6f85991dad 1 3 月之前
  ss f3cc29ddee 11 3 月之前
  ss b3b95ca725 11 3 月之前
  ss 0cd1469bc7 1 3 月之前
  ss 33d2a96cf2 初始化 3 月之前
共有 1 個文件被更改,包括 25 次插入11 次删除
  1. 25 11
      application/api/controller/screen/Repair.php

+ 25 - 11
application/api/controller/screen/Repair.php

@@ -64,7 +64,7 @@ class Repair extends Index
             ['name'=>'已取消','value'=>[2,3]],
             ['name'=>'进行中','value'=>4],
             ['name'=>'已完成','value'=>5],
-            ['name'=>'已评价','value'=>6],
+          //  ['name'=>'已评价','value'=>6],
         ];
         $list = [];
         foreach ($orderMode as $k=>$v){
@@ -359,21 +359,31 @@ class Repair extends Index
     public function wxDepData(){
         $date = date('Ymd');
         $edate = date('Ymd',strtotime("-1 months",strtotime($date)));
-        $dep = Db::name('dep')
+//        $dep = Db::name('dep')
+//            ->field('id,title')
+//            ->where('org_id',$this->orgId)
+//            ->where('del',0)
+//            ->where('enable',1)
+//            ->limit(6)
+//            ->select();
+
+
+        $dep = Db::name('address')
             ->field('id,title')
             ->where('org_id',$this->orgId)
             ->where('del',0)
             ->where('enable',1)
-            ->limit(6)
+            ->where('','exp',Db::raw("FIND_IN_SET(1,types)"))
             ->select();
 
         $title = $count = $count2 = [];
         foreach ($dep as $k=>$v){
-            $title[] =$v['title'];
-            $count[] = Db::name('orders')
+           // $title[] =$v['title'];
+            $dep[$k]['count'] = Db::name('orders')
                 ->alias('o')
                 ->join('todo t','t.order_id=o.id')
-                ->where('o.dep_id',$v['id'])
+                ->join('order_repair or','or.order_id=o.id')
+                ->where('or.address_id',$v['id'])
                 ->where('t.work_type_mode',1)
                 ->where('t.create_yyyymmdd',$date)
                 ->where('t.del',0)
@@ -383,20 +393,24 @@ class Repair extends Index
             $nums= Db::name('orders')
                 ->alias('o')
                 ->join('todo t','t.order_id=o.id')
-                ->where('o.dep_id',$v['id'])
+                ->join('order_repair or','or.order_id=o.id')
+                ->where('or.address_id',$v['id'])
                 ->where('t.work_type_mode',1)
                 ->where('t.create_yyyymmdd','<=',$date)
                 ->where('t.create_yyyymmdd','>=',$edate)
                 ->where('t.del',0)
                 ->where('t.org_id',$this->orgId)
                 ->count();
-            $count2[] = round($nums/30,1);
+            $dep[$k]['num'] = round($nums/30,1);
         }
 
+
+        $newList = array_slice(list_sort_by($dep,'count','desc'),0,5);
+
         $data =[
-            'title' =>$title,
-            'list' =>$count,
-            'list2' =>$count2,
+            'title' =>array_column($newList,'title'),
+            'list' =>array_column($newList,'count'),
+            'list2' =>array_column($newList,'num'),
         ];
         HelpHander::success($data);