moonsflyer 8 ماه پیش
والد
کامیت
2348a671a9
1فایلهای تغییر یافته به همراه26 افزوده شده و 1 حذف شده
  1. 26 1
      app/adminapi/logic/WorkbenchLogic.php

+ 26 - 1
app/adminapi/logic/WorkbenchLogic.php

@@ -21,6 +21,7 @@ use app\common\service\ConfigService;
 use app\common\service\FileService;
 use app\common\model\recharge\RechargeOrder;
 use app\common\model\user\User;
+use app\common\model\article\Article;
 use think\facade\Db;
 
 
@@ -56,7 +57,11 @@ class WorkbenchLogic extends BaseLogic
 
             'income'=>self::income(),
 
-            'customer'=>self::customer()
+            'customer'=>self::customer(),
+            //农机手
+            'agricultural_data'=> self::agricultural(),
+            'bake_data'=> self::agricultural(),
+            'air_data'=> self::agricultural(),
         ];
     }
 
@@ -147,6 +152,10 @@ class WorkbenchLogic extends BaseLogic
      */
     public static function today(): array
     {
+        $now = date('Y-m-d',time());
+        $start_time = $now.' 00:00:00';
+
+//        $articleInfo = Article::field('sum(click_actual) as totalvisito')
         return [
             'time' => date('Y-m-d H:i:s'),
             // 今日销售额
@@ -293,4 +302,20 @@ class WorkbenchLogic extends BaseLogic
         }
         return ['type_desc'=>$type_desc,'count'=>$userCount];
     }
+
+    public static function agricultural(){
+        $nowYear = date('Y');
+        $nowMonth = date('n');
+
+        $monthData = [];
+        $monthArr = [];
+        for ($i = 1; $i <= $nowMonth; $i++) {
+            array_push($monthArr, $i);
+            $monthFat = $i . '月';
+            array_push($monthData, $monthFat);
+        }
+        $data['valueData'] = [0,0,0,4,10];
+        $data['monthData'] = $monthData;
+        return $data;
+    }
 }