| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -27,8 +27,9 @@ class ReportCommunityController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public $marketId = 0; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public $newParams = ['status' => 1]; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public $marketList = []; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public $storeList = []; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    protected $reportDate = ''; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    protected $tools = []; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * Make a grid builder. | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -51,8 +52,8 @@ class ReportCommunityController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return Grid::make($builder, function (Grid $grid) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $marketList = $this->marketList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					             | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->column('market_id','市场')->display(function($marketId) use($marketList){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return $marketList[$marketId] ?? ''; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->column('market_id','市场')->display(function($market_id) use($marketList){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return $marketList[$market_id] ?? ''; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->column('user_id','懒ID'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					             | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -79,7 +80,7 @@ class ReportCommunityController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                },'开始时间',)->date()->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                $filter->equal('end_time','结束时间')->date()->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                $filter->equal('user_id','懒ID')->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                $filter->equal('user_id','懒ID')->placeholder('多个懒ID使用英文逗号隔开')->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                $filter->equal('name','姓名')->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if(!$this->marketId){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    $filter->equal('market_id','市场')->select($marketList)->width(2); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -87,15 +88,7 @@ class ReportCommunityController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                $filter->equal('status','状态')->select(EmployeesModel::$_STATUS)->width(2); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->tools([ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('today','report_community','今日', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('yesterday','report_community','昨日', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('this_week','report_community','本周', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('last_week','report_community','上周', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('this_month','report_community','本月', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new DataReportOption('last_month','report_community','上月', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                new ReportCommunityExport() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ]); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->tools($this->tools); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 每页1条
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $grid->paginate(10); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -120,10 +113,20 @@ class ReportCommunityController extends AdminController | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public function index(Content $content) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        $this->tools = [ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('today','report_community','今日', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('yesterday','report_community','昨日', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('this_week','report_community','本周', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('last_week','report_community','上周', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('this_month','report_community','本月', $this->newParams), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            new DataReportOption('last_month','report_community','上月', $this->newParams) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ]; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        $startTime = request()->get('start_time'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        $endTime = request()->get('end_time'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(empty($startTime) && empty($endTime)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $content->row(Alert::make('请先选择时间查询!','')->removable()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            $this->tools[] = new ReportCommunityExport(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return $content->title('社区代理点统计报表') | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |