本文整理匯總了PHP中iPHP::get_ids方法的典型用法代碼示例。如果您正苦於以下問題:PHP iPHP::get_ids方法的具體用法?PHP iPHP::get_ids怎麽用?PHP iPHP::get_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類iPHP
的用法示例。
在下文中一共展示了iPHP::get_ids方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: del
public static function del($tags, $field = 'name', $iid = 0)
{
$tagArray = explode(",", $tags);
$iid && ($sql = "AND `iid`='{$iid}'");
foreach ($tagArray as $k => $v) {
$tag = iDB::row("SELECT * FROM `#iCMS@__tags` WHERE `{$field}`='{$v}' LIMIT 1;");
$tRS = iDB::all("SELECT `iid` FROM `#iCMS@__tags_map` WHERE `node`='{$tag->id}' AND `appid`='" . TAG_APPID . "' {$sql}");
foreach ((array) $tRS as $TL) {
$idA[] = $TL['iid'];
}
if ($idA) {
$ids = iPHP::get_ids($idA, null);
if ($ids) {
iPHP::app('apps.class', 'static');
$table = APPS::table(TAG_APPID);
iDB::query("\n UPDATE `#iCMS@__{$table}`\n SET `tags`= REPLACE(tags, '{$tag->name},',''),\n `tags`= REPLACE(tags, ',{$tag->name}','')\n WHERE id IN({$ids})\n ");
}
}
self::$remove && iDB::query("DELETE FROM `#iCMS@__tags` WHERE `{$field}`='{$v}'");
iDB::query("\n DELETE FROM\n `#iCMS@__tags_map`\n WHERE `node`='{$tag->id}'\n AND `appid`='" . TAG_APPID . "' {$sql}");
$ckey = self::tkey($tag->cid);
iCache::delete($ckey);
}
}