This commit is contained in:
邹宗楠
2025-07-22 16:20:08 +08:00
parent 19bbf87e38
commit 40f034388c
5 changed files with 60 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import (
"time"
)
func GetStoreContract(db *DaoDB, storeId int, orderId string) (*model.LakalaContract, error) {
func GetStoreContract(db *DaoDB, storeId int, orderId string, contractApplyId string) (*model.LakalaContract, error) {
merchantObj := &model.LakalaContract{}
param := []interface{}{}
sql := ` SELECT * FROM lakala_contract WHERE 1=1`
@@ -21,6 +21,12 @@ func GetStoreContract(db *DaoDB, storeId int, orderId string) (*model.LakalaCont
sql += ` AND contract_id = ?`
param = append(param, orderId)
}
if contractApplyId != "" {
sql += ` AND contract_apply_id = ?`
param = append(param, contractApplyId)
}
if err := GetRow(db, merchantObj, sql, param...); err != nil {
return nil, err
}