瀏覽代碼

Fix $month undefined in newPayment

ferrari 4 月之前
父節點
當前提交
f4708202f8
共有 1 個文件被更改,包括 3 次插入6 次删除
  1. 3 6
      app/Http/Livewire/CourseList.php

+ 3 - 6
app/Http/Livewire/CourseList.php

@@ -679,14 +679,11 @@ class CourseList extends Component
         $records = \App\Models\Record::where('member_course_id', $m->id)->where('deleted', 0)->get();
         $records = \App\Models\Record::where('member_course_id', $m->id)->where('deleted', 0)->get();
         foreach ($records as $record)
         foreach ($records as $record)
         {
         {
-
-            if (in_array($month, json_decode($record->months)))
+            // if (in_array($month, json_decode($record->months)))
+            if (array_intersect($newMonths, json_decode($record->months)))
             {
             {
-
                 foreach ($record->rows as $row)
                 foreach ($record->rows as $row)
-                {
-
-                    
+                {                    
                     if ($row->causal_id == $c->causal_id && !str_contains(strtolower($row->note), 'iscrizione'))
                     if ($row->causal_id == $c->causal_id && !str_contains(strtolower($row->note), 'iscrizione'))
                     {
                     {
                         $tot = sizeof(json_decode($row->when));
                         $tot = sizeof(json_decode($row->when));