|
|
@@ -14,9 +14,17 @@ func (CaptureVehicles) TableName() string {
|
|
|
return "capture_vehicles"
|
|
|
}
|
|
|
|
|
|
-func QueryCaptureVehiclesList(limit, offset int) (captureVehicles []CaptureVehicles, total int64, err error) {
|
|
|
+func QueryCaptureVehiclesList(limit, offset, vehicleType int, sLicense string) (captureVehicles []CaptureVehicles, total int64, err error) {
|
|
|
db := global.GVA_DB.Model(&CaptureVehicles{})
|
|
|
|
|
|
+ if vehicleType != 0 {
|
|
|
+ db = db.Where("vehicle_type = ?", vehicleType)
|
|
|
+ }
|
|
|
+
|
|
|
+ if sLicense != "" {
|
|
|
+ db = db.Where("sLicense = ?", sLicense)
|
|
|
+ }
|
|
|
+
|
|
|
err = db.Count(&total).Error
|
|
|
if err != nil {
|
|
|
return
|