self::today(), // 快捷入口 'menu' => self::menu(), // 图表数据 'visitor' => self::visitor(), ]; } /** * @notes 快捷入口 * @return array[] * @author 段誉 * @date 2021/12/29 16:40 */ public static function menu(): array { return [ [ 'name' => '土地列表', 'image' => FileService::getFileUrl(config('project.default_image.menu_dict')), 'url' => '/land/land' ], [ 'name' => '产品列表', 'image' => FileService::getFileUrl(config('project.default_image.menu_file')), 'url' => '/land/product' ], [ 'name' => '设备列表', 'image' => FileService::getFileUrl(config('project.default_image.menu_web')), 'url' => '/device/device' ], [ 'name' => '监控报警', 'image' => FileService::getFileUrl(config('project.default_image.menu_auth')), 'url' => '/device/monitor_alarm' ] ]; } /** * @notes 今日数据 * @return int[] * @author 段誉 * @date 2021/12/29 16:15 */ public static function today(): array { return [ 'time' => date('Y-m-d H:i:s'), // 土地数 'today_land' => 3, // 今日新增 'total_land' => 10, // 产品数 'today_product' => 2, // 今日新增 'total_product' => 100, // 设备数 'today_device' => 2, // 今日新增 'total_device' => 12, // 报警数 'today_alarm' => 5, // 今日新增 'total_alarm' => 35, ]; } /** * @notes 访问数 * @return array * @author 段誉 * @date 2021/12/29 16:57 */ public static function visitor(): array { $land = $device = $product = $alarm = []; $date = []; for ($i = 0; $i < 15; $i++) { $where_start = strtotime("- " . $i . "day"); $date[] = date('Y/m/d', $where_start); $land[$i] = rand(0, 100); $product[$i] = rand(0, 100); $device[$i] = rand(0, 100); $alarm[$i] = rand(0, 100); } return [ 'date' => $date, 'list' => [ ['name' => '土地数', 'data' => $land], ['name' => '产品数', 'data' => $product], ['name' => '设备数', 'data' => $device], ['name' => '报警数', 'data' => $alarm], ] ]; } /** * @notes 服务支持 * @return array[] * @author 段誉 * @date 2022/7/18 11:18 */ public static function support() { return [ [ 'image' => FileService::getFileUrl(config('project.default_image.qq_group')), 'title' => '官方公众号', 'desc' => '关注官方公众号', ], [ 'image' => FileService::getFileUrl(config('project.default_image.customer_service')), 'title' => '添加企业客服微信', 'desc' => '想了解更多请添加客服', ] ]; } }