dever hace 4 años
padre
commit
fda13f5472
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      app/community/lib/Core.php

+ 8 - 1
app/community/lib/Core.php

@@ -48,11 +48,14 @@ class Core
             $where += $data;
         }
         if (!$info) {
+            $state = 1;
             Dever::db($this->table)->insert($where);
         } else {
             if ($info['state'] == 1) {
+                $state = 2;
                 Dever::db($this->table)->update(array('where_id' => $info['id'], 'state' => 2));
             } else {
+                $state = 1;
                 Dever::db($this->table)->update(array('where_id' => $info['id'], 'state' => 1));
             }
         }
@@ -66,7 +69,11 @@ class Core
         $table = Dever::config('base')->table_name[$type];
         $state = Dever::db($table)->update(array('where_id' => $id, 'num_' . $this->name => $total));
 
-        Dever::score($uid, 'submit_' . $this->name, $this->lang);
+        if ($state == 1) {
+            Dever::score($uid, 'submit_' . $this->name, $this->lang);
+        } else {
+            Dever::score($uid, 'submit_' . $this->name, '取消' . $this->lang);
+        }
 
         return true;
     }