Example #1
0
        Config::transferConfig('pay', $configMap);
        refreshTo('hkconfig', 'init');
    } elseif ('hkconfig' == $action) {
        //[打卡设置]
        $fieldMap = array('o_punchopen' => 'punch.open', 'o_punch_reward' => 'punch.reward');
        $hkconfig = $GLOBALS['srcDb']->get_all(sprintf("SELECT * FROM pw_hack WHERE hk_name IN ('%s')", implode("','", array_keys($fieldMap))), MYSQL_ASSOC, 'hk_name');
        $_newconfig = array();
        foreach ($fieldMap as $key => $value) {
            $_newconfig[$value] = $hkconfig[$key]['hk_value'];
        }
        $reward = unserialize($_newconfig['punch.reward']);
        if ($reward) {
            $_newconfig['punch.reward'] = array('type' => getCreditMap($reward['type']), 'min' => $reward['min'], 'max' => $reward['max'], 'step' => $reward['step']);
            $_newconfig['punch.reward'] = $_newconfig['punch.reward'];
        }
        Config::storeConfig('site', $_newconfig);
        refreshTo('end', 'init');
    } elseif ('end' == $action) {
        gotoUrl('user', 'convert', true);
    }
} elseif ($step == 'convert') {
    empty($lastId) && ($lastId = 0);
    $transfers = 0;
    $TOTAL = 0;
    $PERCENT = '100%';
    $_subTMessage = "";
    //用来记录分表信息
    if ('user' == $action) {
        //[convert-user]
        //原pw_members表数据
        $associateFields = array('pw_user' => array('uid' => 'uid', 'username' => 'username', 'email' => 'email', 'password' => 'password', 'groupid' => 'groupid', 'memberid' => 'memberid', 'realname' => 'realname', 'regdate' => 'regdate', 'userstatus' => 'status', 'groups' => 'groups'), 'pw_windid_user' => array('uid' => 'uid', 'username' => 'username', 'email' => 'email', 'password' => 'password', 1 => 'salt', 'regdate' => 'regdate'), 'pw_windid_user_info' => array('uid' => 'uid', 'gender' => 'gender', 'bday' => 'byear', 1 => 'bmonth', 2 => 'bday', 'home' => 'hometown', 'apartment' => 'location', 'site' => 'homepage', 'oicq' => 'qq', 'aliww' => 'aliww', 'authmobile' => 'mobile', 'msn' => 'msn', 'introduce' => 'profile'), 'pw_user_info' => array('uid' => 'uid', 'gender' => 'gender', 'bday' => 'byear', 1 => 'bmonth', 2 => 'bday', 'home' => 'hometown', 'apartment' => 'location', 'site' => 'homepage', 'oicq' => 'qq', 'aliww' => 'aliww', 'authmobile' => 'mobile', 'msn' => 'msn', 'signature' => 'bbs_sign', 'introduce' => 'profile', 5 => 'secret'));