本文整理汇总了PHP中DB_test::query方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_test::query方法的具体用法?PHP DB_test::query怎么用?PHP DB_test::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_test
的用法示例。
在下文中一共展示了DB_test::query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3: readHelpList
public function readHelpList()
{
$db = new DB_test();
$arr_header = $this->arr_header;
$arr_body = $this->arr_body;
$arr_channelinfo = $this->arr_channelinfo;
$msgstart = $arr_body['msgstart'] + 0;
$msgdisplay = $arr_body['msgdisplay'] + 0;
if ($msgstart < 0) {
$msgstart = 0;
}
$query = "select 1 from web_help order by fd_help_no ";
$db->query($query);
$msgallcount = $db->nf();
$query = "select fd_help_id as helpid ,fd_help_name as helpname,fd_help_contect as helpcontent,\n\t fd_help_date as helpdate from web_help order by fd_help_no limit {$msgstart}, {$msgdisplay} ";
$db->query($query);
$msgdiscount = $db->nf();
$arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8');
$arr_message = array("result" => "success", "message" => "读取成功!");
$retcode = "0";
//反馈状态 0 成功 200 自定义错误
$arr_msg['msgbody']['msgallcount'] = $msgallcount;
$arr_msg['msgbody']['msgdiscount'] = $msgdiscount + $msgstart;
$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;
}
示例4: getmemkpFilepath
function getmemkpFilepath($fcatid)
{
$db = new DB_test();
$query = "select * from tb_scategoty where fd_scat_fcatid='{$fcatid}'";
$db->query($query);
if ($db->nf()) {
while ($db->next_record()) {
//没有上传显示空白
$arr_scatid[] = $db->f(fd_scat_id);
$arr_fcatid[] = $db->f(fd_scat_fcatid);
}
}
for ($i = 0; $i < count($arr_scatid); $i++) {
$query = "select * from tb_category_list where fd_cat_scatid='{$arr_scatid[$i]}'";
$db->query($query);
if ($db->nf()) {
while ($db->next_record()) {
$catid = $db->f(fd_cat_id);
$filename = $db->f(fd_cat_name);
$picname = $db->f(fd_cat_url);
$thumrul = $db->f(fd_cat_thumurl);
$display = $db->f(fd_cat_display);
$arr_list[] = array("vid" => $catid, "scatid" => $arr_scatid[$i], "filename" => $filename, "picname" => $picname, "picurl" => $thumrul, "display" => $display);
}
} else {
$arr_list[] = array("vid" => "", "scatid" => $arr_scatid[$i], "filename" => "", "picname" => "", "picurl" => "", "display" => "");
}
}
$returnarray = $arr_list;
return $returnarray;
}
示例5: basicnumber_update
function basicnumber_update($listtype)
{
$db = new DB_test();
$query = "select * from tb_basicnumber where fd_bcnr_typeid = '{$listtype}'";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$tmp_basicnumber = $db->f(fd_bcnr_design);
$ltctcount = $db->f(fd_bcnr_count) + 1;
$query = "update tb_basicnumber set\n\t fd_bcnr_count = fd_bcnr_count+1\n\t where fd_bcnr_typeid = '{$listtype}' ";
$db->query($query);
if ($ltctcount < 10) {
$endltctcount = "000" . $ltctcount;
} elseif ($ltctcount < 10000 and $ltctcount >= 1000) {
$endltctcount = $ltctcount;
} elseif ($ltctcount < 1000 and $ltctcount >= 100) {
$endltctcount = "0" . $ltctcount;
} elseif ($ltctcount < 100 and $ltctcount >= 10) {
$endltctcount = "00" . $ltctcount;
} else {
$endltctcount = $ltctcount;
}
$listno = str_replace("{list_number}", $endltctcount, $tmp_basicnumber);
}
return $listno;
}
示例6: order_creat_fplist
function order_creat_fplist($listid)
{
$db = new DB_test();
$db2 = new DB_test();
$dberp = new DB_erp2();
//读取发票申请
$query = "select * from web_invoicesq \n\t left join tb_organmem on fd_organmem_id = fd_ivcsq_memberid\n\t where fd_ivcsq_id = '{$listid}'";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$iecrid = $db->f(fd_ivcsq_fpcusid);
$iecrno = $db->f(fd_ivcsq_fpcusno);
$iecrname = $db->f(fd_ivcsq_fpcusname);
$orderid = $db->f(fd_ivcsq_orderid);
$fptype = $db->f(fd_ivcsq_fptype);
$money = $db->f(fd_ivcsq_money);
$memo = $db->f(fd_ivcsq_memo);
$fpusename = $db->f(fd_organmem_comnpany);
$fpuseid = $db->f(fd_ivcsq_memberid);
if ($invoicetype == "普通发票") {
$invoicetype = 1;
} else {
$invoicetype = 0;
}
$s_orderid = implode(",", explode("@@@", $orderid));
$query = "select * from web_order \n where fd_order_id in ({$s_orderid}) ";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$sdcrid = $db->f(fd_order_sdcrid);
if ($sdcrid == 1) {
$mscompanyid = 1;
//广州市明盛物流有限公司
} else {
if ($sdcrid == 2) {
$mscompanyid = 4;
//上海粤琳珠物流有限公司
} else {
if ($sdcrid == 3) {
$mscompanyid = 13;
//廊坊市明盛纸业有限公司
} else {
if ($sdcrid == 4) {
$mscompanyid = 9;
} else {
if ($sdcrid == 5) {
$mscompanyid = 11;
}
}
}
}
}
}
$issue = date("Y", mktime()) . date("m", mktime());
$listno = listnumber_update();
$query = "insert into tb_invoiceapply(\n\t fd_ieay_listno , fd_ieay_iecrid , fd_ieay_iecrno ,\n\t fd_ieay_iecrname , fd_ieay_sporganid , fd_ieay_date , \n\t fd_ieay_mscompanyid , fd_ieay_issue , fd_ieay_staname ,\n\t fd_ieay_invoicetype , fd_ieay_sdcrid , fd_ieay_cporganid , \n\t fd_ieay_xjmoney , fd_ieay_yhmoney , fd_ieay_spsdcrid ,\n\t fd_ieay_memo , fd_ieay_dziecrid , fd_ieay_sqinvoicetype ,\n\t fd_ieay_sqmscid , fd_ieay_sqyhmoney , fd_ieay_sqxjmoney ,\n\t fd_ieay_websqid , fd_ieay_fpuseid , fd_ieay_fpusename\n\t )values(\n\t '{$listno}' , '{$iecrid}' , '{$iecrno}' ,\n\t '{$iecrname}' , '1' , now() ,\n\t '{$mscompanyid}' , '{$issue}' , '网站' ,\n\t '{$invoicetype}' , '{$sdcrid}' , '1' , \n\t '0' , '{$money}' , '{$sdcrid}' ,\n\t '{$memo}' , '{$iecrid}' , '{$invoicetype}' ,\n\t '{$mscompanyid}' , '0' , '{$money}' ,\n\t '{$listid}' , '{$fpuseid}' , '{$fpusename}'\n\t )";
$dberp->query($query);
}
}
示例7: listnumber_update
function listnumber_update($listtype)
{
//global $loginorganno ;
$db = new DB_test();
$query = "select * from tb_listnumber where fd_ltnr_typeid = '{$listtype}'";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$tmp_listnumber = $db->f(fd_ltnr_design);
$isdateauto = $db->f(fd_ltnr_isdateauto);
//是否自动生成
$datetype = $db->f(fd_ltnr_datetype);
//日期格式
$year = date("Y", mktime());
$month = date("m", mktime());
$day = date("d", mktime());
if ($isdateauto == 1) {
$sqlwhere = " and fd_ltct_date = '{$year}-{$month}-{$day}' ";
} else {
$sqlwhere = " ";
}
$ltctcount = 1;
$query = "select * from tb_listcount where fd_ltct_ltnrtypeid = '{$listtype}' {$sqlwhere} ";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$ltctcount = $db->f(fd_ltct_count) + 1;
$ltctid = $db->f(fd_ltct_id);
$query = "update tb_listcount set\n\t fd_ltct_count = fd_ltct_count+1\n\t where fd_ltct_id = '{$ltctid}' ";
$db->query($query);
} else {
$query = "insert into tb_listcount(\n\t fd_ltct_count , fd_ltct_date , fd_ltct_ltnrtypeid\n\t )values(\n\t 1 , now() , '{$listtype}'\n\t )";
$db->query($query);
}
if ($ltctcount < 10) {
$endltctcount = "00" . $ltctcount;
} elseif ($ltctcount < 100 and $ltctcount >= 10) {
$endltctcount = "0" . $ltctcount;
} else {
$endltctcount = $ltctcount;
}
if ($datetype == 1) {
//全年份得日期格式
$tmp_listnumber = str_replace("{listno_date}", $year . $month . $day, $tmp_listnumber);
} else {
$endyear = substr($year, 2, 2);
$tmp_listnumber = str_replace("{listno_date}", $endyear . $month . $day, $tmp_listnumber);
}
$listno = str_replace("{list_number}", $endltctcount, $tmp_listnumber);
}
return $listno;
}
示例8: 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);
}
示例9: 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;
}
示例10: 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;
}
示例11: 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);
}
}
示例12: kickbackaccountcussent
function kickbackaccountcussent($accountid, $supaccountid, $allmoney, $listtype, $makename, $listid, $listno, $listdate, $memo, $kickbackid)
{
$db = new DB_test();
$ishaverecord = 0;
$query = "select * from tb_accountcussent where fd_atct_accountid = '{$accountid}' and fd_atct_supaccountid = '{$supaccountid}'\n\t and fd_atct_listid = '{$kickbackid}' and fd_atct_listtype = '{$listtype}' ";
$db->query($query);
if ($db->nf()) {
$ishaverecord = 1;
}
if ($allmoney != 0 && $ishaverecord == 0) {
$query = "insert into tb_accountcussent(\n fd_atct_listid , fd_atct_listno , fd_atct_listtype , \n fd_atct_listdate , fd_atct_accountid , fd_atct_supaccountid ,\n fd_atct_date , fd_atct_money , fd_atct_makename ,\n fd_atct_memo , fd_atct_datetime , fd_atct_iskickback\n )values(\n '{$kickbackid}' , '{$listno}' , '{$listtype}' ,\n '{$listdate}' , '{$accountid}' , '{$supaccountid}' ,\n now() , '{$allmoney}' , '{$makename}' ,\n '{$memo}' , now() , '2'\n )";
$db->query($query);
$query = "update tb_accountcussent set fd_atct_iskickback = 1 \n where fd_atct_listtype = '{$listtype}' and fd_atct_listid = '{$listid}' \n and fd_atct_accountid = '{$accountid}'";
$db->query($query);
//修改该单据的反冲状态
}
}
示例13: 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;
}
示例14: kickbackcashglide
function kickbackcashglide($accountid, $allmoney, $chgememo, $chgelisttype, $loginstaname, $listid, $listno, $cogetype, $kickbackid, $listdate)
{
$db = new DB_test();
$ishaverecord = 0;
$query = "select * from tb_cashglide where fd_chge_accountid = '{$accountid}' \n\t and fd_chge_listid = '{$kickbackid}' and fd_chge_listtype = '{$chgelisttype}' ";
$db->query($query);
if ($db->nf()) {
$ishaverecord = 1;
}
if ($allmoney != 0 && $ishaverecord == 0) {
//----------帐户流水帐----------------
$query = "SELECT MAX(fd_chge_id) as chge_id FROM tb_cashglide where \n fd_chge_accountid = '{$accountid}' ";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$maxchgeid = $db->f(chge_id);
$query = "select fd_chge_balance from tb_cashglide \n where fd_chge_id = '{$maxchgeid}' ";
$db->query($query);
if ($db->nf()) {
$db->next_record();
$chgebalance = $db->f(fd_chge_balance);
} else {
$chgebalance = 0;
}
} else {
$chgebalance = 0;
}
if ($allmoney != 0) {
//金额不等于0 的才插进去。
if ($cogetype == 0) {
$endchgebalance = $chgebalance + $allmoney;
$query = "insert into tb_cashglide(\n fd_chge_date , fd_chge_accountid , fd_chge_listid , \n fd_chge_listno , fd_chge_listtype , fd_chge_addmoney ,\n fd_chge_lessen , fd_chge_balance , fd_chge_memo ,\n fd_chge_makename, fd_chge_datetime , fd_chge_iskickback ,\n fd_chge_listdate\n )values(\n now() , '{$accountid}' , '{$kickbackid}' ,\n '{$listno}' , '{$chgelisttype}' , '{$allmoney}' ,\n '0' , '{$endchgebalance}' , '{$chgememo}' ,\n '{$loginstaname}', now() , '2' ,\n '{$listdate}'\n )";
$db->query($query);
} else {
$endchgebalance = $chgebalance - $allmoney;
$query = "insert into tb_cashglide(\n fd_chge_date , fd_chge_accountid , fd_chge_listid , \n fd_chge_listno , fd_chge_listtype , fd_chge_addmoney ,\n fd_chge_lessen , fd_chge_balance , fd_chge_memo ,\n fd_chge_makename, fd_chge_datetime , fd_chge_iskickback ,\n fd_chge_listdate\n )values(\n now() , '{$accountid}' , '{$kickbackid}' ,\n '{$listno}' , '{$chgelisttype}' , '0' ,\n '{$allmoney}' , '{$endchgebalance}' , '{$chgememo}' ,\n '{$loginstaname}', now() , '2' ,\n '{$listdate}'\n )";
$db->query($query);
}
$query = "update tb_cashglide set fd_chge_iskickback = 1 \n where fd_chge_listtype = '{$chgelisttype}' and fd_chge_listid = '{$listid}' \n and fd_chge_accountid = '{$accountid}'";
$db->query($query);
//修改该单据的反冲状态
}
}
//------------------------------------
}
示例15: kickbackcurrentaccount
function kickbackcurrentaccount($ctatlinktype, $companyid, $addmoney, $lessenmoney, $ctatmemo, $cactlisttype, $loginstaname, $listid, $listno, $kickbackid, $listdate)
{
$db = new DB_test();
$ishaverecord = 0;
$query = "select * from tb_currentaccount where fd_ctat_linkid = '{$companyid}' and fd_ctat_linktype = '{$ctatlinktype}'\n\t and fd_ctat_listid = '{$kickbackid}' and fd_ctat_listtype = '{$cactlisttype}' ";
$db->query($query);
if ($db->nf()) {
$ishaverecord = 1;
}
if ($ishaverecord == 0) {
$endctatbalance = 0;
$query = "insert into tb_currentaccount(\n fd_ctat_date , fd_ctat_linktype , fd_ctat_linkid , \n fd_ctat_listno , fd_ctat_listtype , fd_ctat_addmoney ,\n fd_ctat_lessen , fd_ctat_balance , fd_ctat_memo ,\n fd_ctat_listid , fd_ctat_makename , fd_ctat_iskickback ,\n fd_ctat_datetime , fd_ctat_listdate\n )values(\n now() , '{$ctatlinktype}' , '{$companyid}' ,\n '{$listno}' , '{$cactlisttype}' , '{$addmoney}' ,\n '{$lessenmoney}' , '{$endctatbalance}' , '{$ctatmemo}' ,\n '{$kickbackid}' , '{$loginstaname}' , '2' ,\n now() , '{$listdate}'\n )";
$db->query($query);
$query = "update tb_currentaccount set fd_ctat_iskickback = 1 \n where fd_ctat_listtype = '{$cactlisttype}' and fd_ctat_listid = '{$listid}' ";
$db->query($query);
//修改该单据的反冲状态
//------------------------------------
}
}