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


PHP mysql::getQueryRecord方法代码示例

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


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

示例1: home

 public function home()
 {
     global $db, $config, $router;
     // 初始化資料庫連結介面
     $db = new mysql($config["db"]);
     $db->connect();
     $router = new Router();
     $this->userid = empty($_SESSION['auth_id']) ? '' : $_SESSION['auth_id'];
     $ret['status'] = 0;
     // Check Variable Start
     if (empty($_GET['pgpid'])) {
         $ret['status'] = 0;
     } elseif (empty($_POST['name'])) {
         //('收件人姓名错误!!');
         $ret['status'] = 2;
     } elseif (empty($_POST['zip'])) {
         //('收件人邮编错误!!');
         $ret['status'] = 3;
     } elseif (empty($_POST['address'])) {
         //('收件人地址错误!!');
         $ret['status'] = 4;
     } else {
         $query = "SELECT p.*, unix_timestamp(offtime) as offtime, unix_timestamp() as `now`, pgp.pgpid, pgp.price, pgp.complete \r\n\t\t\tFROM `{$config['db'][4]['dbname']}`.`{$config['default_prefix']}pay_get_product` pgp \r\n\t\t\tLEFT OUTER JOIN `{$config['db'][4]['dbname']}`.`{$config['default_prefix']}product` p ON \r\n\t\t\t\tpgp.prefixid = p.prefixid\r\n\t\t\t\tAND pgp.productid = p.productid\r\n\t\t\t\tAND p.switch = 'Y' \r\n\t\t\tWHERE \r\n\t\t\t\tpgp.`prefixid` = '{$config['default_prefix_id']}' \r\n\t\t\t\tAND pgp.pgpid  = '{$_GET["pgpid"]}'\r\n\t\t\t\tAND pgp.userid = '{$this->userid}'\r\n\t\t\t\tAND pgp.switch = 'Y'\r\n\t\t\t";
         $table = $db->getQueryRecord($query);
         //if (empty($table['table']['record'])) { $this->jsPrintMsg('商品不存在!', $location_url); }
         $product = $table['table']['record'][0];
         $product['price'] = round($product['price'] * $config['sjb_rate'], 2);
         $product['real_process_fee'] = round($product['retail_price'] * $product['process_fee'] / 100 * $config['sjb_rate'], 2);
         $product['total'] = $product['real_process_fee'] + $product['price'];
         $query = "select sum(amount) as total_amount\r\n\t\t\tfrom `{$config['db'][1]['dbname']}`.`{$config['default_prefix']}spoint` \r\n\t\t\twhere\r\n\t\t\t\tuserid = '{$this->userid}'\r\n\t\t\t\tand switch = 'Y'\r\n\t\t\tGROUP BY userid\r\n\t\t\t";
         $table = $db->getQueryRecord($query);
         if ($table['table']['record'][0]['total_amount'] < $product['total']) {
             //餘額不足
             $ret['status'] = 6;
         }
         if ($product['complete'] == 'Y') {
             //'已结账'
             $ret['status'] = 5;
         }
     }
     if (empty($ret['status'])) {
         //產生訂單記錄
         $mk = $this->mk_order($product);
         //回傳: 完成
         $ret['status'] = $mk['err'] ? $mk['err'] : 200;
     }
     echo json_encode($ret);
 }
开发者ID:,项目名称:,代码行数:48,代码来源:

