@@ -94,30 +94,30 @@ func (impl ImageScanResultRepositoryImpl) FetchByScanExecutionId(scanExecutionId
9494 Where("image_scan_execution_result.scan_execution_id = ?", id).Select()
9595 */
9696
97- err := impl .dbConnection .Model (& models ).ColumnExpr ( "DISTINCT cve_store_name" ). Column ("image_scan_execution_result.*" , "CveStore" ).
97+ err := impl .dbConnection .Model (& models ).Column ("image_scan_execution_result.*" , "CveStore" ).
9898 Where ("image_scan_execution_result.image_scan_execution_history_id = ?" , scanExecutionId ).
9999 Select ()
100100 return models , err
101101}
102102
103103func (impl ImageScanResultRepositoryImpl ) FetchByScanExecutionIds (ids []int ) ([]* ImageScanExecutionResult , error ) {
104104 var models []* ImageScanExecutionResult
105- err := impl .dbConnection .Model (& models ).ColumnExpr ( "DISTINCT cve_store_name" ). Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
105+ err := impl .dbConnection .Model (& models ).Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
106106 Where ("image_scan_execution_result.image_scan_execution_history_id in(?)" , pg .In (ids )).
107107 Select ()
108108 return models , err
109109}
110110
111111func (impl ImageScanResultRepositoryImpl ) FindByImageDigest (imageDigest string ) ([]* ImageScanExecutionResult , error ) {
112112 var model []* ImageScanExecutionResult
113- err := impl .dbConnection .Model (& model ).ColumnExpr ( "DISTINCT cve_store_name" ). Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
113+ err := impl .dbConnection .Model (& model ).Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
114114 Where ("image_scan_execution_history.image_hash = ?" , imageDigest ).Order ("image_scan_execution_history.execution_time desc" ).Select ()
115115 return model , err
116116}
117117
118118func (impl ImageScanResultRepositoryImpl ) FindByImageDigests (digest []string ) ([]* ImageScanExecutionResult , error ) {
119119 var models []* ImageScanExecutionResult
120- err := impl .dbConnection .Model (& models ).ColumnExpr ( "DISTINCT cve_store_name" ). Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
120+ err := impl .dbConnection .Model (& models ).Column ("image_scan_execution_result.*" , "ImageScanExecutionHistory" , "CveStore" ).
121121 Where ("image_hash in (?)" , pg .In (digest )).Order ("execution_time desc" ).Select ()
122122 return models , err
123123}
0 commit comments