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


PHP FDB::delete方法代码示例

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


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

示例1: unBind

 public function unBind()
 {
     global $_FANWE;
     if ($_FANWE['uid'] > 0) {
         FDB::delete('user_bind', "uid = " . $_FANWE['uid'] . " AND type = 'sina'");
     }
     fHeader("location: " . FU('settings/bind'));
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:8,代码来源:sina.php

示例2: delete

 function delete()
 {
     $online_hold = 60;
     $guest_span = 60;
     $online_hold = TIME_UTC - $online_hold;
     $guest_span = TIME_UTC - $guest_span;
     $condition = " sid='{$this->sid}' ";
     $condition .= " OR last_activity < {$online_hold} ";
     $condition .= " OR (uid='0' AND ip1='{$this->var['ip1']}' AND ip2='{$this->var['ip2']}' AND ip3='{$this->var['ip3']}' AND ip4='{$this->var['ip4']}' AND last_activity > {$guest_span}) ";
     $condition .= $this->var['uid'] ? " OR (uid='{$this->var['uid']}') " : '';
     FDB::delete('sessions', $condition);
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:12,代码来源:session.class.php

示例3: removeEvent

 function removeEvent($id)
 {
     $id = (int) $id;
     $event = FDB::fetchFirst("select id from " . FDB::table("event") . " where id = {$id}");
     if ($event) {
         $res = FDB::query("select share_id from " . FDB::table("event_share") . " where event_id = {$id}");
         while ($data = FDB::fetch($res)) {
             FS('Share')->deleteShare($data['share_id']);
         }
         FDB::delete("event_share", "event_id = {$id}");
         FS('Share')->deleteShare($event['share_id']);
         FDB::delete("event", "id = {$id}");
     }
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:14,代码来源:event.service.php

示例4: unBind

 public function unBind()
 {
     global $_FANWE;
     if ($_FANWE['uid'] > 0) {
         FDB::delete('user_bind', "uid = " . $_FANWE['uid'] . " AND type = 'taobao'");
         $update = array();
         $update['buyer_level'] = 0;
         $update['seller_level'] = 0;
         $update['is_buyer'] = 0;
         FDB::update('user', $update, 'uid = ' . $_FANWE['uid']);
     }
     $redirect_uri = urlencode($_FANWE['site_url'] . substr(FU('settings/bind'), 1));
     $url = "https://oauth.taobao.com/logoff?client_id=" . $this->config['app_key'] . "&redirect_uri=" . $redirect_uri;
     fHeader("location: " . $url);
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:15,代码来源:taobao.php

示例5: deleteGoods

    public function deleteGoods($gid)
    {
        global $_FANWE;
        $gid = (int) $gid;
        $goods = FDB::fetchFirst('SELECT *
			FROM ' . FDB::table('second_goods') . ' WHERE gid = ' . $gid);
        if (empty($goods)) {
            return;
        }
        $share_id = $goods['share_id'];
        $share = FS('Share')->getShareById($share_id);
        FS('Share')->deleteShare($share_id);
        $uid = (int) $share['uid'];
        FDB::query('UPDATE ' . FDB::table('user_count') . ' SET seconds = seconds - 1 WHERE uid = ' . $uid);
        FDB::delete('second_goods', 'gid = ' . $gid);
        FS('Medal')->runAuto($uid, 'seconds');
    }
开发者ID:dalinhuang,项目名称:concourse,代码行数:17,代码来源:second.service.php

示例6: deleteEvent

 function deleteEvent($share_id)
 {
     $share_id = (int) $share_id;
     $event_id = (int) FDB::resultFirst("select id from " . FDB::table("event") . " \r\n\t\t\twhere share_id = {$share_id}");
     if ($event_id > 0) {
         $share = FDB::fetchFirst("select share_id,uid from " . FDB::table("event_share") . " \r\n\t\t\t\twhere event_id = {$event_id} order by share_id asc limit 0,1");
         if ($share) {
             $share_id = (int) $share['share_id'];
             $uid = (int) $share['uid'];
             FDB::query("update " . FDB::table("event") . " set thread_count = thread_count - 1,share_id = {$share_id},uid = {$uid} where id = {$event_id}");
             FDB::delete('event_share', 'share_id = ' . $share_id);
         } else {
             FDB::delete('event', 'id = ' . $event_id);
         }
     } else {
         FDB::delete('event_share', 'share_id = ' . $share_id);
         FDB::query("update " . FDB::table("event") . " set thread_count = thread_count - 1 where id = {$event_id}");
     }
 }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:19,代码来源:event.service.php

示例7: deletePost

    public function deletePost($share_id, $is_score = true)
    {
        if (intval($share_id) == 0) {
            return false;
        }
        $post = FDB::fetchFirst('SELECT * FROM ' . FDB::table('ask_post') . ' WHERE share_id = ' . $share_id);
        if (empty($post)) {
            return true;
        }
        FDB::delete('ask_post', 'share_id = ' . $share_id);
        FDB::query('UPDATE ' . FDB::table('ask_thread') . ' SET
				post_count = post_count - 1
				WHERE tid = ' . $post['tid']);
        FDB::query('UPDATE ' . FDB::table('user_count') . ' SET
				ask_posts = ask_posts - 1,
				ask_best_posts = ask_best_posts - ' . $post['is_best'] . '
				WHERE uid = ' . $post['uid']);
        FS("Share")->deleteShare($share_id, $is_score);
        FS('Medal')->runAuto($post['uid'], 'ask_posts');
    }
开发者ID:dalinhuang,项目名称:concourse,代码行数:20,代码来源:ask.service.php

示例8: array

<?php

$sync_bind_exists = $_FANWE['cookie']['sync_bind_exists'];
$result = array();
if (empty($sync_bind_exists)) {
    $result['status'] = 0;
    outputJson($result);
}
$sync_bind_exists = unserialize(authcode($sync_bind_exists, 'DECODE'));
$is_bind = $_FANWE['request']['is_bind'];
if ($is_bind) {
    $avatar = '';
    $type = $sync_bind_exists['type'];
    $keyid = $sync_bind_exists['keyid'];
    FDB::delete('user_bind', "type = '" . $type . "' AND keyid = '" . $keyid . "'");
    require_once FANWE_ROOT . "core/class/user/" . $type . ".class.php";
    $class = ucfirst($type) . 'User';
    $class = new $class();
    $class->bindByData($sync_bind_exists);
    $result['status'] = 1;
} else {
    $result['status'] = 0;
}
fSetCookie('sync_bind_exists', '');
outputJson($result);
开发者ID:dalinhuang,项目名称:concourse,代码行数:25,代码来源:bind.php

示例9: saveTags

    /**  
     * 保存专辑标签
     * @param int $aid 专辑编号
     * @param array $tags 标签数组
     * @return void
     */
    public function saveTags($aid, $tags)
    {
        $aid = (int) $aid;
        if (!$aid) {
            return;
        }
        FDB::query('UPDATE ' . FDB::table('album_tags') . ' SET album_count = album_count - 1 
			WHERE tag_name IN (SELECT tag_name FROM ' . FDB::table('album_tags_related') . ' WHERE album_id = ' . $aid . ')');
        FDB::delete('album_tags_related', 'album_id = ' . $aid);
        foreach ($tags as $tag) {
            if (empty($tag)) {
                continue;
            }
            $related = array();
            $related['tag_name'] = $tag;
            $related['album_id'] = $aid;
            if (FDB::insert('album_tags_related', $related, false, false, true)) {
                $album_tag = FDB::fetchFirst('SELECT * FROM ' . FDB::table('album_tags') . " WHERE tag_name = '{$tag}'");
                if ($album_tag) {
                    FDB::query('UPDATE ' . FDB::table('album_tags') . " SET album_count = album_count + 1 WHERE tag_name = '{$tag}'");
                } else {
                    $album_tag = array();
                    $album_tag['tag_name'] = $tag;
                    $album_tag['album_count'] = 1;
                    $album_tag['is_new'] = 1;
                    FDB::insert('album_tags', $album_tag);
                }
            }
        }
        FDB::fetchFirst('UPDATE ' . FDB::table('album') . " SET tags = '" . implode(' ', $tags) . "' WHERE id = {$aid}");
    }
开发者ID:BGCX261,项目名称:zhubao-tupu-svn-to-git,代码行数:37,代码来源:album.service.php

示例10: deleteShareComment

    /**
     * 删除分享评论
     * @param int $comment_id 评论编号
     * @return void
     */
    public function deleteShareComment($comment_id)
    {
        $comment = ShareService::getShareComment($comment_id);
        if (empty($comment)) {
            return;
        }
        FDB::delete('share_comment', 'comment_id = ' . $comment_id);
        $share_id = $comment['share_id'];
        //分享评论数量减1
        FDB::query('UPDATE ' . FDB::table('share') . '
			SET comment_count = comment_count - 1
			WHERE share_id = ' . $share_id . ' and comment_count >=1 ');
        //清除分享评论列表缓存
        ShareService::updateShareCache($share_id, 'comments');
    }
开发者ID:dalinhuang,项目名称:concourse,代码行数:20,代码来源:share.service.php

示例11: refuseApplyMedal

 /**
  * 拒绝一个勋章申请
  * @param int $id
  * @return
  */
 public function refuseApplyMedal($id)
 {
     $apply = MedalService::getApply($id);
     if (!$apply) {
         return false;
     }
     MedalService::sendRefuseNotice($apply['uid'], $apply['mid']);
     return FDB::delete('medal_apply', 'id = ' . $id);
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:14,代码来源:medal.service.php


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