当前位置: 首页>>代码示例>>PHP>>正文


PHP BxDolDb::query方法代码示例

本文整理汇总了PHP中BxDolDb::query方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolDb::query方法的具体用法?PHP BxDolDb::query怎么用?PHP BxDolDb::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BxDolDb的用法示例。


在下文中一共展示了BxDolDb::query方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set

 function set($sKey, $mixedValue)
 {
     //--- Update Database ---//
     $this->_oDb->query("UPDATE `sys_options` SET `VALUE`= ? WHERE `Name`= ? LIMIT 1", [$mixedValue, $sKey]);
     //--- Update Cache ---//
     $this->cache();
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:7,代码来源:BxDolParams.php

示例2: actionPending

function actionPending()
{
    $oDb = new BxDolDb();
    $sFormName = 'categories_aprove_form';
    $aItems = array();
    if (is_array($_POST['pathes']) && !empty($_POST['pathes'])) {
        foreach ($_POST['pathes'] as $sValue) {
            list($sCategory, $sId, $sType) = split('%%', process_db_input($sValue, BX_TAGS_STRIP));
            $oDb->query("UPDATE `sys_categories` SET `Status` = 'active' WHERE\n                `Category` = '{$sCategory}' AND `ID` = {$sId} AND `Type` = '{$sType}'");
        }
    }
    $aCategories = $oDb->getAll("SELECT * FROM `sys_categories` WHERE `Status` = 'passive'");
    if (!empty($aCategories)) {
        foreach ($aCategories as $aCategory) {
            $aItems[] = array('name' => $aCategory['Category'], 'value' => $aCategory['Category'] . '%%' . $aCategory['ID'] . '%%' . $aCategory['Type'], 'title' => $aCategory['Category'] . '(' . $aCategory['Type'] . ')');
        }
        $aButtons = array('action_activate' => _t('_categ_btn_activate'));
        $sControls = BxTemplSearchResult::showAdminActionsPanel($sFormName, $aButtons, 'pathes');
        return $GLOBALS['oAdmTemplate']->parseHtmlByName('categories_list.html', array('form_name' => $sFormName, 'bx_repeat:items' => $aItems, 'controls' => $sControls));
    } else {
        return MsgBox(_t('_Empty'));
    }
}
开发者ID:Arvindvi,项目名称:dolphin,代码行数:23,代码来源:categories.php

示例3: BxDolDb

 function _profileChangeStatus()
 {
     $oDb = new BxDolDb();
     $oDb->query("DELETE FROM `sys_profiles_match`");
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:5,代码来源:BxDolAlertsResponceMatch.php

示例4: getMatchProfiles

function getMatchProfiles($iProfileId, $bForce = false, $sSort = 'none')
{
    $aResult = array();
    if (!getParam('enable_match')) {
        return $aResult;
    }
    $oDb = new BxDolDb();
    if (!(int) $iProfileId) {
        return $aResult;
    }
    if (!$bForce) {
        $aMatch = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match` WHERE `profile_id` = {$iProfileId} AND `sort` = '{$sSort}'");
        if (!empty($aMatch)) {
            return unserialize($aMatch['profiles_match']);
        }
    } else {
        $oDb->query("DELETE FROM `sys_profiles_match` WHERE `profile_id` = {$iProfileId}");
    }
    $aProf = getProfileInfo($iProfileId);
    if (empty($aProf)) {
        return $aResult;
    }
    $aMathFields = getMatchFields();
    $iAge = (int) $oDb->getOne("SELECT DATE_FORMAT(FROM_DAYS(DATEDIFF(NOW(), '{$aProf['DateOfBirth']}')), '%Y') + 0 AS age");
    foreach ($aMathFields as $sKey => $aFields) {
        $aMathFields[$sKey]['profiles'] = array();
        if ($aProf[$aFields['Name']]) {
            if ($aMathFields[$aFields['MatchField']]['Name'] == 'DateOfBirth') {
                if ($iAge) {
                    $sCond = "(DATE_FORMAT(FROM_DAYS(DATEDIFF(NOW(), `DateOfBirth`)), '%Y') + 0) = {$iAge}";
                }
            } else {
                if ($aMathFields[$aFields['MatchField']]['Name']) {
                    $sCond = "`{$aMathFields[$aFields['MatchField']]['Name']}` = '" . process_db_input($aProf[$aFields['Name']], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "'";
                    $aMathFields[$sKey]['profiles'] = $oDb->getAllWithKey("SELECT `ID` FROM `Profiles` WHERE `Status` = 'Active' AND `ID` != {$iProfileId} AND {$sCond}", 'ID');
                }
            }
        }
    }
    $sCondSort = '';
    if ($sSort == 'activity') {
        $sCondSort = 'ORDER BY `DateLastNav` DESC';
    } else {
        if ($sSort == 'date_reg') {
            $sCondSort = 'ORDER BY `DateReg` DESC';
        }
    }
    $iPercentThreshold = getParam('match_percent');
    $aProfiles = $oDb->getColumn("SELECT `ID` FROM `Profiles` WHERE `Status` = 'Active' AND `ID` != {$iProfileId} {$sCondSort}");
    foreach ($aProfiles as $iProfId) {
        $iPercent = 0;
        foreach ($aMathFields as $sKey => $aFields) {
            if (isset($aFields['profiles'][$iProfId])) {
                $iPercent += (int) $aFields['MatchPercent'];
            }
        }
        if ($iPercent >= $iPercentThreshold) {
            $aResult[] = $iProfId;
        }
    }
    $oDb->query("INSERT INTO `sys_profiles_match`(`profile_id`, `sort`, `profiles_match`) VALUES({$iProfileId}, '{$sSort}', '" . serialize($aResult) . "')");
    return $aResult;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:63,代码来源:match.inc.php


注:本文中的BxDolDb::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。