Browse Source

punishment

bucket 6 years ago
parent
commit
4a835a6b8e

+ 6 - 2
src/views/agnetManagement/gambleMemberManagement/index.vue

178
       this.combine = []
178
       this.combine = []
179
        let combine = []
179
        let combine = []
180
       await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
180
       await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
181
-       
181
+       console.log('response', response.data.rows)
182
         response.data.rows.map(member => {
182
         response.data.rows.map(member => {
183
           let row = {
183
           let row = {
184
             id: member.id,
184
             id: member.id,
245
           }
245
           }
246
           row.memberCheckOut = (row.totalUp + row.totalDown - row.chips)*(-1)
246
           row.memberCheckOut = (row.totalUp + row.totalDown - row.chips)*(-1)
247
           // TODO CHECK 是否需要
247
           // TODO CHECK 是否需要
248
+          let punishment =  _.sumBy(member['GambleGame-Bucket-PunishmentRecords'], item => {
249
+              return (item.chips)*(-1)
250
+          })
248
           if(chipsLog['1']) {
251
           if(chipsLog['1']) {
249
             row.totalReward = _.sumBy(chipsLog['1'], (item) => { 
252
             row.totalReward = _.sumBy(chipsLog['1'], (item) => { 
250
               return item.chips > 0 ? item.chips : 0
253
               return item.chips > 0 ? item.chips : 0
251
             })
254
             })
252
             row.totalPunishment = _.sumBy(chipsLog['1'], (item) => { 
255
             row.totalPunishment = _.sumBy(chipsLog['1'], (item) => { 
253
               return item.chips < 0 ? item.chips : 0
256
               return item.chips < 0 ? item.chips : 0
254
-            })
257
+            });
255
           }
258
           }
259
+          row.totalPunishment += punishment
256
           // console.log('www',row)
260
           // console.log('www',row)
257
 
261
 
258
           combine.push(row)
262
           combine.push(row)

+ 1 - 1
src/views/agnetManagement/index.vue

184
             let allDown = _.sumBy(combine, 'totalDown')
184
             let allDown = _.sumBy(combine, 'totalDown')
185
             let allChips = _.sumBy(combine, 'chips')
185
             let allChips = _.sumBy(combine, 'chips')
186
             let allEarned = _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned})
186
             let allEarned = _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned})
187
-            let allServiceFees = _.sumBy(combine, (item) => {return item.totalServiceFees})
187
+            let allServiceFees = _.sumBy(combine, (item) => {return item.totalServiceFees}).toFixed(2)
188
             agent.all = (allUp+allDown-allChips-allServiceFees)*(-1)
188
             agent.all = (allUp+allDown-allChips-allServiceFees)*(-1)
189
             this.list.push(agent)
189
             this.list.push(agent)
190
             
190