dever 6 سال پیش
والد
کامیت
2f9bc3c188
1فایلهای تغییر یافته به همراه15 افزوده شده و 1 حذف شده
  1. 15 1
      component/src/Core.php

+ 15 - 1
component/src/Core.php

@@ -98,7 +98,7 @@ class Core
 			$update['result'] = json_encode($result);
 			$update['where_id'] = $info['id'];
 			Dever::db($table)->update($update);
-		} elseif ($table == 'component/publish') {
+		} elseif ($table == 'component/publish' || $table == 'component/revert' || $table == 'component/unaudit') {
 			if ($result['errcode'] == 0) {
 				$update['status'] = 2;
 			} else {
@@ -108,6 +108,20 @@ class Core
 			$update['result'] = json_encode($result);
 			$update['where_id'] = $info['id'];
 			Dever::db($table)->update($update);
+
+			if ($table == 'component/unaudit') {
+				$audit = array('option_user_id' => $info['user_id'], 'option_project_id' => $info['project_id'], 'option_version_id' => $info['version_id'], 'option_status' => 1);
+				$audit = Dever::db('component/auditing')->all($audit);
+				if ($audit) {
+					foreach ($audit as $k => $v) {
+						$update = array();
+						$update['set_status'] = 3;
+						$update['set_statusDesc'] = '撤回';
+						$update['where_id'] = $v['id'];
+						Dever::db('component/auditing')->update($update);
+					}
+				}
+			}
 		}
 		die;
 	}