作者 陈志颖

fix:修复导出素币兑换记录

@@ -70,13 +70,13 @@ func (repository *SuMoneyTransactionRecordRepository) FindById(queryOptions map[ @@ -70,13 +70,13 @@ func (repository *SuMoneyTransactionRecordRepository) FindById(queryOptions map[
70 var suMoneyTransactionRecordModels []*models.SuMoneyTransactionRecord 70 var suMoneyTransactionRecordModels []*models.SuMoneyTransactionRecord
71 suMoneyTransactionRecords := make([]*domain.SuMoneyTransactionRecord, 0) 71 suMoneyTransactionRecords := make([]*domain.SuMoneyTransactionRecord, 0)
72 query := tx.Model(&suMoneyTransactionRecordModels) 72 query := tx.Model(&suMoneyTransactionRecordModels)
73 - query = query.Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint") 73 + //query = query.Join("JOIN employees AS e ON e.uid = (su_money_transaction_record.employee->>'uid')::bigint")
74 if iDs, ok := queryOptions["ids"]; ok && len(iDs.([]int)) != 0 { 74 if iDs, ok := queryOptions["ids"]; ok && len(iDs.([]int)) != 0 {
75 query = query.Where(`su_money_transaction_record.id IN (?)`, pg.In(iDs.([]int))) 75 query = query.Where(`su_money_transaction_record.id IN (?)`, pg.In(iDs.([]int)))
76 } 76 }
77 if where, ok := queryOptions["where"]; ok && where.(map[string]interface{}) != nil { 77 if where, ok := queryOptions["where"]; ok && where.(map[string]interface{}) != nil {
78 - if companyId, ok := where.(map[string]interface{})["companyId"]; ok && companyId.(float64) != 0 {  
79 - query = query.Where("e.company_id = ?", companyId) 78 + if uid, ok := where.(map[string]interface{})["uid"]; ok && (uid != int64(0)) {
  79 + query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid)
80 } 80 }
81 } 81 }
82 //query = query.Where(`e.status = ?`, 1) 82 //query = query.Where(`e.status = ?`, 1)