drupal7: node作者被删后,对node重设uid

2019PHP高薪工程师学习路线图....>>>

$nids = db_query('SELECT nid FROM node WHERE NOT EXISTS(SELECT NULL FROM users WHERE users.uid = node.uid)')->fetchCol();
foreach($nids as $nid) {
	$node = node_load($nid);
	$node->uid = 0;
	node_save($node);
}