當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DB_test類代碼示例

本文整理匯總了PHP中DB_test的典型用法代碼示例。如果您正苦於以下問題:PHP DB_test類的具體用法?PHP DB_test怎麽用?PHP DB_test使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DB_test類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: validateUser

 public function validateUser()
 {
     $retcode = "200";
     $arr_message = array("result" => "fail", "message" => "操作出現異常,請稍後再試!");
     $db = new DB_test();
     $phonenumber = trim($this->arr_body['phonenumber']);
     $query = "SELECT fd_author_id FROM tb_author WHERE fd_author_username = '" . $phonenumber . "'";
     $authorid = $db->get_all($query);
     if ($authorid != 0 && count($authorid) > 0) {
         $authorid = $authorid[0]["fd_author_id"];
         $query = "SELECT Q.fd_question_contect  AS que, A.fd_answer AS answer \n\t\t\t\t\tFROM tb_safeguard_secque_useranswer AS A \n\t\t\t\t\tINNER JOIN tb_safeguard_secque AS Q ON A.fd_question_id = Q.fd_question_id \n\t\t\t\t\tWHERE A.fd_author_id = " . $authorid;
         $db->query($query);
         $retcode = "0";
         if ($db->nf() > 0) {
             $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
             $arr_msg['msgbody']['authorid'] = $authorid;
             $arr_message = array("result" => "success", "message" => "成功獲取密保問題");
         } else {
             $retcode = "200";
             $arr_message = array("result" => "failure", "message" => "您還未設置過密保問題");
         }
     } else {
         $retcode = "200";
         $arr_message = array("result" => "failure", "message" => "該手機號還未注冊過通付寶賬號");
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:31,代碼來源:ApiSafeGuard.php

示例2: readKuaiDicmpList

 public function readKuaiDicmpList()
 {
     $db = new DB_test();
     $arr_header = $this->arr_header;
     $arr_body = $this->arr_body;
     $arr_channelinfo = $this->arr_channelinfo;
     $apptype = trim($arr_body['apptype']);
     $appversion = trim($arr_body['appversion']);
     $query = "select fd_kdcompany_id as comid,fd_kdcompany_no as com,fd_kdcompany_name as comname\n\t\t         ,fd_kdcompany_api as apitype,fd_kdcompany_pic as comlogo ,fd_kdcompany_phone as comphone from \n\t             tb_kdcompany where fd_kdcompany_active = '1' order by fd_kdcompany_api desc";
     //隻顯示激活的列表
     $db->query($query);
     $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
     if (!$arr_msg) {
         $arr_message = array("result" => "failure", "message" => "列表為空!");
         $retcode = "200";
         //反饋狀態 0 成功 200 自定義錯誤
     } else {
         $arr_message = array("result" => "success", "message" => "讀取成功!");
         $retcode = "0";
         //反饋狀態 0 成功 200 自定義錯誤
     }
     $arr_msg['msgbody']['result'] = $arr_message['result'];
     $arr_msg['msgbody']['message'] = $arr_message['message'];
     $returnvalue = array("msgbody" => $arr_msg['msgbody']);
     $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue);
     return $returnval;
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:27,代碼來源:ApiKuaiDiinfo.php

示例3: checkstorage

function checkstorage($batches, $commid, $endquantity, $cost, $listid, $listno, $listtype, $memo)
{
    $db = new DB_test();
    $query = "select fd_sect_cost from tb_storagecost where fd_sect_commid = '{$commid}'  ";
    $db->query($query);
    //查出機構的平均價格
    if ($db->nf()) {
        $db->next_record();
        $oldcost = $db->f(fd_sect_cost);
        //平均價格
    }
    $query = "select sum(fd_skqy_quantity) as allquantity from tb_paycardstockquantity \n\t          where fd_skqy_commid = '{$commid}' ";
    $db->query($query);
    //計算該機構或者配送中心的庫存數量。
    if ($db->nf()) {
        $db->next_record();
        $oldquantity = $db->f(allquantity);
        $newquantity = $oldquantity + $endquantity;
        if ($newquantity == 0) {
            $newmoney = $oldcost * $oldquantity + $cost * $endquantity;
        } else {
            $newmoney = 0;
        }
    } else {
        $newmoney = 0;
    }
    if ($newmoney != 0) {
        $formermoney = $oldcost * $oldquantity;
        $aftermoney = $cost * $endquantity;
        $query = "insert into tb_intocompensatory (\n  \t          fd_iocy_date       ,  fd_iocy_listid          ,  fd_iocy_listtype       , \n  \t          fd_iocy_paycardid     ,  fd_iocy_formermoney     ,  fd_iocy_aftermoney     , \n  \t          fd_iocy_memo       ,  fd_iocy_formercost      ,  fd_iocy_aftercost      ,\n  \t          fd_iocy_listno     ,  fd_iocy_formerquantity  ,  fd_iocy_afterquantity   \n  \t          )values(\n  \t          now()            ,  '{$listid}'           ,  '{$listtype}'        ,\n  \t          '{$paycardid}'        ,  '{$formermoney}'      ,  '{$aftermoney}'      ,\n  \t          '{$memo}'          ,  '{$oldcost}'          ,  '{$cost}'            ,\n  \t          '{$listno}'        ,  '{$oldquantity}'      ,  '{$endquantity}'     \n\t\t\t\n  \t          )";
        $db->query($query);
    }
    return $newmoney;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:34,代碼來源:checkstorage.php

示例4: addelete

function addelete($dateid, $scatid, $display)
{
    $db = new DB_test();
    if ($display == 1) {
        $query = "update tb_category_list set fd_cat_display='0' where fd_cat_scatid='{$scatid}' \n\t\t\t\t and fd_cat_dateid ='{$dateid}' ";
        $db->query($query);
    }
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:8,代碼來源:ProductAction.php

示例5: clearFilepath

function clearFilepath($id)
{
    $db = new DB_test();
    $query = "update tb_ggwgl set  fd_ggwgl_url='',fd_ggwgl_thumurl='' where fd_ggwgl_id='{$id}'";
    $db->query($query);
    $returnvalue = "success";
    return $returnvalue;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:8,代碼來源:AutoClearFilepath.php

示例6: getimageid

function getimageid($picurl)
{
    $db = new DB_test();
    $query = "select fd_cat_id from tb_category_list where  fd_cat_url ='{$picurl}'";
    $db->query($query);
    if ($db->nf()) {
        $db->next_record();
        $id = $db->f(fd_cat_id);
    }
    return $id;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:11,代碼來源:Getimageid.php

示例7: dodelete

 function dodelete()
 {
     //  刪除過程
     $db = new DB_test();
     for ($i = 0; $i < count($this->browse_check); $i++) {
         $query = "update  tb_paycard set fd_paycard_authorid='' where fd_paycard_authorid=" . $this->browse_check[$i] . "";
         $db->query($query);
         $query = sprintf($this->browse_delsql, $this->browse_check[$i]);
         $this->db->query($query);
         //刪除點擊的記錄
     }
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:12,代碼來源:tb_author_sp_b.php

示例8: checkagpmbkntno

 public static function checkagpmbkntno($bkntno)
 {
     $db = new DB_test();
     $query = "select fd_agpm_bkntno as bkntno  from tb_agentpaymoneylist where fd_agpm_bkntno = '{$bkntno}'";
     //$query="select fd_agpm_bkntno as bkntno  from tb_agentpaymoneylist where fd_agpm_bkntno = '201308212125170033372'";
     $db->query($query);
     if ($db->nf()) {
         return "1";
     } else {
         return "0";
     }
     //return $db->execute($query); // 0 1
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:13,代碼來源:test.php

示例9: changemoney

function changemoney($unittype, $clientid, $money, $type)
{
    //$type =0表示應收 , 1表示應付
    //$unittype = 2 表示供應商,1代表客戶
    //$clientid 往來單位id號
    $db = new DB_test();
    if ($type == 0) {
        $endmoney = $money;
    } else {
        $endmoney = -$money;
    }
    $query = "select * from tb_ysyfmoney where fd_ysyfm_type = '{$unittype}'\n\t          and fd_ysyfm_companyid = '{$clientid}' ";
    $db->query($query);
    if ($db->nf()) {
        $db->next_record();
        $oldmoney = $db->f(fd_ysyfm_money);
        $listid = $db->f(fd_ysyfm_id);
        $newmoney = $oldmoney + $endmoney;
        $query = "update tb_ysyfmoney set fd_ysyfm_money = '{$newmoney}'\n\t\t         where fd_ysyfm_id = '{$listid}' ";
        $db->query($query);
    } else {
        $query = "insert into tb_ysyfmoney(\n\t            fd_ysyfm_type     , fd_ysyfm_companyid , fd_ysyfm_money       \n\t            )values(\n\t            '{$unittype}'   , '{$clientid}'        , '{$endmoney}'    \n\t            )";
        $db->query($query);
    }
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:25,代碼來源:changemoney.php

示例10: getpaymerinfo

 private static function getpaymerinfo($authorid)
 {
     $db = new DB_test();
     $ErrorReponse = new ErrorReponse();
     $query = "select fd_sdcr_merid as merid,fd_sdcr_securitykey as securitykey,fd_sdcr_id as sdcrid," . "fd_sdcr_payfee as \t\t  sdcrpayfee,fd_sdcr_tradeurl as tradeurl,fd_sdcr_queryurl as queryurl," . "fd_sdcr_minpayfee as minsdcrpayfee," . "fd_sdcr_agentfee as sdcragentfee from tb_author join tb_sendcenter " . "on fd_sdcr_id = fd_author_sdcrid where fd_author_id = '{$authorid}'";
     if ($db->execute($query)) {
         $arr_merinfo = $db->get_one($query);
         return $arr_merinfo;
     } else {
         $Error = array('rettype' => '100', 'retcode' => '100', 'retmsg' => '商戶未審核,不允許操作該功能。');
         $ErrorReponse->reponError($Error);
         exit;
     }
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:14,代碼來源:BankPayInfoV2.php

示例11: getappname

function getappname($appmnuid)
{
    $db = new DB_test();
    if (!$appmnuid) {
        $appmnuid = 0;
    }
    $query = "select fd_appmnu_name from tb_appmenu where fd_appmnu_id in({$appmnuid})";
    $db->query($query);
    if ($db->nf()) {
        while ($db->next_record()) {
            $appname .= $db->f('fd_appmnu_name') . "&nbsp;&nbsp;";
        }
    }
    return $appname;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:15,代碼來源:tb_authortype_b.php

示例12: Feedback

 public static function Feedback($result, $orderId)
 {
     $logger = Logger::getLogger("ofpay");
     $logger->info("開始分析手機充值返回的結果,訂單號({$orderId})");
     // if(isset($result->retcode) && $result->retcode == 1 && isset($result->game_state) && $result->game_state == 1)
     if (isset($result->retcode) && $result->retcode == 1) {
         $logger->info("正在分析手機充值返回的結果 : 通付寶訂單號({$orderId}) 充值成功");
         $db = new DB_test();
         $query = "UPDATE tb_mobilerechargelist SET fd_mrclist_payrq = '00', fd_mrclist_ofstate = 1 \n\t\t\t\t\tWHERE fd_mrclist_bkordernumber = '" . $orderId . "'";
         $logger->debug("完成手機充值 : 回寫狀態進通付寶數據庫({$query})");
         $db->query($query);
     } else {
         $logger->error("完成手機充值 : 充值失敗");
     }
 }
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:15,代碼來源:ofpayV3.class.php

示例13: move

function move($fd_cat_id)
{
    $db = new DB_test();
    $query = "select fd_cat_dateid,fd_cat_name,fd_cat_scatid,fd_cat_url,fd_cat_thumurl ,fd_cat_cancel from tb_upload_category_list  where fd_cat_id='{$fd_cat_id}'";
    $db->query($query);
    $db->next_record();
    $fd_cat_dateid = $db->f(fd_cat_dateid);
    $fd_cat_scatid = $db->f(fd_cat_scatid);
    $fd_cat_name = $db->f(fd_cat_name);
    $fd_cat_url = $db->f(fd_cat_url);
    $fd_cat_thumurl = $db->f(fd_cat_thumurl);
    $fd_cat_cancel = $db->f(fd_cat_cancel);
    $query = "INSERT INTO tb_upload_old_image (\n\t\t\t\t\t\tfd_cat_dateid  ,fd_cat_scatid , fd_cat_url,\n\t\t\t\t\t\tfd_cat_cancel ,fd_cat_time,  fd_cat_thumurl,\n\t\t\t\t\t\tfd_cat_name\n\t\t\t\t\t   )VALUES (\n\t\t\t\t\t   '{$fd_cat_dateid}'     ,'{$fd_cat_scatid}'   , '{$fd_cat_url}',\n\t\t\t\t\t   '{$fd_cat_cancel}'     ,now()              , '{$fd_cat_thumurl}',\n\t\t\t\t\t   '{$fd_cat_name}'\n\t\t\t\t\t   )";
    $db->query($query);
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:15,代碼來源:UploadAction.php

示例14: getauqrzname

function getauqrzname($auqid)
{
    $db = new DB_test();
    if (!$auqid) {
        $auqid = 0;
    }
    $query = "select fd_auq_name from tb_authorquali where fd_auq_id in({$auqid})";
    $db->query($query);
    if ($db->nf()) {
        while ($db->next_record()) {
            $auqname .= $db->f('fd_auq_name') . "&nbsp;&nbsp;";
        }
    }
    return $auqname;
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:15,代碼來源:tb_authorqualirzset_b.php

示例15: paycardnum

function paycardnum($salerid)
{
    $db = new DB_test();
    $query = "select * from tb_paycard where fd_paycard_salerid='{$sharesalerid}'";
    $db->query($query);
    return $db->nf();
}
開發者ID:Xiaoyuyexi,項目名稱:client-server,代碼行數:7,代碼來源:readsalerlist.php


注:本文中的DB_test類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。