| | |
| | | return |
| | | } |
| | | |
| | | productList := make([]testResp.Material, len(list)) |
| | | productList := make([]testResp.Material, 0) |
| | | |
| | | for _, item := range list { |
| | | productList = append(productList, testResp.Material{ |
| | |
| | | db := global.GVA_DB.Model(&test.Material{}) |
| | | var ps []test.Material |
| | | if info.Keyword != "" { |
| | | db = db.Where("name LIKE ? or number LIKE ?", "%"+info.Name+"%", "%"+info.Number+"%") |
| | | db = db.Where("name LIKE ? or id LIKE ?", "%"+info.Keyword+"%", "%"+info.Keyword+"%") |
| | | } |
| | | |
| | | db = db.Where("purchase_type = ?", test.PurchaseTypeOutSource) |
| | |
| | | if info.CreatedAt != nil { |
| | | db = db.Where("created_at = ?", info.CreatedAt) |
| | | } |
| | | if info.Status != 0 { |
| | | db = db.Where("status = ?", info.Status) |
| | | } |
| | | err = db.Count(&total).Error |
| | | if err != nil { |
| | | return |