liujiandao
2024-01-08 dcf9d1324c4ecc23bc0b120ee9af9f0f74cde034
models/operation_type.go
@@ -36,6 +36,7 @@
      ReturnOperationType           string                     `json:"returnOperationType" gorm:"-"`                                   //退货类型名称
      ReadyCount                    int                        `json:"readyCount" gorm:"-"`                                            //就绪数量
      FinishCount                   int                        `json:"finishCount" gorm:"-"`                                           //完成数量
      CancelCount                   int                        `json:"cancelCount" gorm:"-"`                                           //取消数量
   }
   OperationTypeSearch struct {
@@ -133,6 +134,10 @@
   if slf.WarehouseId > 0 {
      db = db.Where("warehouse_id = ?", slf.WarehouseId)
   }
   if int(slf.BaseOperationType) != 0 {
      db = db.Where("base_operation_type = ?", slf.BaseOperationType)
   }
   return db
@@ -291,7 +296,8 @@
      records = make([]*OperationTypeByStatus, 0)
      db      = slf.Orm
   )
   db = db.Table("wms_job_type").Select("wms_job_type.id,wms_operation.status,count(wms_operation.id) as count").InnerJoins("inner join wms_operation on wms_operation.operation_type_id=wms_job_type.id").Group("wms_job_type.id,wms_operation.status")
   db = db.Table("wms_job_type").Select("wms_job_type.id,wms_operation.status,count(wms_operation.id) as count").InnerJoins("inner join wms_operation on wms_operation.operation_type_id=wms_job_type.id").Where("wms_operation.deleted_at is null").
      Group("wms_job_type.id,wms_operation.status")
   if len(idList) > 0 {
      db = db.Where("wms_job_type.id IN ?", idList)
   }