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

+ 2 - 2
code/database/info.php

@@ -286,9 +286,9 @@ return array
 
         'list_button' => array
 		(
-			'oper' => array('作废', 'code/lib/manage.drop?id={id}', '{type} == 1'),
+			'oper' => array('作废', 'code/lib/manage.drop?id={id}&journal_id={product_id}', '{type} == 1'),
 
-			'oper2' => array('恢复使用', 'code/lib/manage.recovery?id={id}', '{type} == 4'),
+			'oper2' => array('恢复使用', 'code/lib/manage.recovery?id={id}&journal_id={product_id}', '{type} == 4'),
 		),
 	),
 

+ 7 - 8
code/lib/Manage.php

@@ -96,11 +96,10 @@ class Manage
 	 *
 	 * @return mixed
 	 */
-	public function drop_api($id)
+	public function drop_api($id, $journal_id)
 	{
-		$info = Dever::db('code/info')->one($id);
-		if ($info['product_id'] > 0) {
-			Dever::setInput('set_product_id', $info['product_id']);
+		if ($journal_id > 0) {
+			Dever::setInput('set_product_id', $journal_id);
 		}
 		
 		$update['where_id'] = $id;
@@ -109,12 +108,12 @@ class Manage
 		return 'ok';
 	}
 
-	public function recovery_api($id)
+	public function recovery_api($id, $journal_id)
 	{
-		$info = Dever::db('code/info')->one($id);
-		if ($info['product_id'] > 0) {
-			Dever::setInput('set_product_id', $info['product_id']);
+		if ($journal_id > 0) {
+			Dever::setInput('set_product_id', $journal_id);
 		}
+		
 		$update['where_id'] = $id;
 		$update['type'] = 1;
 		Dever::db('code/info')->update($update);