|
@@ -308,7 +308,7 @@ func SaveContacts(spcontacts models.SpSupplierContacts, tx *gorm.DB) error {
|
308
|
308
|
|
309
|
309
|
func GetSupplyDrugList(orgid int64) (drug []*models.SpBaseDrug, err error) {
|
310
|
310
|
|
311
|
|
- db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1")
|
|
311
|
+ db := XTReadDB().Table("xt_base_drug as x").Where("x.status = 1 AND find_in_set('停用',drug_status) = 0")
|
312
|
312
|
|
313
|
313
|
if orgid > 0 {
|
314
|
314
|
db = db.Where("x.org_id = ?", orgid)
|
|
@@ -320,7 +320,7 @@ func GetSupplyDrugList(orgid int64) (drug []*models.SpBaseDrug, err error) {
|
320
|
320
|
|
321
|
321
|
func GetSupplyGoodList(orgid int64) (good []*models.SpGoodInformation, err error) {
|
322
|
322
|
|
323
|
|
- db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1")
|
|
323
|
+ db := XTReadDB().Table("xt_good_information as x").Where("x.status = 1 AND find_in_set('停用',good_status) = 0")
|
324
|
324
|
|
325
|
325
|
if orgid > 0 {
|
326
|
326
|
db = db.Where("x.org_id = ?", orgid)
|
|
@@ -382,7 +382,7 @@ func GetAllPurchaseOrderList(check_id int64, startime int64, endtime int64, keyw
|
382
|
382
|
if orgid > 0 {
|
383
|
383
|
db = db.Where("sgj_xt.xt_supplier_warehouse_info.user_org_id = ?", orgid)
|
384
|
384
|
}
|
385
|
|
- err = db.Count(&total).Offset(offset).Limit(limit).Preload("SupplierWarehousingInfoOrder", "status= 1 and user_org_id = ?", orgid).Preload("SpSupplierWarehouseOut", "status = 1 and user_org_id =?", orgid).Find(&info).Error
|
|
385
|
+ err = db.Count(&total).Offset(offset).Limit(limit).Preload("SupplierWarehousingInfoOrder", "status= 1 and user_org_id = ?", orgid).Preload("SpSupplierWarehouseOut", "status = 1 and user_org_id =?", orgid).Order("ctime desc").Find(&info).Error
|
386
|
386
|
return info, total, err
|
387
|
387
|
}
|
388
|
388
|
|
|
@@ -479,7 +479,7 @@ func GetAllGoodOderList(check_id int64, keyword string, page int64, limit int64,
|
479
|
479
|
if orgid > 0 {
|
480
|
480
|
db = db.Where("sgj_xt.xt_supplier_warehouse_out.user_org_id = ?", orgid)
|
481
|
481
|
}
|
482
|
|
- err = db.Count(&total).Offset(offset).Limit(limit).Preload("SpSupplierWarehousingOutOrder", "status= 1 and user_org_id = ?", orgid).Preload("SpSupplierWarehousingCancelOrder", "status= 1 and user_org_id = ?", orgid).Find(&out).Error
|
|
482
|
+ err = db.Count(&total).Offset(offset).Limit(limit).Preload("SpSupplierWarehousingOutOrder", "status= 1 and user_org_id = ?", orgid).Preload("SpSupplierWarehousingCancelOrder", "status= 1 and user_org_id = ?", orgid).Order("ctime desc").Find(&out).Error
|
483
|
483
|
return out, total, err
|
484
|
484
|
}
|
485
|
485
|
|
|
@@ -653,7 +653,7 @@ func GetAllGoodReturnOrderList(checkid int64, keyword string, page int64, limit
|
653
|
653
|
if orgid > 0 {
|
654
|
654
|
db = db.Where("sgj_xt.xt_supplier_warehouse_cancel.user_org_id = ?", orgid)
|
655
|
655
|
}
|
656
|
|
- err = db.Count(&total).Offset(offset).Limit(limit).Preload("SpSupplierWarehousingCancelOrder", "status= 1 and user_org_id = ?", orgid).Find(&order).Error
|
|
656
|
+ err = db.Count(&total).Offset(offset).Limit(limit).Preload("SpSupplierWarehousingCancelOrder", "status= 1 and user_org_id = ?", orgid).Order("ctime desc").Find(&order).Error
|
657
|
657
|
return order, total, err
|
658
|
658
|
}
|
659
|
659
|
|