Your Name 2 years ago
parent
commit
c31ba66bac
1 changed files with 8 additions and 1 deletions
  1. 8 1
      learn/active/lib/Manage.php

+ 8 - 1
learn/active/lib/Manage.php

@@ -525,7 +525,14 @@ Class Manage
         $ids = $this->common($data,3,false,false,$price,$desc);
         if ($ids) {
             $where['status'] = 2;
-            Dever::db('active/info_refund_log')->insert($where);
+            $log = Dever::db('active/info_refund_log')->find(array('order_id'=>$order_id,'code_id'=>$code_id));
+            if (!$log) {
+                Dever::db('active/info_refund_log')->insert($where);
+            } else {
+                $where['id'] = $log['id'];
+                Dever::db('active/info_refund_log')->update($where);
+            }
+            
             $admin = Dever::load('manage/auth.info');
             $w['where_id'] = $code_id;
             $w['status'] = 3;