im trying to understand why my "type" isnt working when selecting for search.


class MessageSearch extends Message
{
	/**
	* Rules
	* @url https://www.yiiframework.com/doc/api/2.0/yii-base-model#rules()-detail
	* @return array
	*/
	public function rules(): array
	{
		return [
			[['id', 'type', 'product_id', 'status', 'new_message', 'repliedTime', 'created_by', 'updated_by', 'created_at', 'updated_at'], 'integer'],
			[['name', 'email', 'subject', 'body', 'replied', 'created_ip', 'updated_ip'], 'safe'],
		];
	}
	
	/**
	* Scenarios
	* @url https://www.yiiframework.com/doc/api/2.0/yii-base-model#$scenario-detail
	* return array
	*/
	public function scenarios(): array
	{
		// Bypass scenarios() implementation in the parent class.
		return Model::scenarios();
	}

	/**
	* Creates data provider instance with search query applied
	* @param array $params
	* @return ActiveDataProvider
	*/
	public function search(array $params): ActiveDataProvider
	{
		$query = Message::find();
		
		/**
		* Add eager loading for related models if needed.
		*
		$query->with(['relatedModel']);//*/
		
		// Add conditions that should always apply here.
		$dataProvider = new ActiveDataProvider([
			'query' => $query,
			'pagination' => [
				'pageSize' => 20,// Set a default page size.
			],
			'sort' => [
				'defaultOrder' => [
					'created_at' => SORT_DESC,// Default sorting by recent entries.
				],
			],
		]);
		
		// Load parameters.
		$this->load($params);
		
		// Debug: Check if params were loaded.
		\Yii::debug('Message Search $this->status: ' . $this->status, __METHOD__);
		
		// Validate loaded data.
		if (!$this->validate()) {
		
			/**
			* Uncomment the following line if you do not want to return any records when validation fails
			*/
			$query->where('0=1');//*/
			
			return $dataProvider;
		}
		
		// Apply Status filtering using bitwise operations.
		$statuses = $this->status;
		if (!empty($statuses)) {
			
			// If it's a comma-separated string, convert to an array.
			if (is_string($statuses)) {
				
				$statuses = [$statuses];// Convert to array.
			}
			
			$bitwiseStatus = 0;
			if (is_array($statuses)) {
				
				foreach ($statuses as $selectedStatus) {
					
					$bitwiseStatus |= (int)$selectedStatus;// Combine selected statuses.
				}
				
				// Debug: Check the resulting bitwiseStatus.
				//\Yii::debug($bitwiseStatus, __METHOD__);
				
				// Apply bitwise AND filtering.
				$query->andWhere(['&', 'status', $bitwiseStatus]); 
			}
		}
		
		// Apply other grid filtering conditions.
		$query->andFilterWhere([
			//'id' => $this->id,
			'type' => $this->type,
			'product_id' => $this->product_id,
			//'status' => $this->status,
			//'new_message' => $this->new_message,
			'repliedTime' => $this->repliedTime,
			'created_by' => $this->created_by,
			'updated_by' => $this->updated_by,
			'created_at' => $this->created_at,
			'updated_at' => $this->updated_at,
		]);
		
		// Apply LIKE filtering for string attributes.
		$query->andFilterWhere(['like', 'name', $this->name])
			->andFilterWhere(['like', 'email', $this->email])
			->andFilterWhere(['like', 'subject', $this->subject])
			->andFilterWhere(['like', 'body', $this->body])
			->andFilterWhere(['like', 'replied', $this->replied])
			->andFilterWhere(['like', 'created_ip', $this->created_ip])
			->andFilterWhere(['like', 'updated_ip', $this->updated_ip]);
		
		return $dataProvider;
	}
}

and the view file with gridView:

		[
			'attribute' => 'type',
			'format' => 'html',
			'filter' => ['1' => 'Contact', '2' => 'Inquiry', '3' => 'Order'],
			'filterInputOptions' => ['prompt' => 'All Messages', 'class' => 'form-control', 'id' => null],
			'value' => function ($model) {
				
				$attribute = Html::encode($model->status);
				
				return Html::tag('span', ($attribute == 1) ? 'Contact' : (($attribute == 2) ? 'Inquiry' : 'Order'), [
					'class' => ($attribute == 1) ? 'badge text-bg-primary' : (($attribute == 2) ? 'badge text-bg-success' : 'badge text-bg-warning')
				]);
			},
			//'contentOptions' => ['width' => '10%'],
		]