$sql = Wrong::find()->where([
"t.fdUserID" => 4,
"t.fdStatus" => 0
])->alias("t")->leftJoin(Exercise::tableName()." exercise","exercise.id=t.fdExerciseID",["exercise.fdStatus"=>1]);
print_r($sql->createCommand()->getRawSql());
printed sql statement is
SELECT `t`.* FROM `tbWrong` `t` LEFT JOIN `tbExercise` `exercise` ON exercise.id=t.fdExerciseID WHERE (`t`.`fdUserID`=4) AND (`t`.`fdStatus`=0)
I would like to ask why the exercise.fdStatus=1 condition has not been generated, and how to generate the desired sql statement
SELECT `t`.* FROM `tbWrong` `t` LEFT JOIN `tbExercise` `exercise` ON (exercise.id=t.fdExerciseID AND exercise.fdStatus=1) WHERE (`t`.`fdUserID`=4) AND (`t`.`fdStatus`=0)