request->get('year'); if(empty($year)){ $year = date('Y'); } $column = ['1','2','3','4','5','6','7','8','9','10','11','12']; $series = [ 'name' => '客户数', 'data' => [] ]; foreach($column as &$v){ $month = $v; if($month < 10){ $month = '0'.$month; } $series['data'][] = Custom::field('id')->whereMonth('create_time', $year.'-'.$month)->count(); $v = $v.'月'; } $custom_total = Custom::field('id')->count(); $this_year_add = Custom::field('id')->whereYear('create_time',date('Y'))->count(); $result = [ 'column' => $column, 'series' => $series, 'custom_total' => $custom_total, 'this_year_add' => $this_year_add ]; return $this->success('success',$result); } //项目立项 public function projectInitiation(){ //立项总数 $project_total = Project::field('id')->where('status',0)->count(); //项目跟进 $project_follow_total = ProjectInsuranceManagement::field('id')->count(); //项目需求 // $project_demand_total = } }