EthnaYeh преди 7 години
родител
ревизия
8d455b0295
променени са 1 файла, в които са добавени 15 реда и са изтрити 6 реда
  1. 15 6
      src/views/gambleGameBucket/detail/index.vue

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

@@ -60,7 +60,7 @@
60 60
         </el-table-column>
61 61
         <el-table-column prop="MemberRecord.serviceFees" label="抽水">
62 62
         </el-table-column>
63
-        <el-table-column prop="Membehips" label="輸贏合計">
63
+        <el-table-column prop="totalChips" label="輸贏合計">
64 64
         </el-table-column>
65 65
         <!-- <el-table-column prop="ass" label="福利">
66 66
         </el-table-column> -->
@@ -219,12 +219,12 @@ export default {
219 219
 
220 220
         this.group = _.groupBy(detailTemp, record => {
221 221
           return record.MemberRecord.GambleMember.name
222
-        })      
222
+        })
223 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 229
         const sum = (i) => {
230 230
           let count = 0
@@ -233,6 +233,15 @@ export default {
233 233
           }
234 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 245
         for (let i = 0; i < this.group.length; i++) {
237 246
           if (i === 0) {
238 247
             this.statement =
@@ -257,7 +266,7 @@ export default {
257 266
             }`
258 267
           }
259 268
         }
260
-        
269
+
261 270
         this.func = eval(`(function() {${this.statement}})`)
262 271
       })
263 272