Example #1
0
function add_favorites($id, $company_uid)
{
    global $db, $_CFG;
    $timestamp = time();
    $setmeal = get_user_setmeal($company_uid);
    $count = count_favorites($company_uid);
    if (strpos($id, "-")) {
        $id = explode("-", $id);
    }
    if (!is_array($id)) {
        $id = array($id);
    }
    $i = 0;
    foreach ($id as $v) {
        $v = intval($v);
        if ($_CFG['operation_mode'] == "2" || $_CFG['operation_mode'] == "3") {
            if ($count >= $setmeal['talent_pool']) {
                return "full";
            }
        }
        if (!check_favorites($v, $company_uid)) {
            $setarr['resume_id'] = $v;
            $setarr['company_uid'] = $company_uid;
            $setarr['favoritesa_ddtime'] = $timestamp;
            $db->inserttable(table("company_favorites"), $setarr);
            write_memberslog($_SESSION['uid'], 1, 5001, $_SESSION['username'], "将简历({$v})添加至人才库");
            $i++;
        }
    }
    write_memberslog($_SESSION['uid'], 1, 9002, $_SESSION['username'], "添加简历至人才库", 2, 1017, "添加人才库", $i, $count - $i);
    return $i;
}
Example #2
0
function add_favorites($id, $company_uid)
{
    global $db, $_CFG;
    $timestamp = time();
    $setmeal = get_user_setmeal($company_uid);
    $count = count_favorites($company_uid);
    if (strpos($id, "-")) {
        $id = explode("-", $id);
    }
    if (!is_array($id)) {
        $id = array($id);
    }
    $i = 0;
    foreach ($id as $v) {
        $v = intval($v);
        if ($_CFG['operation_mode'] == "2" || $_CFG['operation_mode'] == "3") {
            if ($count >= $setmeal['talent_pool']) {
                return "full";
            }
        }
        if (!check_favorites($v, $company_uid)) {
            $db->query("INSERT INTO " . table('company_favorites') . " (resume_id,company_uid,favoritesa_ddtime) VALUES ('{$v}','{$company_uid}','{$timestamp}')");
            write_memberslog($_SESSION['uid'], 1, 5001, $_SESSION['username'], "将简历({$v})添加至人才库");
            $i++;
        }
    }
    write_memberslog($_SESSION['uid'], 1, 9002, $_SESSION['username'], "添加简历至人才库", 2, 1017, "添加人才库", $i, $count - $i);
    return $i;
}