Browse Source

add feature

Unknown 6 years ago
parent
commit
8e96efc2b6
1 changed files with 21 additions and 6 deletions
  1. 21 6
      src/views/gambleGameBucket/detail/index.vue

+ 21 - 6
src/views/gambleGameBucket/detail/index.vue

181
       memberRecord: [],
181
       memberRecord: [],
182
       door: 0,
182
       door: 0,
183
       // bidChips: 0,
183
       // bidChips: 0,
184
+      memberRecordTemp: [],
184
       wagerRecord: [],
185
       wagerRecord: [],
185
     }
186
     }
186
   },
187
   },
239
         })
240
         })
240
       })
241
       })
241
       fetchMemberRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
242
       fetchMemberRecords(this.data.secondLayer, this.query.secondLayer).then(response => {
242
-        memberRecordTemp = _.groupBy(response.data.rows, record => {
243
+        this.memberRecordTemp = response.data.rows
244
+        let memberRecordTemp = _.groupBy(response.data.rows, record => {
243
           return record.door
245
           return record.door
244
         })
246
         })
245
-        this.memberRecord = Object.values(memberRecordTemp)
247
+        this.memberRecord = Object.values(memberRecordTemp )
246
       })
248
       })
247
       fetchDetails(this.data.secondLayer, this.query.secondLayer).then(response => {
249
       fetchDetails(this.data.secondLayer, this.query.secondLayer).then(response => {
248
         detailTemp = response.data.rows.filter(record => {
250
         detailTemp = response.data.rows.filter(record => {
270
           return Math.abs(item.MemberRecord.earned) ;
272
           return Math.abs(item.MemberRecord.earned) ;
271
         })
273
         })
272
         this.bookie[0].bookieResult = this.bookie[0].MemberRecord.earned - this.bookie[0].MemberRecord.serviceFees
274
         this.bookie[0].bookieResult = this.bookie[0].MemberRecord.earned - this.bookie[0].MemberRecord.serviceFees
273
-        console.log('bookie', this.bookie[0].effectiveWagger)
275
+        // console.log('bookie', this.bookie[0].effectiveWagger)
274
         this.group.map((item, itemIndex) => {
276
         this.group.map((item, itemIndex) => {
275
           let totalChips = 0
277
           let totalChips = 0
276
           item.map((person, personIndex) => {
278
           item.map((person, personIndex) => {
306
       })
308
       })
307
 
309
 
308
       fetchGambleMemberList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
310
       fetchGambleMemberList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
309
-        const { rows } = response.data
310
-        console.log('sss', this.detail)
311
-
311
+        let { rows } = response.data
312
+        this.members = [];
312
         let members = {}
313
         let members = {}
313
         // TODO refactor
314
         // TODO refactor
315
+        let recordMembers = _.groupBy(this.memberRecordTemp, record => {
316
+          return record.GambleMember.id
317
+        })
318
+        recordMembers = Object.values(recordMembers)
319
+        let roundMembers = []
320
+        recordMembers.map(member => {
321
+          let roundMember = {}
322
+          roundMember.chips = member[0].currentChips
323
+          roundMember.name = member[0].GambleMember.name
324
+          roundMember.id = member[0].GambleMember.id
325
+          roundMembers.push(roundMember)
326
+        })
327
+        rows = _.unionBy(roundMembers, rows, "id");
328
+        rows = _.sortBy(rows, 'chips').reverse()
314
         rows.map((person, index) => {
329
         rows.map((person, index) => {
315
           if (index % 4 === 0) {
330
           if (index % 4 === 0) {
316
             members.name_0 = person.name
331
             members.name_0 = person.name