dever 6 年之前
父節點
當前提交
da75ee1369
共有 1 個文件被更改,包括 7 次插入2 次删除
  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);