|
@@ -4856,6 +4856,12 @@ func GetOutExprotList(orgid int64, ids []string, startime int64, endtime int64)
|
4856
|
4856
|
if orgid > 0 {
|
4857
|
4857
|
db = db.Where("x.org_id = ?", orgid)
|
4858
|
4858
|
}
|
|
4859
|
+ if orgid > 0 {
|
|
4860
|
+ db = db.Where("t.org_id = ?", orgid)
|
|
4861
|
+ }
|
|
4862
|
+ if orgid > 0 {
|
|
4863
|
+ db = db.Where("p.org_id = ?", orgid)
|
|
4864
|
+ }
|
4859
|
4865
|
|
4860
|
4866
|
if len(ids) > 0 {
|
4861
|
4867
|
db = db.Where("x.warehouse_out_id in (?)", ids)
|
|
@@ -5309,13 +5315,13 @@ func GetDrugBatchNumber(drug_id int64, orgid int64) (info []*models.DrugWarehous
|
5309
|
5315
|
return info, err
|
5310
|
5316
|
}
|
5311
|
5317
|
|
5312
|
|
-func ExportDrugList(warehouse_out_id []string) (out []*models.StDrugWarehouseInfo, err error) {
|
|
5318
|
+func ExportDrugList(warehouse_out_id []string, org_id int64) (out []*models.StDrugWarehouseInfo, err error) {
|
5313
|
5319
|
|
5314
|
|
- db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status =1")
|
|
5320
|
+ db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status =1 AND x.org_id=?", org_id)
|
5315
|
5321
|
|
5316
|
|
- table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1")
|
|
5322
|
+ table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1 and b.org_id = ?", org_id)
|
5317
|
5323
|
|
5318
|
|
- tableOne := XTReadDB().Table("xt_drug_warehouse as p")
|
|
5324
|
+ tableOne := XTReadDB().Table("xt_drug_warehouse as p").Where("p.status=1 and p.org_id=?", org_id)
|
5319
|
5325
|
fmt.Println("table", table)
|
5320
|
5326
|
fmt.Println("tableOne", tableOne)
|
5321
|
5327
|
if len(warehouse_out_id) > 0 {
|
|
@@ -5337,9 +5343,9 @@ func GetExportOutOrderDrugList(warehouse_out_id []string) (out []*models.StDrugW
|
5337
|
5343
|
return out, err
|
5338
|
5344
|
}
|
5339
|
5345
|
|
5340
|
|
-func GetExportOutOrderDrugListOne(warehouse_out_id []string) (out []*models.StDrugWarehouseOutInfo, err error) {
|
5341
|
|
- db := XTReadDB().Table("xt_drug_flow as x").Where("x.status = 1")
|
5342
|
|
- table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1")
|
|
5346
|
+func GetExportOutOrderDrugListOne(warehouse_out_id []string, org_id int64) (out []*models.StDrugWarehouseOutInfo, err error) {
|
|
5347
|
+ db := XTReadDB().Table("xt_drug_flow as x").Where("x.status = 1 and x.user_org_id =?", org_id)
|
|
5348
|
+ table := XTReadDB().Table("xt_base_drug as b").Where("b.status = 1 and b.org_id = ?", org_id)
|
5343
|
5349
|
fmt.Println("table", table)
|
5344
|
5350
|
if len(warehouse_out_id) > 0 {
|
5345
|
5351
|
db = db.Where("x.warehouse_out_id in(?)", warehouse_out_id)
|