Browse Source

sync agentManagment all

ethan 6 years ago
parent
commit
45dc2756a6
1 changed files with 13 additions and 7 deletions
  1. 13 7
      src/views/agnetManagement/index.vue

+ 13 - 7
src/views/agnetManagement/index.vue

@@ -136,6 +136,7 @@ export default {
136 136
                 totalPunishment: 0,
137 137
                 bookieEarned: 0,
138 138
                 memberEarned: 0,
139
+                bookieWagerFee: 0,
139 140
                 bookieServiceFees: 0,
140 141
                 memberServiceFees: 0,
141 142
                 totalServiceFees: 0,
@@ -144,15 +145,21 @@ export default {
144 145
             
145 146
               let bookie = _.groupBy(member['GambleGame-Bucket-MemberRecords'], 'isBookie')
146 147
               if (bookie.false) {
147
-                row.memberEarned = _.sumBy(bookie.false, 'earned');
148
+                row.memberEarned = _.sumBy(bookie.false, item => {
149
+                  return Math.abs(item.earned)
150
+                });
148 151
                 row.memberServiceFees = _.sumBy(bookie.false, 'serviceFees')*agent.feeRatio/100;
149 152
               }
150 153
               if (bookie.true) {
151
-                row.bookieEarned = _.sumBy(bookie.true, 'earned');
152
-                row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees-500; })*agent.feeRatio/100;
154
+                row.bookieWagerFee = _.sumBy(bookie.true, (item) => {
155
+                  return item.wagerServiceFees
156
+                }) * agent.feeRatio/100;
157
+                row.bookieEarned = _.sumBy(bookie.true, item => {
158
+                  return Math.abs(item.earned)
159
+                });
160
+                row.bookieServiceFees = _.sumBy(bookie.true, (item) => { return item.serviceFees })*agent.feeRatio/100;
153 161
               }
154
-              row.totalServiceFees = new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).valueOf()
155
-
162
+              row.totalServiceFees =  Number(new Decimal(row.bookieServiceFees).plus(row.memberServiceFees).plus(row.bookieWagerFee).valueOf())
156 163
               let chipsLog = _.groupBy(member.GambleMemberChipsLogs, 'type')
157 164
               if (chipsLog['0']) {
158 165
                 row.totalUp = _.sumBy(chipsLog['0'], (item) => { 
@@ -177,8 +184,7 @@ export default {
177 184
             let allDown = _.sumBy(combine, 'totalDown')
178 185
             let allChips = _.sumBy(combine, 'chips')
179 186
             let allEarned = _.sumBy(combine, (item) => {return item.bookieEarned + item.memberEarned})
180
-            let allServiceFees = _.sumBy(combine, (item) => {return item.bookieServiceFees + item.
181
-            memberServiceFees})
187
+            let allServiceFees = _.sumBy(combine, (item) => {return item.totalServiceFees})
182 188
             agent.all = (allUp+allDown-allChips-allServiceFees)*(-1)
183 189
             this.list.push(agent)
184 190