添加API SyncStoresCourierInfo
This commit is contained in:
@@ -208,7 +208,7 @@ func GetStoreDetail2(db *DaoDB, storeID int, vendorStoreID string, vendorID int)
|
||||
return storeDetail, err
|
||||
}
|
||||
|
||||
func GetStoreCourierList(db *DaoDB, storeIDs []int, status int) (courierStoreList []*model.StoreCourierMap, err error) {
|
||||
func GetStoreCourierList(db *DaoDB, storeIDs []int, status, auditStatus int) (courierStoreList []*model.StoreCourierMap, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM store_courier_map t1
|
||||
@@ -225,6 +225,10 @@ func GetStoreCourierList(db *DaoDB, storeIDs []int, status int) (courierStoreLis
|
||||
sql += " AND t1.status = ?"
|
||||
sqlParams = append(sqlParams, status)
|
||||
}
|
||||
if auditStatus != model.StoreAuditStatusAll {
|
||||
sql += " AND t1.audit_status = ?"
|
||||
sqlParams = append(sqlParams, auditStatus)
|
||||
}
|
||||
if err = GetRows(db, &courierStoreList, sql, sqlParams...); err == nil {
|
||||
return courierStoreList, nil
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ func TestGetStoreDetail(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetStoreCourierList(t *testing.T) {
|
||||
storeCourierList, err := GetStoreCourierList(GetDB(), []int{100119}, model.StoreStatusOpened)
|
||||
storeCourierList, err := GetStoreCourierList(GetDB(), []int{100119}, model.StoreStatusOpened, model.StoreAuditStatusOnline)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ const (
|
||||
StoreAuditStatusCreated = 1
|
||||
StoreAuditStatusOnline = 0
|
||||
StoreAuditStatusRejected = -1
|
||||
StoreAuditStatusAll = -9
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -391,6 +392,11 @@ type StoreCourierMap struct {
|
||||
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
|
||||
Status int `json:"status"`
|
||||
AuditStatus int `json:"auditStatus"`
|
||||
|
||||
// 以下数据仅用于同步使用
|
||||
Lng int `json:"-"` // 乘了10的6次方
|
||||
Lat int `json:"-"` // 乘了10的6次方
|
||||
Remark string `orm:"size(255)" json:"-"`
|
||||
}
|
||||
|
||||
func (*StoreCourierMap) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user