找一條記錄

$customer = Customer::findOne(10);

要麼

$customer = Customer::find()->where(['id' => 10])->one();

要麼

$customer = Customer::find()->select('name,age')->where(['id' => 10])->one();

要麼

$customer = Customer::findOne(['age' => 30, 'status' => 1]);

要麼

$customer = Customer::find()->where(['age' => 30, 'status' => 1])->one();