This commit is contained in:
苏尹岚
2021-03-01 09:12:05 +08:00
parent 966a11f394
commit 7d2c15935b
2 changed files with 32 additions and 1 deletions

View File

@@ -261,6 +261,37 @@ func GetStoreCourierList(db *DaoDB, storeIDs, vendorIDs []int, status, auditStat
return nil, err
}
func GetStoreCourierList2(db *DaoDB, storeIDs, vendorIDs []int, status int, auditStatuss []int) (courierStoreList []*model.StoreCourierMap, err error) {
sql := `
SELECT t1.*
FROM store_courier_map t1
WHERE t1.deleted_at = ?
`
sqlParams := []interface{}{
utils.DefaultTimeValue,
}
if len(storeIDs) > 0 {
sql += " AND t1.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
if len(vendorIDs) > 0 {
sql += " AND t1.vendor_id IN (" + GenQuestionMarks(len(vendorIDs)) + ")"
sqlParams = append(sqlParams, vendorIDs)
}
if status != model.StoreStatusAll {
sql += " AND t1.status = ?"
sqlParams = append(sqlParams, status)
}
if len(auditStatuss) > 0 {
sql += " AND t1.audit_status IN (" + GenQuestionMarks(len(auditStatuss)) + ")"
sqlParams = append(sqlParams, auditStatuss)
}
if err = GetRows(db, &courierStoreList, sql, sqlParams...); err == nil {
return courierStoreList, nil
}
return nil, err
}
func GetStoresMapList2(db *DaoDB, vendorIDs, storeIDs, storeStatuss []int, status, isSync int, pricePack, name, vendorOrgCode string, mustDirty bool) (storeMapList []*model.StoreMap, err error) {
sql := `
SELECT t1.*