瀏覽代碼

add feature

Unknown 6 年之前
父節點
當前提交
8e96efc2b6
共有 1 個文件被更改,包括 21 次插入6 次删除
  1. 21 6
      src/views/gambleGameBucket/detail/index.vue

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

@@ -181,6 +181,7 @@ export default {
181 181
       memberRecord: [],
182 182
       door: 0,
183 183
       // bidChips: 0,
184
+      memberRecordTemp: [],
184 185
       wagerRecord: [],
185 186
     }
186 187
   },
@@ -239,10 +240,11 @@ export default {
239 240
         })
240 241
       })
241 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 245
           return record.door
244 246
         })
245
-        this.memberRecord = Object.values(memberRecordTemp)
247
+        this.memberRecord = Object.values(memberRecordTemp )
246 248
       })
247 249
       fetchDetails(this.data.secondLayer, this.query.secondLayer).then(response => {
248 250
         detailTemp = response.data.rows.filter(record => {
@@ -270,7 +272,7 @@ export default {
270 272
           return Math.abs(item.MemberRecord.earned) ;
271 273
         })
272 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 276
         this.group.map((item, itemIndex) => {
275 277
           let totalChips = 0
276 278
           item.map((person, personIndex) => {
@@ -306,11 +308,24 @@ export default {
306 308
       })
307 309
 
308 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 313
         let members = {}
313 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 329
         rows.map((person, index) => {
315 330
           if (index % 4 === 0) {
316 331
             members.name_0 = person.name