|
@@ -14,8 +14,8 @@ func FindName(code string) (fistname models.SpSupplierContacts, err error) {
|
14
|
14
|
}
|
15
|
15
|
|
16
|
16
|
//供应商分页
|
17
|
|
-func GetSupplyList(ctype int64, page int64, limit int64, keyword string) (supplylist []*models.SpSupplierName, total int64, err error) {
|
18
|
|
- db := XTReadDB().Model(&supplylist).Where("xt_supplier_name.status = 1 ")
|
|
17
|
+func GetSupplyList(ctype int64, page int64, limit int64, keyword string, orgid int64) (supplylist []*models.SpSupplierName, total int64, err error) {
|
|
18
|
+ db := XTReadDB().Model(&supplylist).Where("xt_supplier_name.status = 1 and xt_supplier_name.user_org_id = ?", orgid)
|
19
|
19
|
|
20
|
20
|
offset := (page - 1) * limit
|
21
|
21
|
|
|
@@ -167,7 +167,7 @@ func GetSupplyAndContactOne(id int64) (supply models.SpSupplierName, contact []*
|
167
|
167
|
|
168
|
168
|
//删除供应商及联系人
|
169
|
169
|
func DelSupply(supply models.SpSupplierName) error {
|
170
|
|
- err := XTWriteDB().Model(&supply).Update("status", 0).Error
|
|
170
|
+ err := XTWriteDB().Model(&supply).Where("id =? and status = 1", supply.ID).Updates(map[string]interface{}{"status": 0}).Error
|
171
|
171
|
return err
|
172
|
172
|
}
|
173
|
173
|
|