/** * 根据用户id和测试类型查询 * @param $userId * @param $testTypeId * @return array|null|\common\models\CurrentTestLibrary */ public static function findByUserAndTestType($userId, $testTypeId) { return CurrentTestLibrary::find()->where(['userId' => $userId, 'testTypeId' => $testTypeId])->one(); }