|
|
@@ -1,6 +1,8 @@
|
|
|
package daytask
|
|
|
|
|
|
import (
|
|
|
+ "encoding/json"
|
|
|
+
|
|
|
model "go_server/model/biz_modules/daytask"
|
|
|
"go_server/model/common/response"
|
|
|
"go_server/service/base"
|
|
|
@@ -65,6 +67,37 @@ func (s *DtWithdrawOrderService) Find(c *gin.Context) {
|
|
|
response.Resp(c, err.Error())
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ // 兼容旧数据:从 paymentInfo 中解析收款信息,补充到新字段
|
|
|
+ type paymentInfo struct {
|
|
|
+ Type string `json:"type"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ Account string `json:"account"`
|
|
|
+ BankName string `json:"bankName"`
|
|
|
+ }
|
|
|
+ for i := range resp.List {
|
|
|
+ info := resp.List[i].PaymentInfo
|
|
|
+ if info == "" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ var p paymentInfo
|
|
|
+ if err := json.Unmarshal([]byte(info), &p); err != nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ if resp.List[i].Channel == "" {
|
|
|
+ resp.List[i].Channel = p.Type
|
|
|
+ }
|
|
|
+ if resp.List[i].ReceiveAccount == "" {
|
|
|
+ resp.List[i].ReceiveAccount = p.Account
|
|
|
+ }
|
|
|
+ if resp.List[i].ReceiveName == "" {
|
|
|
+ resp.List[i].ReceiveName = p.Name
|
|
|
+ }
|
|
|
+ if resp.List[i].BankName == "" {
|
|
|
+ resp.List[i].BankName = p.BankName
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
response.Resp(c, map[string]interface{}{
|
|
|
"cols": colInfo,
|
|
|
"list": resp.List,
|