$salesPhone = Sales::find()
->where(new \yii\db\Expression("TO_CHAR(date, 'MM-DD') = :monthDay", [':monthDay' => $monthDay]))
+ ->andWhere(['not', ['phone' => 0]])
->distinct('phone')
->select('phone')
->column();
->where(['>=', 'date', date('Y-m-d', strtotime("$targetDate -$step1 days"))])
->andWhere(['<=', 'date', date('Y-m-d', strtotime("$targetDate -$step2 days"))])
->andWhere(['phone' => $targetPhones])
+ ->andWhere(['not', ['phone' => 0]])
->distinct('phone')
->select('phone')
->column();
->where(['>=', 'date', date('Y-m-d', strtotime("$targetDate -$step2 days"))])
->andWhere(['<=', 'date', date('Y-m-d', strtotime("$targetDate -$step3 days"))])
->andWhere(['phone' => $whatsappPhones])
+ ->andWhere(['not', ['phone' => 0]])
->distinct('phone')
->select('phone')
->column();