Browse Source

统计bug

ss 9 months ago
parent
commit
5cf342e19c
2 changed files with 7 additions and 6 deletions
  1. 1 0
      application/common/model/Orders.php
  2. 6 6
      application/h5/controller/Statistics.php

+ 1 - 0
application/common/model/Orders.php

@@ -723,6 +723,7 @@ class Orders extends Base {
             }
             $todo = Db::name('todo')
                 ->where('order_id', $v['id'])
+                ->where('del',0)
                 ->where($t)
                 ->select();
             if (!empty($todo)) {

+ 6 - 6
application/h5/controller/Statistics.php

@@ -125,7 +125,7 @@ class Statistics extends Controller
     }
 
     public function users() {
-        $lists = Db::name('roles')->where('id','in',(new WorkTypeMode())->workerRoles)->field('id,name')->select();
+        $lists = Db::name('roles')->where('id','in',[3,4,5,6,7,8,9,10,11])->field('id,name')->select();
         $lists = $lists?$lists:[];
         $allcount = 0;
         foreach ($lists as $k=>$v){
@@ -295,9 +295,9 @@ class Statistics extends Controller
         $mode = input('mode',0);//订单类型
         $day = input('day',0);//日,月,总计
 
-        if(!$type){
-            $where[]=['order_mode','in',[-1]];
-        }
+//        if(!$type){
+//            $where[]=['order_mode','in',[-1]];
+//        }
         //全部订单
         if($type == -1){
             $where[]=['order_mode','in',[1,2,3,4,5,6]];
@@ -677,7 +677,7 @@ class Statistics extends Controller
         if($page > 1){
             if($rolesId == 0){
                 $rolesIds =  Db::name('roles')
-                    ->whereIn('parent_id',[4,5,6,7,8,9,10,11])
+                    ->whereIn('parent_id',[3,4,5,6,7,8,9,10,11])
                     ->where('org_id',$this->orgId)
                     ->where('del',0)
                     ->where('enable',1)
@@ -715,7 +715,7 @@ class Statistics extends Controller
 
             if($rolesId == 0){
                 $rolesIds =  Db::name('roles')
-                    ->whereIn('parent_id',[4,5,6,7,8,9,10,11])
+                    ->whereIn('parent_id',[3,4,5,6,7,8,9,10,11])
                     ->where('org_id',$this->orgId)
                     ->where('del',0)
                     ->where('enable',1)