Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

批量合并分类和标签的小问题 #1444

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion admin/manage-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class="i-caret-down"></i></button>
<li class="multiline">
<button type="button" class="btn btn-s merge"
rel="<?php $security->index('/action/metas-tag-edit?do=merge'); ?>"><?php _e('合并到'); ?></button>
<input type="text" name="merge" class="text-s"/>
<select name="merge">
<?php $tags->parse('<option value="{name}">{name}</option>'); ?>
</select>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions var/Widget/Base/Metas.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function merge(int $mid, string $type, array $metas)
->where('mid = ?', $meta)), 'cid');

$where = $this->db->sql()->where('mid = ? AND type = ?', $meta, $type);
$this->delete($where);
// $this->delete($where);
$diffContents = array_diff($existsContents, $contents);
$this->db->query($this->db->delete('table.relationships')->where('mid = ?', $meta));

Expand All @@ -163,7 +163,7 @@ public function merge(int $mid, string $type, array $metas)
$contents[] = $content;
}

$this->update(['parent' => $mid], $this->db->sql()->where('parent = ?', $meta));
$this->update(['parent' => $mid], $this->db->sql()->where('mid = ?', $meta));
unset($existsContents);
}
}
Expand Down