dever 6 năm trước cách đây
mục cha
commit
da75ee1369
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      code/lib/Manage.php

+ 7 - 2
code/lib/Manage.php

@@ -99,7 +99,10 @@ class Manage
 	public function drop_api($id)
 	{
 		$info = Dever::db('code/info')->one($id);
-		Dever::setInput('set_product_id', $info['product_id']);
+		if ($info['product_id'] > 0) {
+			Dever::setInput('set_product_id', $info['product_id']);
+		}
+		
 		$update['where_id'] = $id;
 		$update['type'] = 4;
 		Dever::db('code/info')->update($update);
@@ -109,7 +112,9 @@ class Manage
 	public function recovery_api($id)
 	{
 		$info = Dever::db('code/info')->one($id);
-		Dever::setInput('set_product_id', $info['product_id']);
+		if ($info['product_id'] > 0) {
+			Dever::setInput('set_product_id', $info['product_id']);
+		}
 		$update['where_id'] = $id;
 		$update['type'] = 1;
 		Dever::db('code/info')->update($update);