Browse Source

统计数据结构

lizhen_gitee 1 year ago
parent
commit
b1e1e6abc0
1 changed files with 7 additions and 1 deletions
  1. 7 1
      application/api/controller/company/Index.php

+ 7 - 1
application/api/controller/company/Index.php

@@ -105,6 +105,12 @@ class Index extends Apic
             $map['staff_id'] = $this->auth->id;
         }
 
+        $ec_ordernum = [
+            0 => [
+                'name'=>'笔数',
+                'data'=>[],
+            ],
+        ];
         for($i=$starttime;$i<$endtime;$i+=86400){
             $starttime_i = $i;
             $endtime_i = $i + 86399;
@@ -112,7 +118,7 @@ class Index extends Apic
             $ec_date[] = date('d',$starttime_i).'日';
             //下单人数
             $map['finish_time'] = ['between',[$starttime_i,$endtime_i]];
-            $ec_ordernum[] = Db::name('order')->where($map)->count('id');
+            $ec_ordernum[0]['data'][] = Db::name('order')->where($map)->count('id');
         }
 
         //饼图