示例2: chk_login

 public function chk_login()
 {
     global $db, $config, $enterprisemodel;
     $r['err'] = '';
     $db2 = new mysql($config["db2"]);
     $db2->connect();
     $query = "SELECT * FROM `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}enterprise` e\r\n\t\t           JOIN `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}enterprise_profile` ep\r\n\t\t\t\t     ON e.enterpriseid=ep.enterpriseid and e.switch='Y'\r\n\t\t          WHERE e.prefixid = '{$config['default_prefix_id']}' \r\n\t\t\t        AND e.loginname = '{$_POST['loginname']}' \r\n\t\t\t        AND e.switch = 'Y' \r\n\t\t          LIMIT 1\r\n\t\t";
     error_log("[ajax/enterprise.chk_login]" . $query);
     $table = $db2->getQueryRecord($query);
     if (empty($table['table']['record'])) {
         //'账号不存在'
         $r['err'] = 3;
     } else {
         $_SESSION['sajamanagement']['enterprise'] = '';
         $enterprise = $table['table']['record'][0];
         $passwd = $this->str->strEncode($_POST['passwd'], $config['encode_key']);
         if ($enterprise['passwd'] === $passwd) {
             $_SESSION['sajamanagement']['enterprise'] = $enterprise;
             setcookie("enterpriseid", $enterprise['enterpriseid'], time() + 43200, "/", COOKIE_DOMAIN);
             $r['err'] = '';
         } else {
             //'密码不正确'
             $r['err'] = 5;
         }
     }
     return $r;
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例3: saja

 public function saja()
 {
     $time_start = $this->time_start;
     global $db, $config, $router;
     // 初始化資料庫連結介面
     $db = new mysql($config["db"]);
     $db->connect();
     $router = $this->time_start;
     $this->userid = empty($_SESSION['auth_id']) ? '' : $_SESSION['auth_id'];
     $ret['status'] = 0;
     $ret['winner'] = '';
     $ret['rank'] = '';
     //讀取商品資料
     $query = "SELECT p.*, unix_timestamp(p.offtime) as offtime, unix_timestamp() as `now`\r\n\t\tFROM `{$config['db'][4]['dbname']}`.`{$config['default_prefix']}product` p \r\n\t\tWHERE \r\n\t\t\tp.prefixid = '{$config['default_prefix_id']}'\r\n\t\t\tAND p.productid = '{$_POST['productid']}'\r\n\t\t\tAND p.switch = 'Y'\r\n\t\tLIMIT 1\r\n\t\t";
     $table = $db->getQueryRecord($query);
     unset($table['table']['record'][0]['description']);
     $product = $table['table']['record'][0];
     if ($product['offtime'] == 0 && $product['locked'] == 'Y' || $product['offtime'] > 0 && $product['now'] > $product['offtime']) {
         //回傳: 本商品已结标
         $ret['status'] = 2;
     }
     /*
     		elseif($this->chk_time_limit() ) {
     			//回傳: 下标时间间隔过短,请稍后再下标
     			$ret['status'] = 3;
     		}*/
     if ($_POST['type'] == 'single') {
         //單次下標
         $chk = $this->chk_single($product);
         if ($chk['err']) {
             $ret['status'] = $chk['err'];
         }
     } elseif ($_POST['type'] == 'range') {
         //連續下標
         $chk = $this->chk_range($product);
         if ($chk['err']) {
             $ret['status'] = $chk['err'];
         }
     }
     if (empty($ret['status'])) {
         //產生下標歷史記錄
         $mk = $this->mk_history($product);
         //回傳: 下标完成
         $ret['status'] = $mk['err'] ? $mk['err'] : 200;
         $ret['winner'] = $mk['winner'];
         $ret['rank'] = $mk['rank'];
     }
     $time_end = microtime(true);
     $time = number_format($time_end - $time_start, 10);
     echo "下標 {$time} 秒<br>";
     echo json_encode($ret);
 }
开发者ID:,项目名称:,代码行数:52,代码来源:

示例4: get_country

 /**
  * Country Method : get_country
  */
 public function get_country()
 {
     // global $db, $config;
     global $config;
     $db = new mysql($config["db2"]);
     $db->connect();
     $query = "SELECT *\n\t\tFROM `{$config['db'][2]['dbname']}`.`{$config['default_prefix']}country` \n\t\tWHERE\n\t\t\tprefixid = '{$config['default_prefix_id']}'\n\t\t\tAND switch = 'Y'\n\t\t\tORDER BY countryid\n\t\t";
     $table = $db->getQueryRecord($query);
     if (!empty($table['table']['record'])) {
         return $table['table']['record'];
     }
     return false;
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例5: faq_detail

 public function faq_detail($id)
 {
     // global $db, $config;
     global $config;
     $db = new mysql($config["db2"]);
     $db->connect();
     $query = "SELECT f.*, fc.name cname\n\t\tFROM `{$config["db"][0]["dbname"]}`.`{$config['default_prefix']}faq` f \n\t\tLEFT OUTER JOIN `{$config["db"][0]["dbname"]}`.`{$config['default_prefix']}faq_category` fc ON \n\t\t\tf.prefixid = fc.prefixid \n\t\t\tAND f.fcid = fc.fcid \n\t\t\tAND fc.`switch`='Y' \n\t\tWHERE \n\t\t\tf.prefixid = '{$config["default_prefix_id"]}' \n\t\t\tAND f.faqid ='{$id}' \n\t\t\tAND f.switch = 'Y'\n\t\t";
     $table = $db->getQueryRecord($query);
     if (!empty($table['table']['record'][0])) {
         //简介
         $description = !empty($table['table']['record'][0]['description']) ? $table['table']['record'][0]['description'] : '空白';
         $table['table']['record'][0]['description'] = html_decode($description);
         return $table['table']['record'][0];
     }
     return false;
 }
开发者ID:,项目名称:,代码行数:16,代码来源:

示例6: getEnterprise

function getEnterprise($enterpriseid)
{
    global $config;
    $ret = array();
    $ret['code'] = 1;
    if ($enterpriseid == '') {
        $ret['code'] = -1;
        $ret['msg'] = '登入失败 : id缺误 !!';
    }
    $query = "SELECT * FROM `saja_user`.`saja_enterprise` \r\n\t\t\tWHERE \r\n\t\t\tprefixid = 'saja' \r\n\t\t\tAND enterpriseid = '" . $enterpriseid . "' \r\n\t\t\tAND switch = 'Y' \r\n\t\t\t";
    error_log($query);
    $model = new mysql($config["db"][0]);
    $model->connect();
    $table = $model->getQueryRecord($query);
    if (empty($table['table']['record'])) {
        $ret['code'] = -2;
        $ret['msg'] = '登入失败 : 账戶不存在!!';
    }
    $ret['code'] = 1;
    $ret['msg'] = $table['table']['record'][0];
    return $ret;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例7: set_login

function set_login($user)
{
    global $config;
    $_SESSION['user'] = '';
    $_SESSION['auth_id'] = '';
    $_SESSION['auth_email'] = '';
    $_SESSION['auth_secret'] = '';
    $query = "SELECT *\r\n\t\tFROM `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}user_profile`\r\n\t\tWHERE `prefixid` = '{$config['default_prefix_id']}' \r\n\t\t\tAND `userid` = '{$user['userid']}'\r\n\t\t\tAND `switch` =  'Y'\r\n\t\t";
    // error_log("[set_login]Query User : ".$query);
    $db = new mysql($config["db"][0]);
    $db->connect();
    $table = $db->getQueryRecord($query);
    $user['profile'] = $table['table']['record'][0];
    $_SESSION['user'] = $user;
    // Set session and cookie information.
    $_SESSION['auth_id'] = $user['userid'];
    $_SESSION['auth_email'] = '';
    $_SESSION['auth_secret'] = md5($user['userid'] . $user['name']);
    setcookie("auth_id", $user['userid'], time() + 60 * 60 * 24 * 30, "/", COOKIE_DOMAIN);
    setcookie("auth_email", '', time() + 60 * 60 * 24 * 30, "/", COOKIE_DOMAIN);
    setcookie("auth_secret", md5($user['userid'] . $user['name']), time() + 60 * 60 * 24 * 30, "/", COOKIE_DOMAIN);
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例8: mysql

 $curr_saja_bonus = 0;
 // 現有saja bonus點數
 $nickname = "";
 $i_RETURNCODE = "1";
 $needed_ibon_bonus = 0;
 // 所需ibon總共點數
 $saja_bonus_to_reduce = 0;
 // 須扣除saja bonus 點數
 $db = new mysql($config["db"]);
 $db->connect();
 $sql = "SELECT * FROM saja_exchange.saja_exchange_ibon_log ";
 $sql .= "WHERE i_DETAIL_NUM = '" . $i_DETAIL_NUM . "' ";
 $sql .= "AND state = '1' ";
 $sql .= "ORDER BY adate DESC LIMIT 1";
 error_log("sql 4 :" . $sql);
 $table = $db->getQueryRecord($sql);
 if (!empty($table['table']['record'])) {
     $userid = $table['table']['record'][0]['userid'];
     $account_id = $table['table']['record'][0]['account_id'];
     // if ($i_STATUS_CODE=="0000" && $i_prdate_no!= "") {
     if ($i_STATUS_CODE == "0000" && $i_prdate_no > 0) {
         $i_dt = array("SERIAL_NO" => array(), "DATA_1" => array(), "DATA_2" => array(), "DATA_3" => array(), "DATA_4" => array(), "DATA_5" => array(), "DATA_6" => array(), "DATA_7" => array(), "DATA_8" => array());
         for ($i = 0; $i < (int) $i_XMLData->TOTAL_COUNT; $i++) {
             $i_same = 0;
             for ($j = 0; $j < count($i_dt["SERIAL_NO"]); $j++) {
                 // 重複商品項目合併數量及金額
                 if ($i_dt["SERIAL_NO"][$j] != (string) $i_XMLData->LISTDATA->DATA[$i]->SERIAL_NO && $i_dt["DATA_1"][$j] == (string) $i_XMLData->LISTDATA->DATA[$i]->DATA_1 && $i_dt["DATA_2"][$j] == (string) $i_XMLData->LISTDATA->DATA[$i]->DATA_2 && $i_dt["DATA_7"][$j] == (string) $i_XMLData->LISTDATA->DATA[$i]->DATA_7) {
                     $i_dt["DATA_3"][$j] = (int) $i_dt["DATA_3"][$j] + (int) $i_XMLData->LISTDATA->DATA[$i]->DATA_3;
                     $i_dt["DATA_4"][$j] = (int) $i_dt["DATA_4"][$j] + (int) $i_XMLData->LISTDATA->DATA[$i]->DATA_4;
                     $i_same = 1;
                 }
开发者ID:,项目名称:,代码行数:31,代码来源:

示例9: explode

require_once "/var/www/lib/saja/mysql.ini.php";
// include_once("/var/www/html/site/lib/helpers.php");
$phpF = $_SERVER['PHP_SELF'];
$arrF = explode('/', $phpF);
$arrF2 = explode('.', $arrF[count($arrF) - 1]);
$productid = $arrF2[0];
session_start();
error_log("[evt/" . $productid . ".php] openid:" . $_SESSION['sso']['openid'] . ",user_src:" . $_REQUEST['user_src'] . ",productid:" . $productid . ",userid:" . $_SESSION['auth_id']);
if (empty($_SESSION['sso']['openid'])) {
    die('请登入进行激活 !!');
}
$passed = false;
$db = new mysql($config["db"][0]);
$db->connect();
$chk = "select * from saja_user.saja_passphrase where openid='{$_SESSION['sso']['openid']}' and productid='{$productid}' LIMIT 0,1 ";
$table = $db->getQueryRecord($chk);
error_log("[evt/" . $productid . ".php] : " . $chk . '==>' . $table['table']['record'][0]['ppid']);
if ($table['table']['record'][0]['ppid'] > 0) {
    // 已經激活過
    $switch = $table['table']['record'][0]['switch'];
    if ($switch == 'W' || $switch == 'Y') {
        $passed = true;
    }
} else {
    // 第一次進來
    $insert = "insert into saja_user.saja_passphrase set openid='{$_SESSION['sso']['openid']}', \r\n\t\t\t\tuserid='{$_SESSION['auth_id']}', \r\n\t\t\t\tuser_src='{$_REQUEST['user_src']}', \r\n\t\t\t    productid='{$productid}', \r\n\t\t\t\tswitch='N', insertt=NOW(), modifyt=NOW() ";
    $r = $db->query($insert);
    error_log("[evt/" . $productid . ".php] log user_src: " . $insert . '==>' . $r);
}
/*
$chk = "select count(ppid) as cnt from saja_user.saja_passphrase where openid='{$_SESSION['sso']['openid']}' and productid='{$productid}' ";
开发者ID:,项目名称:,代码行数:31,代码来源:

示例10: countRecommandUsers

 public function countRecommandUsers($userid)
 {
     global $config;
     $db = new mysql($config["db2"]);
     $db->connect();
     $sql = "SELECT count(userid) as cnt from `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}passphrase`\n                   WHERE switch='Y' and user_src='{$userid}' ";
     $table = $db->getQueryRecord($sql);
     if (!empty($table['table']['record'][0])) {
         return $table['table']['record'][0]['cnt'];
     } else {
         return false;
     }
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例11: get_cancelled_bid_info

 public function get_cancelled_bid_info($productid)
 {
     // global $db, $config;
     global $config;
     $db = new mysql($config["db2"]);
     $db->connect();
     $query = "select price, count(price) as num \n\t\tFROM `{$config['db'][4]['dbname']}`.`{$config['default_prefix']}history` \n\t\twhere \n\t\t\tprefixid = '{$config["default_prefix_id"]}' \n\t\t    and productid = '{$productid}'\n\t\t    and type = 'bid'\n\t\t    AND productid IS NOT NULL\n\t\t\tAND userid IS NOT NULL\n\t\t\tand switch = 'Y'\n\t\t\tgroup by price\n\t\t\torder by price\n\t\t";
     $table = $db->getQueryRecord($query);
     if (!empty($table['table']['record'])) {
         return $table['table']['record'];
     }
     return false;
 }
开发者ID:,项目名称:,代码行数:13,代码来源:

示例12: extrainfo

 public function extrainfo()
 {
     global $db, $config, $usermodel;
     // 初始化資料庫連結介面
     $db = new mysql($config["db"]);
     $db->connect();
     $usermodel = new UserModel();
     $this->str = new convertString();
     $ret['status'] = 0;
     $query = "SELECT * \r\n\t\tFROM `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}user` \r\n\t\tWHERE \r\n\t\t\tprefixid = '{$config['default_prefix_id']}' \r\n\t\t\tAND userid = '{$_SESSION['auth_id']}' \r\n\t\t\tAND switch = 'Y' \r\n\t\t";
     $table = $db->getQueryRecord($query);
     if (empty($table['table']['record'])) {
         //'账号不存在'
         $ret['status'] = 2;
     }
     //error_log("uecid: ".$_POST['uecid']);
     //$uecArr = json_decode($_POST['uecArr'])
     //error_log('extrainfo: '.$_POST['uecArr']['field2name']);
     if (empty($ret['status'])) {
         $query_fieldname_set = '';
         //if (is_array($_POST['uecArr'])) {
         //foreach($_POST['uecArr'] as $key => $value) {
         foreach ($_POST['uecArr'] as $key => $value) {
             $query_fieldname_set .= ", `" . $key . "` = '" . $value . "'";
             //error_log("key: ".$key.", value: ".$value);
         }
         //}
         //error_log("query_fieldname_set: ".$query_fieldname_set);
         //刪除其他會員資訊
         $query = "delete from `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}user_extrainfo` \r\n\t\t\twhere \r\n\t\t\t\t`prefixid` = '{$config['default_prefix_id']}'\r\n\t\t\t\tAND `userid` = '{$_SESSION['auth_id']}'\r\n\t\t\t\tAND `uecid` = '{$_POST['uecid']}'\r\n\t\t\t";
         $db->query($query);
         //新增其他會員資訊
         $query = "INSERT INTO `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}user_extrainfo` \r\n\t\t\tSET \r\n\t\t\t\t`prefixid` = '{$config['default_prefix_id']}'\r\n\t\t\t\t, `userid` = '{$_SESSION['auth_id']}'\r\n\t\t\t\t, `uecid` = '{$_POST['uecid']}'\r\n\t\t\t\t{$query_fieldname_set}\r\n\t\t\t\t, `seq` = '0'\r\n\t\t\t\t, `switch` = 'Y'\r\n\t\t\t\t, `insertt` = NOW()\r\n\t\t\t";
         $db->query($query);
         //回傳:
         $ret['status'] = 200;
     }
     echo json_encode($ret);
 }
开发者ID:,项目名称:,代码行数:39,代码来源:

示例13: date

 if (!empty($doc->getElementsByTagName("notify")->item(0)->nodeValue)) {
     //商户订单号
     $out_trade_no = $doc->getElementsByTagName("out_trade_no")->item(0)->nodeValue;
     //支付宝交易号
     $trade_no = $doc->getElementsByTagName("trade_no")->item(0)->nodeValue;
     //交易状态
     $trade_status = $doc->getElementsByTagName("trade_status")->item(0)->nodeValue;
     // 交易金額
     $total_fee = $doc->getElementsByTagName("total_fee")->item(0)->nodeValue;
     $deposit_history_data = '{"out_trade_no":"' . $out_trade_no . '", "trade_no":"' . $trade_no . '","total_fee":' . $total_fee . ', "trade_status":"' . $trade_status . '", "timepaid":"' . date('YmdHis') . '", "paymenttype":"ALIPAY_WAP"}';
     $model = new mysql($config["db"][0]);
     $model->connect();
     $db_user = $config["db"][0]['dbname'];
     $db_cash_flow = $config["db"][1]['dbname'];
     $query = "select dh.* from `{$db_cash_flow}`.`{$config['default_prefix']}deposit_history` dh \r\n\t\t\tleft outer join `{$db_cash_flow}`.`{$config['default_prefix']}deposit` d on\r\n\t\t\t\td.prefixid = dh.prefixid \r\n\t\t\t\tand d.depositid = dh.depositid \r\n\t\t\t\tand d.userid = dh.userid \r\n\t\t\t\tand d.switch = 'N' \r\n\t\t\twhere dh.dhid = '{$out_trade_no}' \r\n\t\t\t\tand dh.status = 'order' \r\n\t\t\t\tand dh.data = ''";
     $deposit_history_array = $model->getQueryRecord($query);
     if (!empty($deposit_history_array['table']['record'][0]['dhid'])) {
         $userid = $deposit_history_array['table']['record'][0]['userid'];
         error_log("update deposit_history start");
         $query = "update `{$db_cash_flow}`.`{$config['default_prefix']}deposit_history` \r\n\t\t\tset \r\n\t\t\t\tstatus = 'deposit',\r\n\t\t\t\tdata = '{$deposit_history_data}', \r\n\t\t\t\tmodifyt = NOW() \r\n\t\t\twhere \r\n\t\t\t\tdhid = '{$out_trade_no}'\r\n\t\t\t\tand status = 'order' \r\n\t\t\t\tand data = ''";
         $model->query($query);
         error_log("update deposit_history end");
         error_log("update deposit start");
         $query = "update `{$db_cash_flow}`.`{$config['default_prefix']}deposit` \r\n\t\t\tSET \r\n\t\t\t\tswitch = 'Y',\r\n\t\t\t\tmodifyt = NOW()\r\n\t\t\twhere \r\n\t\t\t\tdepositid = '{$deposit_history_array['table']['record'][0]['depositid']}'\r\n\t\t\t\tand switch = 'N'\r\n\t\t\t";
         $model->query($query);
         error_log("update deposit end");
         error_log("update spoint start");
         $query = "update `{$db_cash_flow}`.`{$config['default_prefix']}spoint` \r\n\t\t\tSET  \r\n\t\t\t\tswitch = 'Y',\r\n\t\t\t\tmodifyt = NOW()\r\n\t\t\twhere \r\n\t\t\t\tspointid = '{$deposit_history_array['table']['record'][0]['spointid']}'\r\n\t\t\t\tand switch = 'N'\r\n\t\t\t";
         $model->query($query);
         error_log("update spoint end");
         error_log("update deposit_rule_item start");
开发者ID:,项目名称:,代码行数:31,代码来源:

示例14: act_osc

 public function act_osc()
 {
     global $db, $config;
     // 初始化資料庫連結介面
     $db = new mysql($config["db"]);
     $db->connect();
     $oscModel = new OscodeModel();
     $this->str = new convertString();
     $ret['status'] = 0;
     if (empty($_POST['scsn']) || empty($_POST['scpw'])) {
         //S码序号、S码密码不能空白
         $ret['status'] = 2;
     } else {
         $query = "SELECT * \r\n\t\t\tFROM `{$config['db'][1]['dbname']}`.`{$config['default_prefix']}oscode` \r\n\t\t\tWHERE \r\n\t\t\t\tprefixid = '{$config['default_prefix_id']}' \r\n\t\t\t\tAND serial = '{$_POST['scsn']}' \r\n\t\t\t\tAND switch = 'Y' \r\n\t\t\t";
         $table = $db->getQueryRecord($query);
         $scode_item = isset($table['table']['record'][0]) ? $table['table']['record'][0] : '';
         if (empty($scode_item)) {
             //'不存在'
             $ret['status'] = 3;
         } elseif ($_POST['scpw'] !== $scode_item['pwd']) {
             //'密码错误'
             $ret['status'] = 4;
         } elseif ($scode_item['verified'] == 'Y') {
             //已激活
             $ret['status'] = 5;
         }
     }
     if (empty($ret['status'])) {
         //限定S码激活
         $query = "UPDATE `{$config['db'][1]['dbname']}`.`{$config['default_prefix']}oscode` \r\n\t\t\tSET `verified`='Y', userid='{$_SESSION['auth_id']}'\r\n\t\t\tWHERE \r\n\t\t\t\t`prefixid` = '{$config['default_prefix_id']}'\r\n\t\t\t\tAND serial = '{$_POST['scsn']}'\r\n\t\t\t";
         $db->query($query);
         $query = "UPDATE `{$config['db'][1]['dbname']}`.`{$config['default_prefix']}scode_promote`\r\n\t\t\tSET\r\n\t\t\t   `scode_sum`=`scode_sum` + 1,\r\n\t\t\t   `amount`=`amount` + 1\r\n\t\t\tWHERE \r\n\t\t\t\t`prefixid` = '{$config['default_prefix_id']}' \r\n\t\t\t\tAND spid = '{$scode_item['spid']}' \r\n\t\t\t";
         $db->query($query);
         //回傳:
         $ret['status'] = 200;
     }
     echo json_encode($ret);
 }
开发者ID:,项目名称:,代码行数:38,代码来源:

示例15: get_info

 public function get_info($id, $email = null)
 {
     // global $db, $config;
     global $config;
     $db = new mysql($config["db2"]);
     $db->connect();
     $query = "SELECT * , up.bonus_noexpw\n\t\tFROM `{$config["db"][0]["dbname"]}`.`{$config['default_prefix']}user` u\n\t\tLEFT OUTER JOIN `{$config["db"][0]["dbname"]}`.`{$config['default_prefix']}user_profile` up ON \n\t\tu.prefixid = up.prefixid \n\t\tAND u.userid = up.userid\n\t\tAND up.`switch`='Y'\n\t\tWHERE \n\t\t\tu.prefixid = '{$config["default_prefix_id"]}' \n\t\t\tAND u.userid = '{$id}' \n\t\t\tAND u.switch = 'Y'\n\t\t\tAND up.userid IS NOT NULL \n\t\t";
     error_log("[member] " . $query);
     $table = $db->getQueryRecord($query);
     if (!empty($table['table']['record'])) {
         $results = $table['table']['record'][0];
         unset($results['passwd']);
         return $results;
     }
     return false;
 }
开发者ID:,项目名称:,代码行数:16,代码来源:


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