chuweiqiang 1 year ago
parent
commit
eb2658e5af
2 changed files with 7 additions and 3 deletions
  1. 1 1
      .idea/workspace.xml
  2. 6 2
      application/common/service/OrderCallback.php

+ 1 - 1
.idea/workspace.xml

@@ -577,7 +577,7 @@
       <workItem from="1711499544175" duration="25349000" />
       <workItem from="1711585940957" duration="2980000" />
       <workItem from="1711588946025" duration="20811000" />
-      <workItem from="1711672177712" duration="8036000" />
+      <workItem from="1711672177712" duration="8144000" />
     </task>
     <servers />
   </component>

+ 6 - 2
application/common/service/OrderCallback.php

@@ -183,7 +183,9 @@ class OrderCallback
                             'end_time' => $nextYear,
                             'end_int' => strtotime($nextYear)
                         ];
-                        UserLearn::create($arr);
+                        if(!UserLearn::where('type',1)->where('first_id',$act['datum_id'])->where('user_id',$iv['user_id'])->find()) {
+                            UserLearn::create($arr);
+                        }
                     }
                     //资料
                     if($act['datum_id'] && $act['datum_id'] != 0){
@@ -209,7 +211,9 @@ class OrderCallback
                             'end_time' => $nextYear,
                             'end_int' => strtotime($nextYear)
                         ];
-                        UserLearn::create($arr);
+                        if(!UserLearn::where('type',3)->where('first_id',$act['datum_id'])->where('user_id',$iv['user_id'])->find()) {
+                            UserLearn::create($arr);
+                        }
                     }
                     //新增内容end
                 }else{