本文整理汇总了PHP中dbex类的典型用法代码示例。如果您正苦于以下问题:PHP dbex类的具体用法?PHP dbex怎么用?PHP dbex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dbex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: blog_read_base
function blog_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "log_id", $order = "desc", $cache = "", $cache_key = "")
{
global $tablePreStr;
global $page_num;
global $page_total;
global $is_self;
$is_pass = ' is_pass = 1 ';
$is_admin = get_sess_admin();
$t_blog = $tablePreStr . "blog";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$limit = $num ? " limit {$num} " : "";
$by_col = $by_col ? " {$by_col} " : " log_id ";
$order = $order ? $order : "desc";
$get_type = $get_type == 'getRow' ? "getRow" : "getRs";
$is_pass = $is_self == 'Y' || $is_admin ? '1' : $is_pass;
$sql = " select {$fields} from {$t_blog} where {$is_pass} {$condition} order by {$by_col} {$order} {$limit} ";
if (empty($result_rs)) {
if ($limit == '') {
$dbo->setPages(20, $page_num);
}
$result_rs = $dbo->{$get_type}($sql);
$page_total = $dbo->totalPage;
}
return $result_rs;
}
示例2: plugins_set_mine
function plugins_set_mine($id, $is_del = 0)
{
$id = intval($id);
$is_del = intval($is_del);
$val = '';
$uid = get_sess_userid();
global $tablePreStr;
$t_users = $tablePreStr . "users";
$t_plugins = $tablePreStr . "plugins";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$u_apps = get_sess_apps();
if ($is_del == 0) {
if ($u_apps == '') {
$val = $id;
} else {
$val = $u_apps . "," . $id;
}
} else {
$val = str_replace(",{$id},", "", ",{$u_apps},");
}
$sql = " update {$t_users} set use_apps = '{$val}' where user_id = {$uid} ";
if ($dbo->exeUpdate($sql)) {
set_sess_apps($val);
if ($is_del == 0) {
$sql = " update {$t_plugins} set use_num=use_num+1 where id={$id} ";
} else {
$sql = " update {$t_plugins} set use_num=use_num-1 where id={$id} ";
}
return $dbo->exeUpdate($sql);
} else {
return 0;
}
}
示例3: msgboard_read_base
function msgboard_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "mess_id", $order = "desc", $cache = "", $cache_key = "")
{
global $tablePreStr;
global $page_num;
global $page_total;
global $cachePages;
$t_msgboard = $tablePreStr . "msgboard";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$limit = $num ? " limit {$num} " : "";
$by_col = $by_col ? " {$by_col} " : " mess_id ";
$order = $order ? $order : "desc";
$get_type = $get_type == 'getRow' ? "getRow" : "getRs";
$sql = " select {$fields} from {$t_msgboard} where {$condition} order by {$by_col} {$order} {$limit} ";
/*
可以加入缓存机制
*/
if (empty($result_rs)) {
if ($limit == '') {
$dbo->setPages(20, $page_num);
}
$result_rs = $dbo->{$get_type}($sql);
$page_total = $dbo->totalPage;
}
return $result_rs;
}
示例4: msgboard_set
function msgboard_set($to_user_id)
{
global $tablePreStr;
$dbo = new dbex();
dbplugin('w');
$t_message = $tablePreStr . "msgboard";
$sql = "update {$t_message} set readed=1 where to_user_id='{$to_user_id}'";
$dbo->exeUpdate($sql);
}
示例5: scrip_send
function scrip_send($sender, $title, $content, $to_id, $scrip_id = '')
{
global $tablePreStr;
$uid = get_sess_userid();
$uico = get_sess_userico();
$t_scrip = $tablePreStr . "msg_inbox";
$dbo = new dbex();
dbplugin('w');
$sql = "insert into {$t_scrip} (mess_title,mess_content,from_user,from_user_ico,user_id,add_time,from_user_id,mesinit_id)" . "value('{$title}','{$content}','{$sender}','{$uico}',{$to_id},NOW(),{$uid},'{$scrip_id}')";
return $dbo->exeUpdate($sql);
}
示例6: user_get_user_point
function user_get_user_point($user_id)
{
global $tablePreStr;
$t_users = $tablePreStr . "users";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = "select user_point from {$t_users} where user_id={$user_id}";
$result_rs = $dbo->getRow($sql);
return $result_rs['user_point'];
}
示例7: user_self_by_total
function user_self_by_total()
{
global $tablePreStr;
$t_user = $tablePreStr . "users";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = "select count(*) as total from {$t_user}";
$result_rs = $dbo->getRow($sql);
return $result_rs['total'];
}
示例8: user_set_update_user_point
function user_set_update_user_point($user_id, $user_point)
{
global $tablePreStr;
$t_users = $tablePreStr . "users";
$result_rs = array();
$dbo = new dbex();
dbplugin('w');
//update isns_users set user_point=2000 where user_id=1;
$sql = "update {$t_users} set user_point={$user_point} where user_id={$user_id}";
$result_rs = $dbo->exeUpdate($sql);
return $result_rs;
}
示例9: money_set_add_user_money
function money_set_add_user_money($user_id, $consume_point, $exchange_datetime, $exchange_money)
{
global $tablePreStr;
$t_money = $tablePreStr . "money";
$result_rs = array();
$dbo = new dbex();
dbplugin('w');
//insert into isns_money (user_id, consume_point, exchange_datetime, exchange_money) value (1, 10, '2015-08-11 15:55:23', 33);
$sql = "insert into {$t_money} (user_id, consume_point, exchange_datetime, exchange_money) \n\t\t\tvalue ({$user_id}, {$consume_point}, '{$exchange_datetime}', {$exchange_money})";
$result_rs = $dbo->exeUpdate($sql);
return $result_rs;
}
示例10: code_exists
function code_exists()
{
$is_admin = '';
$sendor_id = '';
$admin_id = get_session('admin_id');
if ($admin_id) {
$is_admin = 1;
$sendor_id = $admin_id;
} else {
$user_id = get_sess_userid();
if (!$user_id) {
return false;
exit;
}
$is_admin = 0;
$sendor_id = $user_id;
}
if ($sendor_id != '' && $is_admin !== '') {
global $inviteCodeValue;
global $tablePreStr;
global $inviteCodeLength;
$t_invite_code = $tablePreStr . "invite_code";
$t_users = $tablePreStr . "users";
if ($is_admin == 0) {
$user_info = api_proxy('user_self_by_uid', 'integral', $sendor_id);
$intg = $user_info['integral'];
if ($inviteCodeValue > $intg) {
return false;
}
}
$dbo = new dbex();
dbplugin('r');
$invite_code = randkeys($inviteCodeLength);
$sql = "select id from {$t_invite_code} where code_txt='{$invite_code}'";
$is_exists = $dbo->getRow($sql);
if ($is_exists['id']) {
code_exists();
} else {
$time = time();
$sql = "insert into {$t_invite_code} (sendor_id,code_txt,is_admin,add_time) values({$sendor_id},'{$invite_code}',0,{$time})";
$success = $dbo->exeUpdate($sql);
if ($success) {
if ($is_admin == 0) {
$sql = "update {$t_users} set integral=integral-{$inviteCodeValue} where user_id={$sendor_id}";
$dbo->exeUpdate($sql);
}
return $invite_code;
} else {
return false;
}
}
}
}
示例11: blog_sort_by_uid
function blog_sort_by_uid($id)
{
global $tablePreStr;
$t_blog = $tablePreStr . "blog_sort";
$id = intval($id);
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = " select * from {$t_blog} where user_id = {$id} ";
$result_rs = $dbo->getRs($sql);
return $result_rs;
}
示例12: pals_sort
function pals_sort($uid = '')
{
$uid = intval($uid);
if ($uid == 0) {
$uid = get_sess_userid();
}
global $tablePreStr;
$t_pals_sort = $tablePreStr . "pals_sort";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = " select * from {$t_pals_sort} where user_id={$uid} ";
$result_rs = $dbo->getALL($sql);
return $result_rs;
}
示例13: scrip_notice_get
function scrip_notice_get($fields = "*", $num = "", $condition = "")
{
global $tablePreStr;
global $page_num;
global $page_total;
$fields = filt_fields($fields);
$uid = get_sess_userid();
$t_scrip = $tablePreStr . "msg_inbox";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = " select {$fields} from {$t_scrip} where user_id = {$uid} and mesinit_id='' {$condition} order by mess_id desc ";
$dbo->setPages(20, $page_num);
$result_rs = $dbo->getRs($sql);
$page_total = $dbo->totalPage;
return $result_rs;
}
示例14: check_pri
function check_pri($holder, $exp = '')
{
$sess_uid = get_sess_userid();
$is_admin = get_sess_admin();
if ($sess_uid != $holder && !$is_admin) {
if ($exp) {
if (!$sess_uid) {
return false;
}
if ($exp == '!all') {
//全否定
return false;
}
if (strpos(",{$exp}", "{")) {
//限定人
$per_str = preg_replace("/{([,\\d]+)}/", "\$1", $exp);
if (strpos(",{$per_str}", ",{$sess_uid},")) {
return true;
}
}
if (strpos(",{$exp}", "[")) {
//限定组
$sort_str = preg_replace("/\\[([,\\d]+)\\]/", "\$1", $exp);
global $dbo;
global $tablePreStr;
global $dbServs;
if (!$dbo) {
$dbo = new dbex();
dbplugin('r');
}
$table = $tablePreStr . "pals_mine";
$sql = "select pals_sort_id from {$table} where pals_id={$sess_uid} and user_id={$holder}";
$sort_id = $dbo->getRow($sql);
$sess_sort_id = $sort_id['pals_sort_id'];
if (strpos(",{$sort_str}", ",{$sess_sort_id},")) {
return true;
}
}
} else {
return true;
}
} else {
return true;
}
}
示例15: message_get_affair_uid
function message_get_affair_uid($id, $type = '', $num = 20)
{
$limit = intval($num) ? " limit {$num} " : "";
$type_str = filt_num_array($type);
$id_str = filt_num_array($id);
$sql_type = "";
if ($type_str != '') {
$sql_type = " and mod_type in ({$type_str}) ";
}
global $tablePreStr;
$t_recent_affair = $tablePreStr . "recent_affair";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = "select * from {$t_recent_affair} where user_id in ({$id_str}) {$sql_type} order by id desc {$limit} ";
$result_rs = $dbo->getALL($sql);
return $result_rs;
}