lizhen_gitee 1 year ago
parent
commit
59b829b9fe
1 changed files with 17 additions and 4 deletions
  1. 17 4
      application/api/controller/company/Index.php

+ 17 - 4
application/api/controller/company/Index.php

@@ -99,6 +99,7 @@ class Index extends Apic
 
         $map = [
             'company_id'  => $this->auth->company_id,
+            'status'      => 3,
         ];
         if($this->auth->type == 2){
             $map['staff_id'] = $this->auth->id;
@@ -167,6 +168,7 @@ class Index extends Apic
 
             $map = [
                 'company_id'  => $this->auth->company_id,
+                'status'      => 3,
             ];
             if($this->auth->type == 2){
                 $map['staff_id'] = $this->auth->id;
@@ -206,6 +208,7 @@ class Index extends Apic
 
             $map = [
                 'company_id'  => $this->auth->company_id,
+                'status'      => 3,
             ];
             if($this->auth->type == 2){
                 $map['staff_id'] = $this->auth->id;
@@ -249,7 +252,7 @@ class Index extends Apic
         $starttime = strtotime($date);    //月初第一天
         $endtime = strtotime("+1 month",$starttime) - 1; //月末最后一天
 
-        $staff = Db::name('company_staff')->field('id,')->where('company_id',$this->auth->company_id)->select();
+        $staff = Db::name('company_staff')->field('id,truename')->where('type',2)->where('company_id',$this->auth->company_id)->select();
 
         //柱状图
         $ec_date = [];
@@ -257,14 +260,24 @@ class Index extends Apic
 
         $map = [
             'company_id'  => $this->auth->company_id,
+            'status'      => 3,
+            'finish_time' => ['between',[$starttime,$endtime]],
         ];
 
-
+        foreach($staff as $key => $val){
             //日历
-            $ec_date[] = date('d',$starttime_i).'日';
+            $ec_date[] = $val['truename'];
             //下单人数
-            $map['finish_time'] = ['between',[$starttime_i,$endtime_i]];
+            $map['staff_id']    = $val['id'];
             $ec_ordernum[] = Db::name('order')->where($map)->count('id');
+        }
+
+        $result = [
+            'ec_data'     => $ec_date,
+            'ec_ordernum' => $ec_ordernum,
+        ];
+        $this->success(1,$result);
+
 
     }