sugangqiang 2 vuotta sitten
vanhempi
commit
ae60494ef8
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      app/common/api/IntegralRecordApi.php

+ 3 - 0
app/common/api/IntegralRecordApi.php

@@ -109,6 +109,8 @@ class IntegralRecordApi {
         $itemMax = 0; //标准总上限
         if ($item) {
             $project = getCacheById("IntegralProject", $item["projectId"]);
+            $projectMax = $project["max"];
+            $itemMax = $item["max"];
             if ($project["limit"] == 1) {
                 //项目下所有规则总上限
                 $where = [];
@@ -124,6 +126,7 @@ class IntegralRecordApi {
                     $where[] = ["r.createTime", "between", [$startTime, $endTime]];
                 }
                 $totalPoints = Db::table("new_integral_detail")->alias("d")->leftJoin("new_integral_record r", "r.id=d.record_id")->leftJoin("new_integral_item i", "i.id=d.item_id")->where($where)->sum("d.point");
+                $projectMax -= $totalPoints;
             }
             if ($item["limit"] == 1) {
                 //规则上限