|
@@ -41,7 +41,7 @@ func AccountIncome(ctx context.Context, talentId string) (*http_model.TalentInfo
|
|
|
db := GetReadDB(ctx)
|
|
|
var talentInfo *gorm_model.YoungeeTalentInfo
|
|
|
// 根据 talent_id 进行筛选
|
|
|
- err := db.Debug().Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", talentId).
|
|
|
+ err := db.Model(gorm_model.YoungeeTalentInfo{}).Where("id = ?", talentId).
|
|
|
First(&talentInfo).Error
|
|
|
if err != nil {
|
|
|
if err == gorm.ErrRecordNotFound {
|
|
@@ -64,7 +64,7 @@ func AccountIncome(ctx context.Context, talentId string) (*http_model.TalentInfo
|
|
|
err = db1.Debug().Model(gorm_model.YoungeeTalentDeliveryAddress{}).
|
|
|
Where("talent_id = ? AND default_tag = ?", talentId, 1).
|
|
|
First(&deliveryInfo).Error
|
|
|
- fmt.Printf("deliveryInfo%+v\n", deliveryInfo)
|
|
|
+ //fmt.Printf("deliveryInfo%+v\n", deliveryInfo)
|
|
|
if err != nil {
|
|
|
if err == gorm.ErrRecordNotFound {
|
|
|
return nil, nil
|
|
@@ -77,32 +77,40 @@ func AccountIncome(ctx context.Context, talentId string) (*http_model.TalentInfo
|
|
|
data.PhoneNumber = deliveryInfo.PhoneNumber
|
|
|
data.DetailAddr = region + deliveryInfo.DetailAddr
|
|
|
} else {
|
|
|
- data.ReceiverName = "暂未绑定物流地址"
|
|
|
- data.PhoneNumber = "暂未绑定物流地址"
|
|
|
- data.DetailAddr = "暂未绑定物流地址"
|
|
|
- }
|
|
|
- db2 := GetReadDB(ctx)
|
|
|
- var talentBankInfo *gorm_model.YounggeeTalentBank
|
|
|
- err = db2.Debug().Model(gorm_model.YounggeeTalentBank{}).Where("talent_id = ?", talentId).
|
|
|
- First(&talentBankInfo).Error
|
|
|
- if err != nil {
|
|
|
- if err == gorm.ErrRecordNotFound {
|
|
|
- return nil, nil
|
|
|
- } else {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
+ data.ReceiverName = "暂无"
|
|
|
+ data.PhoneNumber = "暂无"
|
|
|
+ data.DetailAddr = "暂无"
|
|
|
}
|
|
|
region := ""
|
|
|
- if talentBankInfo.BankOpenAddress != 0 {
|
|
|
- region = GetRegion(ctx, talentBankInfo.BankOpenAddress)
|
|
|
+ if talentInfo.IsBindBank == 1 {
|
|
|
+ db2 := GetReadDB(ctx)
|
|
|
+ var talentBankInfo *gorm_model.YounggeeTalentBank
|
|
|
+ err = db2.Model(gorm_model.YounggeeTalentBank{}).Where("talent_id = ?", talentId).
|
|
|
+ First(&talentBankInfo).Error
|
|
|
+ if err != nil {
|
|
|
+ if err == gorm.ErrRecordNotFound {
|
|
|
+ return nil, nil
|
|
|
+ } else {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if talentBankInfo.BankOpenAddress != 0 {
|
|
|
+ region = GetRegion(ctx, talentBankInfo.BankOpenAddress)
|
|
|
+ }
|
|
|
+ data.Bank = talentBankInfo.Bank
|
|
|
+ data.BankOpenAddress = region
|
|
|
+ data.BankCardNumber = talentBankInfo.BankCardNumber
|
|
|
+ data.Name = talentBankInfo.Name
|
|
|
+ data.AliPayNumber = "暂无"
|
|
|
+ data.AliPayRealName = "暂无"
|
|
|
+ } else {
|
|
|
+ data.Bank = "暂无"
|
|
|
+ data.BankCardNumber = "暂无"
|
|
|
+ data.BankOpenAddress = "暂无"
|
|
|
+ data.Name = "暂无"
|
|
|
+ data.AliPayNumber = "暂无"
|
|
|
+ data.AliPayRealName = "暂无"
|
|
|
}
|
|
|
-
|
|
|
- data.Bank = talentBankInfo.Bank
|
|
|
- data.BankOpenAddress = region
|
|
|
- data.BankCardNumber = talentBankInfo.BankCardNumber
|
|
|
- data.Name = talentBankInfo.Name
|
|
|
- data.AliPayNumber = talentBankInfo.AlipayNumber
|
|
|
- data.AliPayRealName = talentBankInfo.AlipayRealName
|
|
|
return data, err
|
|
|
}
|
|
|
|