'日期', 'driver_name' => '司机', 'bus_no' => '车辆' ], parent::attributeLabels()); } /** * Creates data provider instance with search query applied * * @param array $params * @param string $type 司机或车辆 * * @return ActiveDataProvider */ public function search($params) { $this->load($params); //车辆 if($this->search_type!=='driver'){ $dataProvider = $this->getOilConsumptionList($this->search_key, $this->date_from, $this->date_to); }else{ $dataProvider = $this->getDriverConsumptionList($this->search_key, $this->date_from, $this->date_to); } return $dataProvider; } }