|
@@ -2739,6 +2739,7 @@ func GetAllStockList(page int64, limit int64, startime int64, endtime int64, goo
|
2739
|
2739
|
|
2740
|
2740
|
offset := (page - 1) * limit
|
2741
|
2741
|
db := XTReadDB().Table("xt_warehouse_info as x").Where("x.status= 1")
|
|
2742
|
+
|
2742
|
2743
|
table := XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
|
2743
|
2744
|
fmt.Println(table)
|
2744
|
2745
|
if startime > 0 {
|
|
@@ -2758,7 +2759,7 @@ func GetAllStockList(page int64, limit int64, startime int64, endtime int64, goo
|
2758
|
2759
|
if good_type > 0 {
|
2759
|
2760
|
db = db.Where("t.good_type_id = ?", good_type)
|
2760
|
2761
|
}
|
2761
|
|
- err = db.Select("x.id,x.warehousing_id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.warehousing_unit,x.stock_count,x.price,x.total_price,x.dealer,x.manufacturer,x.remark,x.ctime,x.is_return,x.warehousing_order,x.type,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.min_unit").Joins("left join xt_good_information as t on t.id = x.good_id").Offset(offset).Count(&total).Group("x.good_id").Scan(&info).Error
|
|
2762
|
+ err = db.Select("x.id,x.warehousing_id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,x.warehousing_count,x.warehousing_unit,x.stock_count,x.price,x.total_price,x.dealer,x.remark,x.ctime,x.is_return,x.warehousing_order,x.type,t.good_name,t.good_type_id,t.specification_name,t.min_number,t.min_unit,t.manufacturer").Joins("left join xt_good_information as t on t.id = x.good_id").Offset(offset).Count(&total).Group("x.good_id").Scan(&info).Error
|
2762
|
2763
|
return info, total, err
|
2763
|
2764
|
}
|
2764
|
2765
|
|