Explorar o código

修改分红金额生效顺序

sunxbiao hai 1 ano
pai
achega
69697e5604

+ 5 - 5
app/controller/api/store/merchant/TaskPartnerProfits.php

@@ -140,14 +140,14 @@ class TaskPartnerProfits
140
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
140
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
141
 
141
 
142
         $weekRecord = bcsub($performance, $redEnvelope, 2);
142
         $weekRecord = bcsub($performance, $redEnvelope, 2);
143
+
144
+        if (!is_null($maxAllocationAmount)) {
145
+            $weekRecord = $maxAllocationAmount;
146
+        }
147
+
143
         if ($weekRecord <= 0) {
148
         if ($weekRecord <= 0) {
144
             return json('无效分红金额');
149
             return json('无效分红金额');
145
         }
150
         }
146
-        if (!is_null($maxAllocationAmount)) {
147
-            if ($weekRecord > $maxAllocationAmount) {
148
-                $weekRecord = $maxAllocationAmount;
149
-            }
150
-        }
151
 
151
 
152
 
152
 
153
         // 1、获取用户星级信息
153
         // 1、获取用户星级信息

+ 5 - 5
app/controller/api/store/merchant/Taskorderguquan.php

@@ -783,14 +783,14 @@ class Taskorderguquan
783
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
783
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
784
 
784
 
785
         $weekRecord -= $redEnvelope;
785
         $weekRecord -= $redEnvelope;
786
+
787
+        if (!is_null($maxAllocationAmount)) {
788
+            $weekRecord = $maxAllocationAmount;
789
+        }
790
+
786
         if ($weekRecord <= 0) {
791
         if ($weekRecord <= 0) {
787
             return json('无效分红金额');
792
             return json('无效分红金额');
788
         }
793
         }
789
-        if (!is_null($maxAllocationAmount)) {
790
-            if ($weekRecord > $maxAllocationAmount) {
791
-                $weekRecord = $maxAllocationAmount;
792
-            }
793
-        }
794
 
794
 
795
         // $stock_comm = round($weekRecord * 0.05 ,2);
795
         // $stock_comm = round($weekRecord * 0.05 ,2);
796
         $stock_comm = floor(($weekRecord * 0.05) * 100) / 100;
796
         $stock_comm = floor(($weekRecord * 0.05) * 100) / 100;

+ 5 - 5
app/controller/api/store/merchant/Taskorderlianc.php

@@ -306,14 +306,14 @@ class Taskorderlianc
306
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
306
         $redEnvelope = $this->getRedEnvelopeByTime($startTime, $endTime, $removeUserIdList);
307
 
307
 
308
         $weekRecord -= $redEnvelope;
308
         $weekRecord -= $redEnvelope;
309
+
310
+        if (!is_null($maxAllocationAmount)) {
311
+            $weekRecord = $maxAllocationAmount;
312
+        }
313
+
309
         if ($weekRecord <= 0) {
314
         if ($weekRecord <= 0) {
310
             return json('无效分红金额');
315
             return json('无效分红金额');
311
         }
316
         }
312
-        if (!is_null($maxAllocationAmount)) {
313
-            if ($weekRecord > $maxAllocationAmount) {
314
-                $weekRecord = $maxAllocationAmount;
315
-            }
316
-        }
317
 
317
 
318
         $originator_award = round(($weekRecord * 0.05), 2);
318
         $originator_award = round(($weekRecord * 0.05), 2);
319
 
319