static function querySelect($table_name, $field, $tablefields) { $db_factory = new db_factory(); $fori = 0; $forlimit = 500; $sqlCount = $db_factory->get_count("select count(*) from " . $table_name); if (!$sqlCount) { return false; } $tabledump = ''; $numfields = count($tablefields); while ($fori <= $sqlCount) { $sql = $db_factory->query("select * from " . $table_name . " limit " . $fori . "," . $forlimit); foreach ($sql as $r) { $row = array_values($r); $sqlmsg = $comma = ''; for ($i = 0; $i < $numfields; $i++) { $sqlmsg .= $comma . (!empty($row[$i]) && (self::strexists($tablefields[$i]['Type'], 'char') || self::strexists($tablefields[$i]['Type'], 'text')) ? '0x' . bin2hex($row[$i]) : '\'' . mysql_escape_string($row[$i]) . '\''); $comma = ','; } $tabledump .= " INSERT INTO " . $table_name . " VALUES(" . $sqlmsg . ") ;\n"; } $fori += $forlimit; } return $tabledump; }
function case_obj_exists($id, $obj = 'task') { if ($obj == 'task') { $search_obj = db_factory::get_count(sprintf("select count(task_id) from %switkey_task where task_id='%d' ", TABLEPRE, $id)); } elseif ($obj == 'service') { $search_obj = db_factory::get_count(sprintf("select count(service_id) from %switkey_service where service_id='%d' ", TABLEPRE, $id)); } if ($search_obj) { return true; } else { return false; } }
function order_charge() { global $_K; $order_id = $this->_order_id; $sid = $this->_obj_id; $uid = $this->_uid; $user_info = $this->_userinfo; $order_info = db_factory::get_one(sprintf(" select order_status,order_uid,order_username,seller_uid,seller_username from %switkey_order where order_id='%d'", TABLEPRE, $order_id)); $url = $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=2&order_id=" . $order_id; $s_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=1&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>"; $b_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=finance&op=order&obj_type=service&role=2&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>"; if ($order_info['order_status'] == 'wait') { $service_info = keke_shop_class::get_service_info($sid); $service_status = db_factory::get_count(sprintf(" select service_status from %switkey_service where service_id='%d'", TABLEPRE, $sid)); if ($service_status == '2') { $data = array(':service_id' => $service_info['service_id'], ':title' => $service_info['title']); keke_finance_class::init_mem('buy_service', $data); $this->_total_fee > 0 and $res = keke_finance_class::cash_out($uid, $this->_total_fee, 'buy_service', '0', 'service', $order_id); if ($res) { db_factory::execute(sprintf(" update %switkey_order set order_status='ok' where order_id='%d'", TABLEPRE, $order_id)); $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], '用户' => $_lang['you'], '动作' => $_lang['haved_confirm_pay'], '订单编号' => $order_id, '订单链接' => $b_order_link); keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr); $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], '用户' => $order_info['order_username'], '动作' => $_lang['haved_confirm_pay'], '订单编号' => $order_id, '订单链接' => $s_order_link); keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_confirm_pay'], $v_arr); $notice = $_lang['goods_pay_success']; $type = 'success'; } else { $notice = $_lang['goods_pay_fail']; $type = 'warning'; } } else { db_factory::execute(sprintf(" update %switkey_order set order_status='close' where order_id='%d'", TABLEPRE, $order_id)); $v_arr = array('用户名' => $order_info['seller_username'], '网站名称' => $kekezu->_sys_config['website_name'], "用户" => $_lang['system'], '动作' => $_lang['stop_your_order_and_your_cash_return'], '订单编号' => $order_id, '订单链接' => $s_order_link); keke_shop_class::notify_user($order_info['seller_uid'], $order_info['seller_username'], "order_change", $_lang['goods_order_close'], $v_arr); $v_arr = array('用户名' => $order_info['order_username'], '网站名称' => $kekezu->_sys_config['website_name'], "用户" => $_lang['system'], '动作' => $_lang['stop_your_order_and_your_cash_return'], '订单编号' => $order_id, '订单链接' => $b_order_link); keke_shop_class::notify_user($order_info['order_uid'], $order_info['order_username'], "order_change", $_lang['goods_order_close'], $v_arr); $notice = $_lang['goods_pay_fail']; $type = 'warning'; } } else { $notice = $_lang['goods_pay_success']; $type = 'success'; } return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, $type); }
public static function bindingAccount($uid, $username, $arrSaveinfo) { $returnValue = FALSE; $strSql = "select count(id) from " . TABLEPRE . "witkey_member_oauth\n\t\t\t\twhere source ='" . $arrSaveinfo['type'] . "' and oauth_id='{$arrSaveinfo['account']}' and uid=" . $uid; $isBind = db_factory::get_count($strSql); if (!$isBind) { $objMemberOauth = new Keke_witkey_member_oauth_class(); $objMemberOauth->setAccount($arrSaveinfo['nickname']); $objMemberOauth->setOauth_id($arrSaveinfo['account']); $objMemberOauth->setSource($arrSaveinfo['type']); $objMemberOauth->setUid($uid); $objMemberOauth->setUsername($username); $objMemberOauth->setOn_time(time()); $intRes = $objMemberOauth->create_keke_witkey_member_oauth(); unset($objMemberOauth); $intRes and $returnValue = TRUE or $returnValue = FALSE; } return $returnValue; }
public function alipay_trust_response($url) { global $_lang; switch ($this->_action) { case "sns_bind": switch ($this->_data['is_success']) { case "T": $uid = $this->_data['sns_user_id']; $username = db_factory::get_count(sprintf("select username from %switkey_member where uid='%d'", TABLEPRE, $uid)); $key = $this->_data['key']; $account = $this->_data['alipay_login_id']; $oauth_id = $this->_data['alipay_card_no']; $id = db_factory::get_count(sprintf(" select id from %switkey_member_oauth where uid='%d' and username='******' and source='alipay_trust'", TABLEPRE, $uid, $username)); if ($id) { $sql = " update %switkey_member_oauth set account='%s',oauth_id='%s',bind_key='%s' where id='%d'"; $res = db_factory::execute(sprintf($sql, TABLEPRE, $account, $oauth_id, $key, $id)); } else { $sql = " insert into %switkey_member_oauth values('','alipay_trust','%s','%d','%s','%d','%s','%s')"; $res = db_factory::execute(sprintf($sql, TABLEPRE, $account, $uid, $username, time(), $oauth_id, $key)); } break; case "F": $res = false; break; } $res and $this->notify($url, $_lang['alipay_db_bind_success']) or $this->notify($url, $_lang['alipay_db_bind_fail'], "fail"); break; case "cancel_bind": switch ($this->_data['is_success']) { case "T": $uid = $this->_data['sns_user_id']; $sql = " delete from %switkey_member_oauth where uid='%d' and source='alipay_trust'"; $res = db_factory::execute(sprintf($sql, TABLEPRE, $uid)); break; case "F": $res = false; break; } $res and $this->notify($url, $_lang['alipay_db_unbind_success']) or $this->notify($url, $_lang['alipay_db_unbind_fail'], "fail"); break; } }
public function dispose_task() { global $kekezu, $_lang; $prom_obj = $objProm = keke_prom_class::get_instance(); $model_code = $this->_model_code; $agree_info = $this->_agree_info; $cash_info = db_factory::get_one(sprintf(" select task_cash,task_union,real_cash from %switkey_task where task_id = '%d'", TABLEPRE, $this->_task_id)); $this->plus_mark_num(); keke_user_mark_class::create_mark_log($model_code, '1', $agree_info['seller_uid'], $agree_info['buyer_uid'], $agree_info['work_id'], $cash_info['task_cash'], $this->_task_id, $this->_seller_username, $this->_buyer_username); keke_user_mark_class::create_mark_log($model_code, '2', $agree_info['buyer_uid'], $agree_info['seller_uid'], $agree_info['work_id'], $cash_info['real_cash'], $this->_task_id, $this->_buyer_username, $this->_seller_username); $site_profit = $cash_info['task_cash'] - $cash_info['real_cash']; $task_title = db_factory::get_count(sprintf(" select task_title from %switkey_task where task_id='%d'", TABLEPRE, $this->_task_id)); $data = array(':task_id' => $this->_task_id, ':task_title' => $task_title); keke_finance_class::init_mem('task_bid', $data); keke_finance_class::cash_in($agree_info['seller_uid'], $cash_info['real_cash'], 'task_bid', '', 'task', $this->_task_id, $site_profit); $feed_arr = array("feed_username" => array("content" => $this->_seller_uid, "url" => "index.php?do=seller&id={$this->_seller_uid}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => $task_title, "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => $cash_info['real_cash'])); kekezu::save_feed($feed_arr, $this->_seller_uid, $this->_seller_username, 'work_accept', $this->_task_id); $prom_obj->dispose_prom_event("bid_task", $agree_info['seller_uid'], $this->_task_id); $prom_obj->dispose_prom_event("pub_task", $agree_info['buyer_uid'], $this->_task_id); }
public static function install_auth($auth_dir) { global $_lang; $tab_obj = keke_table_class::get_instance("witkey_auth_item"); if ($auth_dir) { $file_path = S_ROOT . "./auth/" . $auth_dir . "/admin/auth_config_inc.php"; if (file_exists($file_path)) { require $file_path; $exists = db_factory::get_count(" select auth_code from " . TABLEPRE . "witkey_auth_item where auth_dir = '{$auth_dir}'"); $exists and kekezu::admin_show_msg($_lang['auth_item_exist_add_fail'], $_SERVER['HTTP_REFERER'], '3', '', 'error'); $res = $tab_obj->save($auth_config); if (file_exists(S_ROOT . "./auth/" . $auth_dir . "/admin/install_sql.php")) { require S_ROOT . "./auth/" . $auth_dir . "/admin/install_sql.php"; } $res and kekezu::admin_system_log($_lang['add_auth_item'] . "{$res}"); $res and kekezu::admin_show_msg($_lang['auth_item_add_success'], $_SERVER['HTTP_REFERER'], '3', '', 'success'); } else { kekezu::admin_show_msg($_lang['unknow_error_add_fail'], $_SERVER['HTTP_REFERER'], '3', '', 'error'); } } else { kekezu::admin_show_msg($_lang['unknow_error_add_fail'], $_SERVER['HTTP_REFERER'], '3', '', 'error'); } }
function analysis_data($path, $every_year = false) { global $year_arr, $_lang; $detail_arr = array($_lang['total'], $_lang['witkey_task'], $_lang['witkey_shop'], $_lang['payitem_service'], $_lang['user_auth']); if (strtolower(CHARSET) == 'gbk') { $detail_arr = kekezu::gbktoutf($detail_arr); } $series = ''; $total = $bid_ins = $service_ins = $item_ins = $auth_ins = 0; foreach ($year_arr as $key => $value) { $bid_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where (fina_action='task_bid' or fina_action='pub_task') and site_profit>0 and (fina_type='in' or fina_type='out') and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year'])); $bid_ins += $bid_in; $service_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where fina_action='sale_service' and fina_type='in' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year'])); $service_ins += $service_in; $item_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where fina_action='payitem' and fina_type='out' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year'])); $item_ins += $item_in; $auth_in = db_factory::get_count(sprintf(" select sum(site_profit) as cash from %switkey_finance where INSTR(fina_action,'_auth') and fina_type='out' and YEAR(FROM_UNIXTIME(fina_time))=%d", TABLEPRE, $value['year'])); $auth_ins += $auth_in; $point = ''; $point .= '<point name="' . $detail_arr['1'] . '" y="' . $bid_in . '"/>'; $point .= '<point name="' . $detail_arr['2'] . '" y="' . $service_in . '"/>'; $point .= '<point name="' . $detail_arr['3'] . '" y="' . $item_in . '"/>'; $point .= '<point name="' . $detail_arr['4'] . '" y="' . $auth_in . '"/>'; if ($every_year == true) { $year_path = sprintf($path, $value['year']); update_xml($year_path, '<data><series name="Series 1">' . $point . '</series></data>', 'analysis'); } } $str = ''; $str .= '<series name="Series 1">'; $str .= '<point name="' . $detail_arr['1'] . '" y="' . $bid_ins . '"/>'; $str .= '<point name="' . $detail_arr['2'] . '" y="' . $service_ins . '"/>'; $str .= '<point name="' . $detail_arr['3'] . '" y="' . $item_ins . '"/>'; $str .= '<point name="' . $detail_arr['4'] . '" y="' . $auth_ins . '"/>'; $str .= '</series>'; return update_xml(sprintf($path, 'total'), '<data>' . $str . '</data>', 'analysis'); }
<?php defined('IN_KEKE') or exit('Access Denied'); $strNavActive = 'articlelist'; $strUrl = $_K['siteurl'] . "/index.php?do=articlelist"; $catid and $strUrl .= "&catid=" . intval($catid); $intPage and $strUrl .= "&intPage=" . $intPage; $arrArtCats = kekezu::get_table_data("*", "witkey_article_category", "cat_type='article' and art_cat_pid=1", "listorder asc", "", "", "", null); $page and $intPage = intval($page); $intPage = intval($intPage) ? $intPage : 1; $intPagesize = intval($intPagesize) ? $intPagesize : 20; intval($catid) and $intCatid = intval($catid) or $intCatid = intval($arrArtCats['0']['art_cat_id']); $intCatid and $strWhere .= " and a.art_cat_id = " . intval($intCatid); $strWhere .= " and a.is_show!=2"; $strWhere .= " order by is_recommend desc,a.listorder asc,pub_time desc"; $strSql = "select a.* ,b.cat_name from " . TABLEPRE . "witkey_article a left join " . TABLEPRE . "witkey_article_category b on a.art_cat_id=b.art_cat_id where b.cat_type='article' {$strWhere}"; $strCsql = "select count(a.art_id) as c from " . TABLEPRE . "witkey_article a left join " . TABLEPRE . "witkey_article_category b on a.art_cat_id=b.art_cat_id where b.cat_type='article' {$strWhere}"; $intCount = intval(db_factory::get_count($strCsql, 0, NULL, 10 * 60)); $kekezu->_page_obj->setStatic($static); $strPages = $kekezu->_page_obj->getPages($intCount, $intPagesize, $intPage, $strUrl); $arrArticleLists = db_factory::query($strSql . $strPages['where'], 5 * 60); foreach ($arrArtCats as $k => $v) { intval($v['art_cat_id']) == $intCatid and $articleType = $v['cat_name']; } list($strPageTitle, $strPageKeyword, $strPageDescription) = keke_seo_class::getListSEO(0, 0, array('资讯分类' => $articleType), 'article', true); $arrHotNews = db_factory::query("select * from " . TABLEPRE . "witkey_article where cat_type='article' order by views desc limit 10"); $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by good_rate desc limit 0,5", TABLEPRE, TABLEPRE), 1, $intIndexCacheTime); $_SESSION['spread'] = 'index.php?do=articlelist';
case '3': $strWhere .= " order by a.price desc "; break; case '4': $strWhere .= " order by a.price asc "; break; } } else { $strWhere .= " order by a.goodstop desc, a.on_time desc "; } $strPages = $kekezu->_page_obj->getPages($intCount, $intPagesize, $intPage, $strUrl); $strWhere .= $strPages['where']; $arrServices = db_factory::query($strSql . $strWhere); if (is_array($arrServices)) { foreach ($arrServices as $k => $v) { $arrFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and keep_type = "service"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($v['service_id']))); if ($arrFavorite) { $arrServices[$k]['favorite'] = true; } unset($arrFollow); } } $arrFeedPubs = kekezu::get_feed("(feedtype='pub_task' or feedtype='pub_service')", "feed_time desc", 8); $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by good_rate desc limit 0,5", TABLEPRE, TABLEPRE), 1, $intIndexCacheTime); $arrGoodsType = array('6' => '文件', '7' => '服务'); $data = array('地区' => $arrCityone['name'] . $arrCitytwo['name'] . $arrCitythree['name'], '商品类型' => $arrGoodsType[$m], '行业' => $arrIndusPInfo['indus_name'], '子行业' => $arrIndusInfo['indus_name']); list($strPageTitle, $strPageKeyword, $strPageDescription) = keke_seo_class::getListSEO($pd, $i, $data, 'goods', true); $_SESSION['spread'] = 'index.php?do=goodslist'; function get_good_rate($rateuid) { $good_rate = db_factory::get_one("select if(seller_total_num>0,seller_good_num/seller_total_num,0) as good_rate from " . TABLEPRE . "witkey_space where uid=" . intval($rateuid));
public static function get_order_id($obj_type, $obj_id) { $sql = "select order_id from %switkey_order_detail where obj_type='%s' and obj_id='%d'"; return db_factory::get_count(sprintf($sql, TABLEPRE, $obj_type, $obj_id)); }
break; case 'W': $strWhere .= " and task_status=0 "; break; default: $intTaskStatus = -1; break; } } } else { $intTaskStatus = -1; } $strSql = "SELECT task_id, model_id, task_title, task_cash, task_cash_coverage, start_time, task_status FROM `" . TABLEPRE . "witkey_task` WHERE (task_id IN ( SELECT task_id FROM " . TABLEPRE . "witkey_task_bid WHERE uid = " . $gUid . " ) OR task_id IN ( SELECT task_id FROM " . TABLEPRE . "witkey_task_work WHERE uid = " . $gUid . " ) )"; $strCountSql = "SELECT count(*) count FROM `" . TABLEPRE . "witkey_task` WHERE ( task_id IN ( SELECT task_id FROM " . TABLEPRE . "witkey_task_bid WHERE uid = " . $gUid . " ) OR task_id IN ( SELECT task_id FROM " . TABLEPRE . "witkey_task_work WHERE uid = " . $gUid . " ) )"; in_array($strOrder, array_keys($arrListOrder)) and $strWhere .= " order by " . $strOrder or $strWhere .= " order by task_id desc"; $intCount = intval(db_factory::get_count($strCountSql . $strWhere)); $strPages = $page_obj->getPages($intCount, $intPagesize, $intPage, $strUrl); $arrTaskLists = db_factory::query($strSql . $strWhere . $strPages['where']); if ($arrTaskLists) { foreach ($arrTaskLists as $k => $v) { if (in_array($v['model_id'], array('4', '5'))) { $bidInfo = db_factory::get_one("SELECT bid_id FROM " . TABLEPRE . "witkey_task_bid WHERE uid = " . $gUid . " and task_id = " . $v['task_id'] . " ORDER BY bid_id DESC LIMIT 1"); $arrTaskLists[$k]['bid_id'] = $bidInfo['bid_id']; } else { $bidInfo = db_factory::get_one("SELECT work_id FROM " . TABLEPRE . "witkey_task_work WHERE uid = " . $gUid . " and task_id = " . $v['task_id'] . " ORDER BY work_id DESC LIMIT 1"); $arrTaskLists[$k]['work_id'] = $bidInfo['work_id']; } } } } function wiki_opera($m_id, $t_id, $w_id, $url)
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(140); if (isset($submit)) { $basic_obj = new Keke_witkey_basic_config_class(); foreach ($conf as $k => $v) { $basic_obj->setWhere("k = '{$k}'"); $basic_obj->setV($v); $res .= $basic_obj->edit_keke_witkey_basic_config(); } !empty($api) and $attent_api = $api or $attent_api = array(); $basic_obj->setWhere("k = 'attent_api_open'"); $basic_obj->setV(serialize($attent_api)); $basic_obj->edit_keke_witkey_basic_config(); kekezu::admin_system_log($_lang['weibo_config_view']); kekezu::admin_show_msg($_lang['weibo_view_config_success'], "index.php?do=msg&view=attention", 3, '', 'success'); } else { $attent_api = db_factory::get_count(sprintf(" select v from %switkey_basic_config where type='attent_api'", TABLEPRE)); $attent_api = unserialize($attent_api); $attent_list = kekezu::get_table_data("k,v,desc", "witkey_basic_config", "type='attention'", 'listorder asc ', "", "", "k"); } require keke_tpl_class::template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
static function getmessagecount($uid) { $intCountTrends = db_factory::get_count("select count(msg_id) from " . TABLEPRE . "witkey_msg where uid<1 and view_status!=1 and type=1 and to_uid=" . intval($uid)); $intCountNotice = db_factory::get_count("select count(msg_id) from " . TABLEPRE . "witkey_msg where uid<1 and view_status!=1 and type=2 and to_uid=" . intval($uid)); $intCountPrivate = db_factory::get_count("select count(msg_id) from " . TABLEPRE . "witkey_msg where to_uid = " . intval($uid) . " and view_status!=1 and uid>0 and msg_status<>2 "); return intval($intCountTrends) + intval($intCountNotice) + intval($intCountPrivate); }
$_footerAbouts = CommonClass::getFooterPage(); $log_account = null; if (isset($_COOKIE['log_account'])) { $log_account = $_COOKIE['log_account']; } $wb_type = $_SESSION['wb_type']; if ($wb_type && $_SESSION['auth_' . $wb_type]['last_key']) { $oa = new keke_oauth_login_class($wb_type); $oauth_user_info = $oa->get_login_user_info(); } if (intval($u)) { if (!isset($_COOKIE['prom'])) { $objProm = keke_prom_class::get_instance(); $objProm->create_prom_cookie($_SERVER['QUERY_STRING']); } } $arrTopIndus = db_factory::query("SELECT count(task_id) as count ,indus_id FROM " . TABLEPRE . "witkey_task where task_status>=2 group by indus_id order by count desc limit 5"); kekezu::redirect_second_domain(); $arrDisplaypro = CommonClass::getDistrictByPid('0', 'id,upid,name'); if ($gUid) { //2015-08-02 修改 task_status 由0->8 $intWaitPay = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where uid=" . intval($gUid) . " and task_status=0"); $intChoose = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_task where uid=" . intval($gUid) . " and task_status=3"); $intShopPay = db_factory::query("select count(*) as count from " . TABLEPRE . "witkey_order a left join " . TABLEPRE . "witkey_order_detail b on a.order_id=b.order_id\n\t\t where a.order_uid=" . intval($gUid) . " and a.order_status='wait' and b.obj_type='service'"); $intMarkG = db_factory::execute("select * from " . TABLEPRE . "witkey_mark where mark_status=0 and mark_type=2 and by_uid=" . intval($gUid)); $intMarkW = db_factory::execute("select * from " . TABLEPRE . "witkey_mark where mark_status=0 and mark_type=1 and by_uid=" . intval($gUid)); $intService = db_factory::get_count("SELECT COUNT(*) as count2 FROM `" . TABLEPRE . "witkey_order` AS a LEFT JOIN " . TABLEPRE . "witkey_order_detail AS b ON a.order_id = b.order_id LEFT JOIN " . TABLEPRE . "witkey_service_order AS c ON b.order_id = c.order_id WHERE 1=1 and a.seller_uid = " . $gUid . " and b.obj_type = 'service' and a.order_status ='seller_confirm' order by b.order_id desc"); $intGy = db_factory::get_count("SELECT count(*) as count2 FROM `" . TABLEPRE . "witkey_service_order` as a LEFT JOIN " . TABLEPRE . "witkey_order_detail as b ON a.order_id = b.order_id\n\t\t\tLEFT JOIN " . TABLEPRE . "witkey_order as c ON a.order_id = c.order_id\n\t\t\tWHERE 1=1 and c.seller_uid= " . $gUid . " and c.order_status!= 'close' and c.order_status ='seller_confirm' order by c.order_time desc"); } require 'control/' . $do . '.php'; require $kekezu->_tpl_obj->template($do);
public function public_pubservice() { $std_obj = $this->_std_obj; $release_info = $std_obj->_release_info; $service_obj = $this->_service_obj; $txt_service_title = kekezu::str_filter($release_info['txt_title']); $service_obj->setTitle($txt_service_title); $service_obj->setModel_id($this->_model_id); if ($release_info[submit_method] == 'inside') { $service_obj->setFile_path($release_info[file_path_2]); } $tar_content = kekezu::str_filter($release_info['tar_content']); $service_obj->setContent(kekezu::escape($tar_content)); $service_obj->setIndus_id($release_info[indus_id]); $service_obj->setIndus_pid($release_info['indus_pid']); $service_obj->setCity($release_info['city']); $service_obj->setProvince($release_info['province']); $service_obj->setArea($release_info['area']); $shop_id = db_factory::get_count(sprintf(" select shop_id from %switkey_shop where uid ='%d'", TABLEPRE, $this->_uid)); $service_obj->setShop_id($shop_id); $service_obj->setUid($this->_uid); $service_obj->setUsername($this->_username); $service_obj->setPrice($release_info['txt_price']); $service_obj->setUnite_price($release_info['unite_price']); $service_obj->setService_time($release_info['service_time']); $service_obj->setUnit_time($release_info['unit_time']); $service_obj->setProfit_rate($this->_service_config['service_profit']); $service_obj->setConfirm_max($this->_service_config['confirm_max_day']); $release_info['pic_patch'] and $service_obj->setPic($release_info['pic_patch']); $service_obj->setOn_time(time()); }
$reg_uid = $reg_obj->user_register($fds['username'], $fds['password'], $fds['email'], null, false, $fds['password']); unset($fds[repassword]); $arrAddUserInfo = array(); $fds['truename'] and $arrAddUserInfo['truename'] = $fds['truename']; $fds['phone'] and $arrAddUserInfo['phone'] = $fds['phone']; $fds['indus_id'] and $arrAddUserInfo['indus_id'] = $fds['indus_id']; $fds['indus_pid'] and $arrAddUserInfo['indus_pid'] = $fds['indus_pid']; $fds['birthday'] and $arrAddUserInfo['birthday'] = $fds['birthday']; !empty($arrAddUserInfo) and db_factory::updatetable(TABLEPRE . 'witkey_space', $arrAddUserInfo, array('uid' => $reg_uid)); is_null($fds['group_id']) or db_factory::execute(sprintf("update %switkey_space set group_id={$fds['group_id']} where uid={$reg_uid}", TABLEPRE)); kekezu::admin_system_log($_lang['add_member'] . $fds['username']); kekezu::admin_show_msg($_lang['operate_notice'], "index.php?do=user&view=add", 3, $_lang['user_creat_success'], 'success'); } else { $uinfo = kekezu::get_user_info($edituid); if ($fds['password']) { $slt = db_factory::get_count(sprintf("select rand_code from %switkey_member where uid = '%d'", TABLEPRE, $edituid)); $sec_code = keke_user_class::get_password($fds['password'], $slt); $fds['sec_code'] = $sec_code; $newpwd = $fds['password']; $pwd = md5($fds['password']); $fds[password] = $pwd; db_factory::execute(sprintf("update %switkey_member set password ='******' where uid=%d", TABLEPRE, $pwd, $edituid)); } else { unset($fds['password']); } keke_user_class::user_edit($uinfo['username'], '', $newpwd, '', 1); $space_class->save($fds, array("uid" => "{$edituid}")); kekezu::admin_system_log($_lang['edit_member'] . $member_arr[username]); kekezu::admin_show_msg($_lang['edit_success'], "index.php?do=user&view=add&edituid=" . $edituid, 3, '', 'success'); } }
$arrAuthItems = keke_auth_fac_class::getAuthItemListByUid($id); $arrSellerLevel = unserialize($arrSellerInfo['seller_level']); $arrSellerMark = keke_user_mark_class::get_user_aid($arrSellerInfo['uid'], '2', null, '1'); foreach ($arrSellerMark as $k => $v) { $arrSellerMark[$k]['star'] = intval($v['avg']); } $arrFollow = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and fuid = %d', TABLEPRE . 'witkey_free_follow', intval($gUid), intval($arrSellerInfo['uid']))); if ($arrFollow) { $arrSellerInfo['follow'] = 1; } else { $arrSellerInfo['follow'] = 0; } unset($arrFollow); if ($closeshop) { keke_shop_release_class::closeShop($arrSellerInfo['uid'], 3); kekezu::show_msg("店铺已关闭", null, null, NULL, 'success'); die; } if ($openshop) { keke_shop_release_class::updateShopStatus($arrSellerInfo['uid'], 1); kekezu::show_msg("店铺已开张,可以添加商品哦!", null, null, NULL, 'success'); die; } $intGoodsCount = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and service_status = 2 ', TABLEPRE . 'witkey_service ', $arrSellerInfo['uid'])); $intTaskCount = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and task_status >1', TABLEPRE . 'witkey_task', $arrSellerInfo['uid'])); $intCaseCount = db_factory::get_count(sprintf('select count(*) from %s where shop_id = %d ', TABLEPRE . 'witkey_shop_case', $arrSellerInfo['shop_id'])); $intMarkCount = db_factory::get_count(sprintf('select count(*) from %s where mark_status > 0 and uid = %d', TABLEPRE . 'witkey_mark', $arrSellerInfo['uid'])); $_SESSION['spread'] = 'index.php?do=seller&id=' . intval($id); require $do . '/' . $view . '.php'; require $kekezu->_tpl_obj->template($do . '/' . $view); die;
public static function payitem_exists($uid, $item_code = false, $obj_type = false, $payitem_arr = false) { if ($payitem_arr) { foreach ($payitem_arr as $k => $v) { $buy_count = db_factory::get_count(sprintf(" select sum(use_num) from %switkey_payitem_record where uid = '%d' and item_code = '%s' and use_type = 'buy'", TABLEPRE, $uid, $v[item_code])); $use_count = db_factory::get_count(sprintf(" select sum(use_num) from %switkey_payitem_record where uid = '%d' and item_code = '%s' and use_type = 'spend'", TABLEPRE, $uid, $v[item_code])); $payitem_info[$v[item_code]] = intval($buy_count - $use_count); } } else { $buy_count = db_factory::get_count(sprintf(" select sum(use_num) from %switkey_payitem_record where uid = '%d' and item_code = '%s' and use_type = 'buy'", TABLEPRE, $uid, $item_code)); $use_count = db_factory::get_count(sprintf(" select sum(use_num) from %switkey_payitem_record where uid = '%d' and item_code = '%s' and use_type = 'spend'", TABLEPRE, $uid, $item_code)); $payitem_info = intval($buy_count - $use_count); } return $payitem_info; }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(32); $tag_obj = new Keke_witkey_tag_class(); $ad_obj = new Keke_witkey_ad_class(); $table_obj = new keke_table_class('witkey_tag'); $url = "index.php?do={$do}&view={$view}&order_type={$order_type}&w[tpl_type]={$w['tpl_type']}&w[page_size]={$page_size}&w[ord]={$w['ord']}&page={$page}"; if ($sbt_action == $_lang['mulit_delete'] || $ac == 'del') { if (!empty($delid)) { $ad_name = db_factory::get_count("select tagname from " . TABLEPRE . "witkey_tag where tag_id = '{$delid}'"); $ad_obj->setWhere("ad_name='{$ad_name}'"); $ad_result = $ad_obj->del_keke_witkey_ad(); $tag_obj->setWhere('tag_id=' . $delid); $result = $tag_obj->del_keke_witkey_tag(); kekezu::admin_system_log($_lang['delete_ads_tags_id'] . $delid . 'name:' . $ad_name . $_lang['corresponding_ads_data'] . $ad_result . $_lang['tiao']); kekezu::admin_show_msg($result ? $_lang['delete_ads_tags_success'] : $_lang['delete_fail'], $url, 3, '', $result ? 'success' : 'warning'); } else { if (!empty($ckb)) { $ids = is_array($ckb) && count($ckb) > 0 ? implode(',', $ckb) : kekezu::admin_show_msg($_lang['delete_fail_select_operation'], $url, 3, '', 'warning'); $tag_name_arr = db_factory::query(' select tagname from ' . TABLEPRE . "witkey_tag where tag_id in({$ids}) "); while (list($key, $value) = each($tag_name_arr)) { $ad_obj->setWhere('ad_name = "' . $value['tagname'] . '"'); $ad_result .= $ad_obj->del_keke_witkey_ad(); } $tag_obj->setWhere('tag_id in(' . $ids . ')'); $result = $tag_obj->del_keke_witkey_tag(); kekezu::admin_system_log($_lang['mulit_delete_ads_tags'] . $ids . $_lang['is_corresponding_ads_data'] . $ad_result . $_lang['tiao']); kekezu::admin_show_msg($result ? $_lang['mulit_delete_ads_tags_success'] : $_lang['delete_fail'], $url, 3, '', $res ? 'success' : 'warning'); } }
$arrNerLists = array(); foreach ($arrSellerLists as $k => $v) { $arrService = db_factory::query("select * from " . TABLEPRE . "witkey_service where service_status=2 and uid=" . intval($v['uid']) . " order by sale_num desc limit 0,3"); $arrNerLists[$k] = $v; $arrNerLists[$k]['service'] = $arrService; if (is_array($arrNerLists[$k]['service'])) { foreach ($arrNerLists[$k]['service'] as $kk => $vv) { $arrFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and keep_type = "service"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($vv['service_id']))); if ($arrFavorite) { $arrNerLists[$k]['service'][$kk]['favorite'] = true; } unset($arrFollow); } } unset($arrService); $arrFollow = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and fuid = %d', TABLEPRE . 'witkey_free_follow', intval($gUid), intval($v['uid']))); if ($arrFollow) { $arrNerLists[$k]['follow'] = true; } unset($arrFollow); } } if ($arrNerLists) { foreach ($arrNerLists as $k => $v) { $arrNerLists[$k]['pro_city'] = keke_shop_class::getUserAddress($v['uid'], 2, 1, 1, 0); } } $arrShopIndusC = $kekezu->_indus_c_arr; $arrShopIndusP = $kekezu->_indus_p_arr; if (is_array($arrShopIndusC)) { $arrNewShopIndusC = array();
public function check_bid() { $count = db_factory::get_count(sprintf("select count(*) from %switkey_task_bid where task_id='%d' and uid='%d'", TABLEPRE, $this->_task_id, $this->_uid)); if (intval($count) == 0) { return true; } else { return false; } }
function dispose_prom_event($action, $uid, $obj_id) { $p_relation = $this->get_prom_relation($uid, $action); if ($p_relation && $p_relation['realtion_status'] != 3) { $prom_event = $this->get_prom_event($obj_id, $uid, $action); } if ($prom_event) { if ($prom_event['action'] == 'reg') { if (!$this->_auth) { keke_finance_class::cash_in($prom_event['parent_uid'], $prom_event['rake_cash'], "prom_" . $action); $this->set_relation_status($p_relation['relation_id'], 2); $result = $this->set_prom_event_status($prom_event['parent_uid'], $prom_event['username'], $prom_event['event_id'], 2); } else { $auth = implode('","', $this->_auth); $count = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and auth_code in ("%s") and auth_status = 1', TABLEPRE . 'witkey_auth_record', $prom_event['uid'], $auth)); if (intval($count) == count($this->_auth)) { keke_finance_class::cash_in($prom_event['parent_uid'], $prom_event['rake_cash'], "prom_" . $action); $this->set_relation_status($p_relation['relation_id'], 2); $result = $this->set_prom_event_status($prom_event['parent_uid'], $prom_event['username'], $prom_event['event_id'], 2); } } } else { keke_finance_class::cash_in($prom_event['parent_uid'], $prom_event['rake_cash'], "prom_" . $action); $this->set_relation_status($p_relation['relation_id'], 2); $result = $this->set_prom_event_status($prom_event['parent_uid'], $prom_event['username'], $prom_event['event_id'], 2); } return $result; } }
public static function del_file($filepath, $is_db = true) { if ($is_db or db_factory::get_count(sprintf(" select count(file_id) from %switkey_file where save_name='%s'", TABLEPRE, $filepath))) { if (is_file($filepath)) { return unlink($filepath); } else { return false; } } else { return unlink($filepath); } }
$p['anchor'] = '#detail'; if ($st) { $p['url'] .= "&st=" . $st; } if ($ut) { $p['url'] .= "&ut=" . $ut; } $w['work_status'] = $st; $w['work_type'] = $ut; $arrWorkArrs = $objTask->get_work_info($w, $p); $strPages = $arrWorkArrs['pages']; $arrWorkInfo = $arrWorkArrs['work_info']; $arrMark = $arrWorkArrs['mark']; if (is_array($arrWorkInfo)) { foreach ($arrWorkInfo as $k => $v) { $arrFavorite = db_factory::get_count(sprintf('select count(*) from %s where uid = %d and obj_id = %d and origin_id = %d and keep_type = "work"', TABLEPRE . 'witkey_favorite', intval($gUid), intval($v['work_id']), intval($arrTaskInfo['task_id']))); if ($arrFavorite) { $arrWorkInfo[$k]['favorite'] = true; } unset($arrFavorite); } } $arrMark = $arrWorkArrs['mark']; break; case 'comment': $objComment = keke_comment_class::get_instance('task'); $strUrl .= "&view=comment"; $arrCommentDatas = $objComment->get_comment_list($id, $strUrl, $page); $arrCommentLists = $arrCommentDatas['data']; $strPage = $arrCommentDatas['pages']; $arrReplyLists = $objComment->get_reply_info($id);
public static function wiki_opera($m_id, $t_id, $w_id, $url) { global $uid, $_K, $do, $view, $_lang; $status = db_factory::get_count(sprintf(' select task_status from %switkey_task where task_id=%d', TABLEPRE, $t_id, $uid), 0, 'task_status', 600); $site = $_K['siteurl'] . '/'; $button = array(); $button['view'] = array('href' => $site . 'index.php?do=task&id=' . $t_id . '&view=work&ut=my', 'desc' => $_lang['view_work'], 'ico' => 'book'); switch ($status) { case 2: break; case 5: $button['workover'] = array('href' => "javascript:workOver(0,'{$t_id}');void(0);", 'desc' => '工作完成'); break; case 8: case 9: $button['del'] = array('click' => "confirmOp('确定删除?','{$site}{$url}&action=delWork&objId={$w_id}',true)", 'desc' => $_lang['delete'] . '稿件', 'href' => 'javascript:void(0);'); break; } return $button; }
function user_intergration($username, $pwd) { global $_lang; if ($this->_sys_config['user_intergration'] == 2) { require_once S_ROOT . '/uc_client/client.php'; $uc_info = uc_user_login($username, $pwd); if ($uc_info['0'] > 0) { $u = array('uid' => $uc_info['0'], 'username' => $uc_info['1'], 'email' => $uc_info['3']); } else { $u = $uc_info['0']; } } if ($u == -2) { $this->show_msg($_lang['you_input_password_not_right'], 3); } elseif ($u == -1) { $this->show_msg($_lang['you_input_username_not_exist'], 4); } else { $exists = db_factory::get_count(sprintf(" select uid from %switkey_member where uid='%d' ", TABLEPRE, $u['uid'])); if (!$exists) { $reg_obj = new keke_register_class(); $reg_obj->_reg_pwd = md5($pwd); $reg_obj->save_userinfo($u['username'], $u['email'], $u['uid']); } } return $u; }
kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } if ($city === '选择城市' || !$city) { $tips['errors']['city'] = '请选择城市'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } if (!$strBankFullName) { $tips['errors']['bank_full_name'] = '请输入开户行名称'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } if (!$strCardNum) { $tips['errors']['card_num'] = '请输入银行卡号'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } $strSql = sprintf(" select card_num from %switkey_member_bank where bind_status=1 and card_num='%s'", TABLEPRE, $strCardNum); if (db_factory::get_count($strSql)) { $tips['errors']['card_num'] = '此账号已被他人绑定'; kekezu::show_msg($tips, NULL, NULL, NULL, 'error'); } $arrDistrictData = CommonClass::getAllDistrict('id,upid,name'); $province = $arrDistrictData[$province]['name']; $city = $arrDistrictData[$city]['name']; $strBankAddress = $province . "," . $city; if (strtoupper(CHARSET) == 'GBK') { $strTxtName = kekezu::utftogbk($strTxtName); $strBankName = kekezu::utftogbk($strBankName); $strBankAddress = kekezu::utftogbk($strBankAddress); $strBankFullName = kekezu::utftogbk($strBankFullName); } $arrData = array($strInputName => $strTxtName, 'bank_name' => $strBankName, 'bank_address' => $strBankAddress, 'bank_full_name' => $strBankFullName, 'bank_type' => $intUserRole, 'card_num' => $strCardNum, 'uid' => $gUid, 'on_time' => time(), 'bind_status' => 1); $intBankId = $objMemBankT->save($arrData);
public static function wiki_opera($m_id, $t_id, $w_id, $url) { global $uid, $_K, $do, $view, $_lang; $status = db_factory::get_count(sprintf(' select task_status from %switkey_task where task_id=%d', TABLEPRE, $t_id, $uid), 0, 'task_status', 600); $model_id = db_factory::get_count(sprintf(' select model_id from %switkey_task where task_id=%d', TABLEPRE, $t_id, $uid), 0, 'model_id', 600); $intWorkStatus = db_factory::get_count(sprintf(' select work_status from %switkey_task_work where work_id=%d', TABLEPRE, $w_id, $uid), 0, 'work_status', 600); $site = $_K['siteurl'] . '/'; $button = array(); $button['view'] = array('href' => $site . 'index.php?do=taskhandle&op=workinfo&taskId=' . $t_id . '&workId=' . $w_id, 'desc' => '查看稿件', 'ico' => 'book'); switch ($status) { case 2: break; case 6: case 13: if ($intWorkStatus == 4 && $model_id == 1) { $agree_id = db_factory::get_count(sprintf(' select agree_id from %switkey_agreement where task_id=%d and seller_uid=%d', TABLEPRE, $t_id, $uid)); $button['agree'] = array('href' => $site . 'index.php?do=agreement&taskId=' . $t_id . '&agreeId=' . $agree_id, 'desc' => '交付详情'); } break; case 8: case 9: $button['del'] = array('click' => "confirmOp('确定删除?','{$site}{$url}&action=delWork&objId={$w_id}',true)", 'desc' => $_lang['delete'] . '稿件', 'href' => 'javascript:void(0);'); break; } return $button; }
function to_black($days) { $uid = $this->_to_user_info['uid']; if ($days) { $sql = sprintf("update %switkey_space set status=2 where uid=%d", TABLEPRE, $uid); db_factory::execute($sql); } else { return false; } $expire = $days * 3600 * 24; $sql2 = sprintf("select count(*) as c from %switkey_member_black where uid = %d ", TABLEPRE, $uid); if (db_factory::get_count($sql2)) { $sql3 = sprintf("update %switkey_member_black set expire = if(expire>unix_timestamp(),expire+%d, unix_timestamp()+%d) where uid = %d ", TABLEPRE, $expire, $expire, $uid); } else { $sql3 = sprintf("insert into %switkey_member_black (uid,expire,on_time) values (%d,%d,%d)", TABLEPRE, $uid, $expire, time()); } db_factory::execute($sql3); return true; }