Przeglądaj źródła

complete totalChips

EthnaYeh 7 lat temu
rodzic
commit
8d455b0295
1 zmienionych plików z 15 dodań i 6 usunięć
  1. 15 6
      src/views/gambleGameBucket/detail/index.vue

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

60
         </el-table-column>
60
         </el-table-column>
61
         <el-table-column prop="MemberRecord.serviceFees" label="抽水">
61
         <el-table-column prop="MemberRecord.serviceFees" label="抽水">
62
         </el-table-column>
62
         </el-table-column>
63
-        <el-table-column prop="Membehips" label="輸贏合計">
63
+        <el-table-column prop="totalChips" label="輸贏合計">
64
         </el-table-column>
64
         </el-table-column>
65
         <!-- <el-table-column prop="ass" label="福利">
65
         <!-- <el-table-column prop="ass" label="福利">
66
         </el-table-column> -->
66
         </el-table-column> -->
219
 
219
 
220
         this.group = _.groupBy(detailTemp, record => {
220
         this.group = _.groupBy(detailTemp, record => {
221
           return record.MemberRecord.GambleMember.name
221
           return record.MemberRecord.GambleMember.name
222
-        })      
222
+        })
223
         this.group = Object.values(this.group)
223
         this.group = Object.values(this.group)
224
 
224
 
225
-        this.detail = this.group.reduce(function(arr, element) {
226
-            return arr.concat(element);
227
-        }, []);
225
+        this.detail = this.group.reduce((arr, element) => {
226
+          return arr.concat(element)
227
+        }, [])
228
 
228
 
229
         const sum = (i) => {
229
         const sum = (i) => {
230
           let count = 0
230
           let count = 0
233
           }
233
           }
234
           return count
234
           return count
235
         }
235
         }
236
+
237
+        this.group.map((item, itemIndex) => {
238
+          let totalChips = 0
239
+          item.map((person, personIndex) => {
240
+            totalChips += person.MemberRecord.earned
241
+            item.length - 1 === personIndex ? this.detail[sum(itemIndex)].totalChips = totalChips : false
242
+          })
243
+        })
244
+
236
         for (let i = 0; i < this.group.length; i++) {
245
         for (let i = 0; i < this.group.length; i++) {
237
           if (i === 0) {
246
           if (i === 0) {
238
             this.statement =
247
             this.statement =
257
             }`
266
             }`
258
           }
267
           }
259
         }
268
         }
260
-        
269
+
261
         this.func = eval(`(function() {${this.statement}})`)
270
         this.func = eval(`(function() {${this.statement}})`)
262
       })
271
       })
263
 
272