彭俊 6 жил өмнө
parent
commit
6d3e29af8e

+ 9 - 1
app/Lib/Settlement/Adapter/RulePlus.php

@@ -1,5 +1,4 @@
 <?php
-
 namespace App\Lib\Settlement\Adapter;
 
 
@@ -21,9 +20,15 @@ trait RulePlus
         $hasFH = in_array(substr($condition, 0, 1), ['+', '-']);
         if ($hasFH) {
             $condArr = explode("/", substr($condition, 1));
+            $condArr = array_map(function($i){
+                return  (strpos($i,'.')===false) ?  intval($i) : floatval($i);
+            },$condArr);
             $FH = substr($condition, 0, 1);
         } else {
             $condArr = explode("/", $condition);
+            $condArr = array_map(function($i){
+                return  (strpos($i,'.')===false) ?  intval($i) : floatval($i);
+            },$condArr);
             $FH = '+';
         }
 
@@ -95,6 +100,9 @@ trait RulePlus
         $score = intval($score);
         $returnDatas['matchResult'] = $matchResultWord;
         $condArr = explode("/", $condition);
+        $condArr = array_map(function($i){
+            return  (strpos($i,'.')===false) ?  intval($i) : floatval($i);
+        },$condArr);
 
         if (count($condArr) == 1) {
             if ($score == $condArr['0']) {