Pārlūkot izejas kodu

add effectiveTotal

ethan 6 gadi atpakaļ
vecāks
revīzija
247ab0fa09

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

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