ソースを参照

1.ipad端

master
huangjiajun 8ヶ月前
コミット
c00453c571
2個のファイルの変更14行の追加14行の削除
  1. +7
    -7
      app/db/db_order_goods_doing.go
  2. +7
    -7
      app/db/db_order_list.go

+ 7
- 7
app/db/db_order_goods_doing.go ファイルの表示

@@ -17,14 +17,14 @@ func GetOrderGoodsByRecordId(eg *xorm.Engine, id string) *model.OrderGoodsDoing
func GetOrderGoodsDoingList(eg *xorm.Engine, param map[string]string) (*[]model.OrderGoodsDoing, int64) {
var order []model.OrderGoodsDoing
sess := eg.Where("1=1")
if param["enterprise_name"] != "" {
var data []model.Enterprise
eg.Where("name like ?", "%"+param["enterprise_name"]+"%")
if param["admin_name"] != "" {
var data []model.Admin
eg.Where("memo like ?", "%"+param["admin_name"]+"%")
ids := []int{-1}
for _, v := range data {
ids = append(ids, v.Id)
ids = append(ids, v.AdmId)
}
sess.In("enterprise_id", ids)
sess.In("admin_id", ids)
}
if param["oid"] != "" {
sess.And("oid like ?", "%"+param["oid"]+"%")
@@ -32,8 +32,8 @@ func GetOrderGoodsDoingList(eg *xorm.Engine, param map[string]string) (*[]model.
if param["state"] != "" {
sess.And("state =?", param["state"])
}
if param["admin_id"] != "" {
sess.And("admin_id =?", param["admin_id"])
if param["enterprise_id"] != "" {
sess.And("enterprise_id =?", param["enterprise_id"])
}
if param["goods_title"] != "" {
sess.And("goods_title like ?", "%"+param["goods_title"]+"%")


+ 7
- 7
app/db/db_order_list.go ファイルの表示

@@ -52,14 +52,14 @@ func GetOrderList(eg *xorm.Engine, param map[string]string) (*[]model.Order, int
if param["state"] != "" {
sess.And("state =?", param["state"])
}
if param["goods_title"] != "" {
var orderGoods []model.OrderGoods
eg.Where("goods_title like ?", "%"+param["goods_title"]+"%").Find(&orderGoods)
oids := []int64{-1}
for _, v := range orderGoods {
oids = append(oids, v.Oid)
if param["enterprise_name"] != "" {
var enterprise []model.Enterprise
eg.Where("name like ?", "%"+param["enterprise_name"]+"%").Find(&enterprise)
oids := []int{-1}
for _, v := range enterprise {
oids = append(oids, v.Id)
}
sess.In("oid", oids)
sess.In("enterprise_id", oids)
}
size := utils.StrToInt(param["limit"])
start := (utils.StrToInt(param["page"]) - 1) * size


読み込み中…
キャンセル
保存