Просмотр исходного кода

依照老订单、新订单数据,补全缺失的贡献值和PV记录,以及更新用户表中的贡献值、直推贡献值、PV值

sunxiaobiao 1 год назад
Родитель
Сommit
f1527518da
1 измененных файлов с 428 добавлено и 3 удалено
  1. 428 3
      app/controller/api/store/merchant/Taskorderguquan.php

+ 428 - 3
app/controller/api/store/merchant/Taskorderguquan.php

@@ -7,6 +7,7 @@
7 7
 
8 8
 namespace app\controller\api\store\merchant;
9 9
 
10
+use app\common\model\user\User;
10 11
 use think\facade\Db;
11 12
 
12 13
 class Taskorderguquan
@@ -14,8 +15,432 @@ class Taskorderguquan
14 15
 
15 16
     public function assignment()
16 17
     {
17
-        $user_team_amount = Db::name("old_user_of_goods")
18
-            ->select();
18
+        $result = [
19
+            'oldOrderExistGongXian' => [],
20
+            'orderExistGongXian' => [],
21
+            'oldOrderExistPv' => [],
22
+            'orderExistPv' => [],
23
+            'gongXianDataOldList' => [],
24
+            'gongXianDataList' => [],
25
+            'pvDataOldList' => [],
26
+            'pvDataList' => [],
27
+            'contributeNot' => [],
28
+            'pvNot' => [],
29
+            'userUpdateSummary' => ['success' => 0, 'failed' => 0, 'skipped' => 0], // 优化: 汇总用户更新结果
30
+            'insertGongXianSummary' => ['success' => 0, 'failed' => 0], // 优化: 汇总贡献插入结果
31
+            'insertPvSummary' => ['success' => 0, 'failed' => 0],         // 优化: 汇总PV插入结果
32
+            'errors' => [],               // 优化: 统一记录错误信息
33
+        ];
34
+        $currentTime = time();
35
+        $currentDateTime = date('Y-m-d H:i:s', $currentTime);
36
+
37
+        // --- 数据库查询部分 (保持不变,已优化) ---
38
+        // 1. 查询用户
39
+        $userList = Db::name("user")
40
+            ->where('is_del', 0)
41
+            ->column('uid, spread_uid, contribute, per_contribute, pv', 'uid');
42
+        // $userIds = array_keys($userList);
43
+
44
+        // 2. 查询老订单
45
+        $userOfGoodsListRaw = Db::name("old_user_of_goods")
46
+            ->where('status', 1)
47
+            // 优化: 如果用户量大,可以考虑只查相关用户的订单
48
+            // ->whereIn('user_id', $userIds)
49
+            ->field('user_id, money, order_id, create_time')
50
+            ->select()
51
+            ->toArray();
52
+
53
+        // 3. 查询新订单
54
+        $storeOrderListRaw = Db::name("store_order")
55
+            ->whereIn('status', [0, 1, 2, 3])
56
+            // 优化: 如果用户量大,可以考虑只查相关用户的订单
57
+            // ->whereIn('uid', $userIds)
58
+            ->field('uid, pay_price, mer_id, status, order_id, create_time')
59
+            ->select()
60
+            ->toArray();
61
+
62
+        // 4. 查询已存在的贡献值记录
63
+        $gongXianListRaw = Db::name("user_sign_gongxian")
64
+            // 优化: 如果记录非常多,可以分批查询或只查相关用户的
65
+            // ->whereIn('uid', array_merge($userIds, array_column($userList, 'spread_uid'))) // 查询购买者和潜在推广者
66
+            ->field('uid, order_id, number')
67
+            ->select()
68
+            ->toArray();
69
+
70
+        // 5. 查询已存在的PV记录
71
+        $pvListRaw = Db::name("user_pv_log")
72
+            // 优化: 同上
73
+            // ->whereIn('uid', $userIds)
74
+            ->field('uid, order_id, pv')
75
+            ->select()
76
+            ->toArray();
77
+
78
+        // --- 数据预处理部分
79
+        $existingGongXian = [];
80
+        foreach ($gongXianListRaw as $gx) $existingGongXian[$gx['uid'] . '_' . $gx['order_id']] = $gx['number'];
81
+        unset($gongXianListRaw);
82
+
83
+        $existingPv = [];
84
+        foreach ($pvListRaw as $pv) $existingPv[$pv['uid'] . '_' . $pv['order_id']] = $pv['pv'];
85
+        unset($pvListRaw);
86
+
87
+        $userOfGoodsByUid = [];
88
+        foreach ($userOfGoodsListRaw as $oldOrder) $userOfGoodsByUid[$oldOrder['user_id']][] = $oldOrder;
89
+        unset($userOfGoodsListRaw);
90
+
91
+        $storeOrdersByUid = [];
92
+        foreach ($storeOrderListRaw as $order) $storeOrdersByUid[$order['uid']][] = $order;
93
+        unset($storeOrderListRaw);
94
+
95
+        // *** 主逻辑处理与数据收集 ***
96
+        $gongXianDataToInsert = []; // 优化: 合并新旧贡献插入列表
97
+        $pvDataToInsert = [];       // 优化: 合并新旧PV插入列表
98
+        $userUpdateData = [];       // 优化: 收集所有需要更新的用户数据 [uid => ['contribute'=>float, 'pv'=>float, 'per_contribute'=>float]]
99
+
100
+        // 初始化所有用户的待更新数据
101
+        foreach ($userList as $uid => $user) {
102
+            // 预先设置初始值,确保即使没有订单的用户也能被包含在后续可能的更新逻辑中(如果需要)
103
+            // 如果用户没有任何订单,他们的 contribute 和 pv 应该保持数据库原始值或根据业务逻辑设为0
104
+            // 这里我们先假设如果没有订单,他们的计算值就是0
105
+            $userUpdateData[$uid] = [
106
+                'uid' => $uid,
107
+                'contribute' => 0.0,
108
+                'pv' => 0.0,
109
+                'per_contribute' => 0.0,
110
+            ];
111
+            // 初始化推广者的 per_contribute 累加器
112
+            if (!empty($user['spread_uid'])) {
113
+                $spreadUid = $user['spread_uid'];
114
+                if (!isset($userUpdateData[$spreadUid])) {
115
+                    if (isset($userList[$spreadUid])) {
116
+                        if (!isset($userUpdateData[$spreadUid]['per_contribute'])) {
117
+                            $userUpdateData[$spreadUid]['per_contribute'] = 0.0; // 初始化推广者的累加
118
+                        }
119
+                    } else {
120
+                        // 记录或处理推广者不在当前用户列表的情况
121
+                        $result['errors'][] = "执行{$uid}时,没找到 推荐人 {$spreadUid}";
122
+                        // 可以选择跳过给这个推广者增加 per_contribute
123
+                    }
124
+
125
+                } else if (!isset($userUpdateData[$spreadUid]['per_contribute'])) {
126
+                    $userUpdateData[$spreadUid]['per_contribute'] = 0.0; // 初始化推广者的累加
127
+                }
128
+            }
129
+        }
130
+
131
+        // 遍历用户列表进行计算和数据收集
132
+        foreach ($userList as $uid => $user) {
133
+            $spreadUid = $user['spread_uid'];
134
+
135
+            if (isset($userOfGoodsByUid[$uid])) {
136
+                foreach ($userOfGoodsByUid[$uid] as $oldOrder) {
137
+                    switch ($oldOrder['money']) {
138
+                        case 1180:
139
+                            $totalPv = 700.0;
140
+                            break;
141
+                        case 11800:
142
+                            $totalPv = 7000.0;
143
+                            break;
144
+                        case 10620:
145
+                            $totalPv = 6300.0;
146
+                            break;
147
+                        case 2360:
148
+                            $totalPv = 1400.0;
149
+                            break;
150
+                        case 9440:
151
+                            $totalPv = 5600.0;
152
+                            break;
153
+                        default:
154
+                            $totalPv = round($oldOrder['money'] * 0.7, 2);
155
+                            break;
156
+                    }
157
+
158
+                    // --- 收集贡献值插入数据 ---
159
+                    $orderKey = $uid . '_' . $oldOrder['order_id'];
160
+                    if (isset($existingGongXian[$orderKey])) {
161
+                        $result['oldOrderExistGongXian'][] = ['uid' => $uid, 'order_id' => $oldOrder['order_id']];
162
+                        $userUpdateData[$uid]['contribute'] += $existingGongXian[$orderKey];
163
+                        if (!empty($spreadUid) && isset($userUpdateData[$spreadUid])) {
164
+                            if (isset($existingGongXian[$spreadUid . '_' . $oldOrder['order_id']])) {
165
+                                $userUpdateData[$spreadUid]['per_contribute'] += $existingGongXian[$spreadUid . '_' . $oldOrder['order_id']];
166
+                            }
167
+                        }
168
+                    } else {
169
+                        if ($totalPv > 0) {
170
+                            $userUpdateData[$uid]['contribute'] += $totalPv;
171
+
172
+                            $settlementTimeOld = $oldOrder['create_time'] ? date('Y-m-d H:i:s', $oldOrder['create_time']) : $currentDateTime;
173
+                            // --- 收集贡献值插入数据 ---
174
+                            $gongXianBase = [
175
+                                "number" => $totalPv, "addtime" => $currentTime, "status" => 1,
176
+                                "order_type" => 1, "order_id" => $oldOrder['order_id'],
177
+                                "desc" => '', "surplus" => 0, "type" => 1, 'settlement_time' => $settlementTimeOld
178
+                            ];
179
+                            // 本人
180
+                            $gongXianDataToInsert[] = array_merge(["uid" => $uid, "mark" => "1.0系统购买会员专区商品赠送贡献值"], $gongXianBase);
181
+                            // 推广人
182
+                            if (!empty($user['spread_uid'])) {
183
+                                if (isset($userUpdateData[$spreadUid])) {
184
+                                    $userUpdateData[$spreadUid]['per_contribute'] += $totalPv;
185
+                                    $gongXianDataToInsert[] = array_merge(["uid" => $spreadUid, "mark" => "1.0系统推广会员专区商品赠送贡献值"], $gongXianBase);
186
+                                }
187
+                            }
188
+                        }
189
+                    }
190
+                    // --- 收集 PV 插入数据 ---
191
+                    if (isset($existingPv[$orderKey])) {
192
+                        $result['oldOrderExistPv'][] = ['uid' => $uid, 'order_id' => $oldOrder['order_id']];
193
+                        $userUpdateData[$uid]['pv'] += $existingGongXian[$orderKey];
194
+
195
+                    } else {
196
+                        $userUpdateData[$uid]['pv'] += $totalPv;
197
+                        $pvDataToInsert[] = [
198
+                            "uid" => $uid, "pv" => $totalPv, "addtime" => $currentTime, "status" => 1,
199
+                            "order_type" => 0, "order_id" => $oldOrder['order_id'],
200
+                            "mark" => "1.0系统购买会员专区商品赠送PV", 'settlement_time' => $settlementTimeOld
201
+                        ];
202
+                    }
203
+
204
+                }
205
+            } // end if isset($userOfGoodsByUid[$uid])
206
+
207
+            // --- 处理新订单 ---
208
+            if (isset($storeOrdersByUid[$uid])) {
209
+                foreach ($storeOrdersByUid[$uid] as $order) {
210
+                    $totalPv = 0.0;
211
+                    // ... (if/else logic and switch case for $totalPv calculation - same as before)
212
+                    if ($order['mer_id'] == 496) {
213
+                        switch ($order['pay_price']) {
214
+                            case 1180:
215
+                                $totalPv = 700.0;
216
+                                break;
217
+                            case 11800:
218
+                                $totalPv = 7000.0;
219
+                                break;
220
+                            case 10620:
221
+                                $totalPv = 6300.0;
222
+                                break;
223
+                            case 2360:
224
+                                $totalPv = 1400.0;
225
+                                break;
226
+                            case 9440:
227
+                                $totalPv = 5600.0;
228
+                                break;
229
+                            default:
230
+                                $totalPv = round($order['pay_price'] * 0.7, 2);
231
+                                break;
232
+                        }
233
+                    } else if ($order['status'] == 3) {
234
+                        $totalPv = round($order['pay_price'] * 0.7, 2);
235
+                    }
236
+                    // --- 收集贡献值插入数据 ---
237
+                    $orderKey = $uid . '_' . $order['order_id'];
238
+                    $settlementTimeNew = $order['create_time'] ?: $currentDateTime;
239
+                    // --- 收集贡献值插入数据 ---
240
+                    if (isset($existingGongXian[$orderKey])) {
241
+                        $result['orderExistGongXian'][] = ['uid' => $uid, 'order_id' => $order['order_id']];
242
+                        // 累加计算值
243
+                        $userUpdateData[$uid]['contribute'] += $existingGongXian[$orderKey];
244
+                        if (!empty($spreadUid) && isset($userUpdateData[$spreadUid])) {
245
+                            if (isset($existingGongXian[$spreadUid . '_' . $order['order_id']])) {
246
+                                $userUpdateData[$spreadUid]['per_contribute'] += $existingGongXian[$spreadUid . '_' . $order['order_id']];
247
+                            }
248
+                        }
249
+
250
+                    } else {
251
+                        if ($totalPv > 0) {
252
+                            // 累加计算值
253
+                            $userUpdateData[$uid]['contribute'] += $totalPv;
254
+                            $gongXianBase = [ // 优化: 提取公共字段
255
+                                "number" => $totalPv, "addtime" => $currentTime, "status" => 1,
256
+                                "order_type" => 1, "order_id" => $order['order_id'],
257
+                                "desc" => '', "surplus" => 0, "type" => 1, 'settlement_time' => $settlementTimeNew
258
+                            ];
259
+                            // 本人
260
+                            $gongXianDataToInsert[] = array_merge(["uid" => $uid, "mark" => "2.0系统购买商品赠送贡献值"], $gongXianBase);
261
+                            // 推广人
262
+                            if (!empty($user['spread_uid'])) {
263
+                                $spreadUid = $user['spread_uid'];
264
+                                if (isset($userUpdateData[$spreadUid])) { // 确保推广者存在
265
+                                    $gongXianDataToInsert[] = array_merge(["uid" => $spreadUid, "mark" => "2.0系统推广商品赠送贡献值"], $gongXianBase);
266
+                                    $userUpdateData[$spreadUid]['per_contribute'] += $totalPv; // 累加推广者业绩
267
+                                }
268
+                            }
269
+                        }
270
+                    }
271
+
272
+                    // --- 收集 PV 插入数据 ---
273
+                    if (isset($existingPv[$orderKey])) {
274
+                        $result['orderExistPv'][] = ['uid' => $uid, 'order_id' => $order['order_id']];
275
+                        $userUpdateData[$uid]['pv'] += $existingPv[$orderKey];
276
+                    } else {
277
+                        $userUpdateData[$uid]['pv'] += $totalPv;
278
+                        $pvDataToInsert[] = [
279
+                            "uid" => $uid, "pv" => $totalPv, "addtime" => $currentTime, "status" => 1,
280
+                            "order_type" => 0, // 确认 PV log 的 order_type 是否与贡献一致或有区分
281
+                            "order_id" => $order['order_id'],
282
+                            "mark" => "2.0系统购买商品赠送PV", // 标记调整为更通用
283
+                            'settlement_time' => $settlementTimeNew
284
+                        ];
285
+                    }
286
+                }
287
+            }
288
+            // end if isset($storeOrdersByUid[$uid])
289
+
290
+            // --- 比较计算值与原值 (移到循环外处理) ---
291
+            // (在此处比较并记录到 $result['contributeNot'] / $result['pvNot'])
292
+            // 注意:浮点数比较可能需要容差
293
+            $tolerance = 0.001; // 定义一个小的容差值
294
+            if (abs($userUpdateData[$uid]['contribute'] - (float)$user['contribute']) > $tolerance) {
295
+                $result['contributeNot'][] = [
296
+                    'uid' => $uid,
297
+                    'contribute_old' => (float)$user['contribute'], // 显式转换
298
+                    'contribute_new' => $userUpdateData[$uid]['contribute']
299
+                ];
300
+            }
301
+            if (abs($userUpdateData[$uid]['pv'] - (float)$user['pv']) > $tolerance) {
302
+                $result['pvNot'][] = [
303
+                    'uid' => $uid,
304
+                    'pv_old' => (float)$user['pv'], // 显式转换
305
+                    'pv_new' => $userUpdateData[$uid]['pv']
306
+                ];
307
+            }
308
+            // per_contribute 是累加的,不需要与旧值比较,直接更新
309
+
310
+        } // end foreach ($userList as $uid => $user)
311
+
312
+        // *** 数据库批量操作 ***
313
+        // 使用事务确保数据一致性
314
+        Db::startTrans();
315
+        try {
316
+            // --- 批量插入贡献值 ---
317
+            if (!empty($gongXianDataToInsert)) {
318
+                // 分块插入,避免单次插入过多数据 (例如一次500条)
319
+                $chunkedGongXian = array_chunk($gongXianDataToInsert, 500);
320
+                foreach ($chunkedGongXian as $chunk) {
321
+                    $insertedGongXianCount = Db::name('user_sign_gongxian')->insertAll($chunk);
322
+                    $result['insertGongXianSummary']['success'] += $insertedGongXianCount;
323
+                }
324
+
325
+                if ($result['insertGongXianSummary']['success'] < count($gongXianDataToInsert)) {
326
+                    $result['insertGongXianSummary']['failed'] = count($gongXianDataToInsert) - $result['insertGongXianSummary']['success'];
327
+                    // 可以考虑记录更详细的失败信息,但这比较复杂,需要知道哪些失败了
328
+                    $result['errors'][] = "GongXian insertion partially failed or failed completely.";
329
+                    // 根据业务决定是否回滚
330
+                    // throw new Exception("GongXian insertion failed");
331
+                }
332
+            } else {
333
+                $result['insertGongXianSummary']['skipped'] = true; // 标记为跳过(无数据)
334
+            }
335
+
336
+            // --- 批量插入PV ---
337
+            if (!empty($pvDataToInsert)) {
338
+                $chunkedPv = array_chunk($pvDataToInsert, 500);
339
+                foreach ($chunkedPv as $chunk) {
340
+                    $insertedPvCount = Db::name('user_pv_log')->insertAll($chunk);
341
+                    $result['insertPvSummary']['success'] += $insertedPvCount;
342
+                }
343
+                if ($result['insertPvSummary']['success'] < count($pvDataToInsert)) {
344
+                    $result['insertPvSummary']['failed'] = count($pvDataToInsert) - $result['insertPvSummary']['success'];
345
+                    $result['errors'][] = "PV Log insertion partially failed or failed completely.";
346
+                    // throw new Exception("PV Log insertion failed");
347
+                }
348
+            } else {
349
+                $result['insertPvSummary']['skipped'] = true; // 标记为跳过(无数据)
350
+            }
351
+
352
+            // --- 批量更新用户信息 ---
353
+            $usersToUpdate = [];
354
+            // 筛选出实际需要更新的用户数据 (值有变化或 per_contribute > 0)
355
+            foreach ($userUpdateData as $uid => $updateInfo) {
356
+                $originalUser = $userList[$uid]; // 获取原始用户信息
357
+                // 检查 contribute 或 pv 是否变化(使用容差),或者 per_contribute 是否需要更新
358
+                $needsUpdate = false;
359
+                if (abs($updateInfo['contribute'] - (float)$originalUser['contribute']) > $tolerance) $needsUpdate = true;
360
+                if (abs($updateInfo['pv'] - (float)$originalUser['pv']) > $tolerance) $needsUpdate = true;
361
+                // per_contribute 始终更新,因为它是在现有基础上累加的(除非业务定义不同)
362
+                // 如果 per_contribute 数据库设计是直接覆盖,那只有 > 0 时才需要更新
363
+                // 假设是覆盖更新,且只有大于0时才需要更新变动(如果一直是0则不用更新)
364
+                if ($updateInfo['per_contribute'] > 0.0) { // 只有当推广业绩>0时才触发更新
365
+                    // 这里需要确认 per_contribute 是覆盖还是累加?
366
+                    // 如果是数据库累加: Db::name("user")->where('uid', $uid)->inc('per_contribute', $amount)->update(); 需要单独处理
367
+                    // 如果是覆盖: 直接放入 saveAll
368
+                    // 假设是覆盖,我们只更新有变化的或per_contribute > 0 的
369
+                    $needsUpdate = true;
370
+                } else {
371
+                    // 如果 per_contribute 计算结果为0,且 contribute 和 pv 也未变,则不需要更新 per_contribute 字段
372
+                    unset($updateInfo['per_contribute']); // 移除无需更新的 per_contribute
373
+                    if (empty($updateInfo)) $needsUpdate = false; // 如果移除后为空,则不更新
374
+                }
375
+
376
+                if ($needsUpdate) {
377
+                    // 确保只包含需要更新的字段,并且包含主键 'uid'
378
+                    $finalUpdateData = ['uid' => $uid];
379
+                    if (isset($updateInfo['contribute'])) $finalUpdateData['contribute'] = $updateInfo['contribute'];
380
+                    if (isset($updateInfo['pv'])) $finalUpdateData['pv'] = $updateInfo['pv'];
381
+                    if (isset($updateInfo['per_contribute']) && $updateInfo['per_contribute'] > 0.0) { // 再次确认只更新大于0的推广业绩
382
+                        $finalUpdateData['per_contribute'] = $updateInfo['per_contribute'];
383
+                    }
384
+
385
+                    if (count($finalUpdateData) > 1) { // 确保除了uid还有其他字段要更新
386
+                        $usersToUpdate[] = $finalUpdateData;
387
+                    } else {
388
+                        $result['userUpdateSummary']['skipped']++; // 记录跳过的更新(无变化)
389
+                    }
390
+
391
+                } else {
392
+                    $result['userUpdateSummary']['skipped']++; // 记录跳过的更新(无变化)
393
+                }
394
+            }
395
+
396
+            if (!empty($usersToUpdate)) {
397
+                // 使用 saveAll 进行批量更新 (要求 PHP >= 7.1.8 for MySQL)
398
+                // saveAll 会根据主键 'uid' 更新对应记录
399
+                $userModel = new User();
400
+                $updatedCount = $userModel->saveAll($usersToUpdate); // TP6 支持 saveAll
401
+
402
+                // 注意: saveAll 返回的是成功保存或更新的 *对象集合* 或 *布尔值*,不是影响的行数。
403
+                // 需要检查返回类型并判断成功数量。通常返回集合时 count(集合) 是成功数。
404
+                // 如果是 TP5,可能需要循环 update 或构造复杂 SQL。
405
+                // 假设 TP6 saveAll 成功会返回包含更新后数据的集合或true,失败是false
406
+                if ($updatedCount !== false) {
407
+                    // 这里需要一种方法来确定实际更新了多少条记录。
408
+                    // saveAll 的返回值可能需要进一步处理。
409
+                    // 简单假设:如果返回不是 false,就认为请求中的都成功了(可能不准确)
410
+                    // 更精确的方法是 saveAll 后再查询一次确认。
411
+                    // 这里我们暂时认为 saveAll 返回非 false 即为大部分成功
412
+                    $result['userUpdateSummary']['success'] = count($usersToUpdate); // 乐观估计
413
+                } else {
414
+                    $result['userUpdateSummary']['failed'] = count($usersToUpdate); // 全部失败
415
+                    $result['errors'][] = "User batch update failed using saveAll.";
416
+                    // throw new Exception("User batch update failed");
417
+                }
418
+            }
419
+            // 更新统计:失败数等于总数减去成功和跳过的
420
+            //$result['userUpdateSummary']['failed'] = count($userList) - $result['userUpdateSummary']['success'] - $result['userUpdateSummary']['skipped'];
421
+
422
+            // 如果所有操作都成功,提交事务
423
+            Db::commit();
424
+
425
+        } catch
426
+        (\Exception $e) {
427
+            // 如果任何数据库操作失败,回滚事务
428
+            Db::rollback();
429
+            // 记录错误信息
430
+            $result['errors'][] = "Transaction failed: " . $e->getMessage();
431
+            // 可以根据需要将 insert/update 摘要设置为失败
432
+            $result['userUpdateSummary']['failed'] = count($usersToUpdate); // 假设更新失败
433
+            $result['insertGongXianSummary']['failed'] = count($gongXianDataToInsert); // 假设插入失败
434
+            $result['insertPvSummary']['failed'] = count($pvDataToInsert);      // 假设插入失败
435
+        }
436
+
437
+        // --- 清理/最终结果赋值 (可选) ---
438
+        // $result['gongXianDataOldList'] = $gongXianDataOldList; // 这些已合并到 ToInsert
439
+        // $result['gongXianDataList'] = $gongXianDataList;
440
+        // $result['pvDataOldList'] = $pvDataOldList;
441
+        // $result['pvDataList'] = $pvDataList;
442
+
443
+        return json($result);
19 444
 
20 445
         // 计算总业绩
21 446
         $totalPv = [];
@@ -43,7 +468,7 @@ class Taskorderguquan
43 468
                     if ($order['money'] == 2344.99) {
44 469
                         break;
45 470
                     }
46
-                    $totalPv[$order['user_id']] += round($order['money'] * 0.7,2);
471
+                    $totalPv[$order['user_id']] += round($order['money'] * 0.7, 2);
47 472
                     break;
48 473
             }
49 474
         }