From 5c2b8e18faa71e8a41e078644bdd3b41c7b3f8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Sat, 11 Feb 2023 16:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Statistics.php | 74 ++++++++++++++----------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/app/api/controller/Statistics.php b/app/api/controller/Statistics.php index bd7feaf..d0c9c8d 100644 --- a/app/api/controller/Statistics.php +++ b/app/api/controller/Statistics.php @@ -976,57 +976,21 @@ class Statistics extends BaseController $return = [ [ 'name'=>'鸡', - 'data'=> - [['month'=>'1月','value'=>'661'], - ['month'=>'2月','value'=>'356'], - ['month'=>'3月','value'=>'415'], - ['month'=>'4月','value'=>'258'], - ['month'=>'5月','value'=>'779'], - ['month'=>'6月','value'=>'1465'], - ['month'=>'7月','value'=>'668'], - ['month'=>'8月','value'=>'571'], - ['month'=>'9月','value'=>'498'], - ['month'=>'10月','value'=>'587'], - ['month'=>'11月','value'=>'881'], - ['month'=>'12月','value'=>'1008']], + 'value'=>[1200,2000,1800,1560,1896,2100,1952,1635,1874,2011,1921,1932] ], [ 'name'=>'鸭', - 'data'=> - [['month'=>'1月','value'=>'123'], - ['month'=>'2月','value'=>'456'], - ['month'=>'3月','value'=>'789'], - ['month'=>'4月','value'=>'147'], - ['month'=>'5月','value'=>'258'], - ['month'=>'6月','value'=>'369'], - ['month'=>'7月','value'=>'159'], - ['month'=>'8月','value'=>'267'], - ['month'=>'9月','value'=>'367'], - ['month'=>'10月','value'=>'541'], - ['month'=>'11月','value'=>'354'], - ['month'=>'12月','value'=>'897']], + 'data'=> [1124,1567,1800,1304,1596,2020,2158,1678,1999,1206,1479,2214] ], [ 'name'=>'鹅', - 'data'=> - [['month'=>'1月','value'=>'245'], - ['month'=>'2月','value'=>'245'], - ['month'=>'3月','value'=>'411'], - ['month'=>'4月','value'=>'246'], - ['month'=>'5月','value'=>'631'], - ['month'=>'6月','value'=>'1234'], - ['month'=>'7月','value'=>'546'], - ['month'=>'8月','value'=>'246'], - ['month'=>'9月','value'=>'356'], - ['month'=>'10月','value'=>'466'], - ['month'=>'11月','value'=>'744'], - ['month'=>'12月','value'=>'998']], + 'data'=> [1323,756,1346,886,896,1100,952,635,874,1411,921,932] ] ]; $this->apiSuccess('获取成功',$return); } - //养殖户产量分析 + //养殖户产量分析(饼状图) public function get_num24($area_id=0,$street_id=0,$village_id=0){ $where = []; if ($area_id){ @@ -1048,6 +1012,36 @@ class Statistics extends BaseController } + //产业结构,锥形图 + public function get_num25($area_id=0,$street_id=0,$village_id=0){ + $where = []; + if ($area_id){ + $where[] = ['area_id', '=', $area_id]; + } + if ($street_id){ + $where[] = ['street_id', '=', $street_id]; + } + if ($village_id){ + $where[] = ['village_id', '=', $village_id]; + } + + $return['data'] = [ + ['name' => '土豆','value'=>80], + ['name' => '番茄','value'=>50], + ['name' => '红薯','value'=>30], + ['name' => '山药','value'=>20], + ['name' => '白菜','value'=>70], + ]; + $return['img'] = [ + 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png', + 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png', + 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png', + 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png', + 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png', + ]; + $this->apiSuccess('获取成功',$return); + } + }