Browse Source

add effectiveTotal

ethan 6 years ago
parent
commit
247ab0fa09
1 changed files with 13 additions and 10 deletions
  1. 13 10
      src/views/agnetManagement/gambleMemberManagement/index.vue

+ 13 - 10
src/views/agnetManagement/gambleMemberManagement/index.vue

65
           <el-table-column label="總下分額" prop="totalDown" align="center"></el-table-column>
65
           <el-table-column label="總下分額" prop="totalDown" align="center"></el-table-column>
66
           <el-table-column label="總獎勵" prop="totalReward" align="center"></el-table-column>
66
           <el-table-column label="總獎勵" prop="totalReward" align="center"></el-table-column>
67
           <el-table-column label="總懲罰" prop="totalPunishment" align="center"></el-table-column>
67
           <el-table-column label="總懲罰" prop="totalPunishment" align="center"></el-table-column>
68
-          <el-table-column label="有效投注量" align="center">
69
-            <template slot-scope="scope">
70
-              <span>{{0}}</span>
71
-            </template>
72
-          </el-table-column>
68
+          <el-table-column label="有效投注量" prop="effectiveTotal" align="center"></el-table-column>
73
           <!-- <el-table-column label="莊家贏錢" align="center">
69
           <!-- <el-table-column label="莊家贏錢" align="center">
74
             <template slot-scope="scope">
70
             <template slot-scope="scope">
75
               <span :style="moneyColor(scope.row.bookieEarned)">{{scope.row.bookieEarned}}</span>
71
               <span :style="moneyColor(scope.row.bookieEarned)">{{scope.row.bookieEarned}}</span>
181
       this.allCombine = []
177
       this.allCombine = []
182
       this.combine = []
178
       this.combine = []
183
       await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
179
       await fetchMemberList(this.data.secondLayer, this.listQuery).then(response => {
180
+          console.log('response', response)        
184
         response.data.rows.map(member => {
181
         response.data.rows.map(member => {
185
           let row = {
182
           let row = {
186
             id: member.id,
183
             id: member.id,
190
             totalDown: 0,
187
             totalDown: 0,
191
             totalReward: 0,
188
             totalReward: 0,
192
             totalPunishment: 0,
189
             totalPunishment: 0,
190
+            effectiveTotal: 0,
193
             bookieEarned: 0,
191
             bookieEarned: 0,
194
             memberEarned: 0,
192
             memberEarned: 0,
195
             bookieWagerFee: 0,
193
             bookieWagerFee: 0,
202
             memberCheckOut: 0,
200
             memberCheckOut: 0,
203
             feeRatio: new Decimal(this.data.secondLayer.feeRatio/100),
201
             feeRatio: new Decimal(this.data.secondLayer.feeRatio/100),
204
           }
202
           }
205
-        
203
+          console.log('www', response)
206
           let bookie = _.groupBy(member['GambleGame-Bucket-MemberRecords'], 'isBookie')
204
           let bookie = _.groupBy(member['GambleGame-Bucket-MemberRecords'], 'isBookie')
207
           if (bookie.false) {
205
           if (bookie.false) {
208
             row.memberEarned = _.sumBy(bookie.false, item => {
206
             row.memberEarned = _.sumBy(bookie.false, item => {
209
               return Math.abs(item.earned)
207
               return Math.abs(item.earned)
210
             });
208
             });
211
-            console.log('membeEarned', row.memberEarned)
209
+            // console.log('membeEarned', row.memberEarned)
212
             row.memberServiceFees = _.sumBy(bookie.false, 'serviceFees');
210
             row.memberServiceFees = _.sumBy(bookie.false, 'serviceFees');
213
             row.memberServiceFeesRatio = row.feeRatio.times(row.memberServiceFees).valueOf()
211
             row.memberServiceFeesRatio = row.feeRatio.times(row.memberServiceFees).valueOf()
214
             
212
             
218
               return item.wagerServiceFees
216
               return item.wagerServiceFees
219
             });
217
             });
220
             row.bookieWagerFeeRatio = row.feeRatio.times(row.bookieWagerFee).valueOf()
218
             row.bookieWagerFeeRatio = row.feeRatio.times(row.bookieWagerFee).valueOf()
221
-            console.log('eeee', bookie.true)
219
+            // console.log('eeee', bookie.true)
222
             row.bookieEarned = _.sumBy(bookie.true, item => {
220
             row.bookieEarned = _.sumBy(bookie.true, item => {
223
               return Math.abs(item.earned)
221
               return Math.abs(item.earned)
224
             });
222
             });
225
-            console.log('bookieEarned' , row.bookieEarned)
223
+            // console.log('bookieEarned' , row.bookieEarned)
226
             row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees});
224
             row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees});
227
             row.bookieServiceFeesRatio = row.feeRatio.times(row.bookieServiceFees).valueOf()
225
             row.bookieServiceFeesRatio = row.feeRatio.times(row.bookieServiceFees).valueOf()
228
           }
226
           }
227
+
228
+          row.effectiveTotal = _.sumBy(member['GambleGame-Bucket-RoundRecords'], item => {
229
+              return item.used_quota
230
+            }) + row.memberEarned
231
+            
229
           row.totalServiceFees = Number(new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).plus(row.bookieWagerFee).times(row.feeRatio).valueOf())
232
           row.totalServiceFees = Number(new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).plus(row.bookieWagerFee).times(row.feeRatio).valueOf())
230
           let chipsLog = _.groupBy(member.GambleMemberChipsLogs, 'type')
233
           let chipsLog = _.groupBy(member.GambleMemberChipsLogs, 'type')
231
           // console.log('type', chipsLog)
234
           // console.log('type', chipsLog)
254
 
257
 
255
           this.combine.push(row)
258
           this.combine.push(row)
256
         })
259
         })
257
-        console.log('cimbine' , this.combine)
260
+        // console.log('cimbine' , this.combine)
258
         this.allCombine.push({
261
         this.allCombine.push({
259
           name: this.data.secondLayer.GambleMember.name,
262
           name: this.data.secondLayer.GambleMember.name,
260
           allUp: _.sumBy(this.combine, 'totalUp'),
263
           allUp: _.sumBy(this.combine, 'totalUp'),