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 = '******'"; $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; }
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; }
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; }
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); } }
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; }
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; }
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); //删除点击的记录 } }
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 }
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); } }
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; } }
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') . " "; } } return $appname; }
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("完成手机充值 : 充值失败"); } }
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); }
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') . " "; } } return $auqname; }
function paycardnum($salerid) { $db = new DB_test(); $query = "select * from tb_paycard where fd_paycard_salerid='{$sharesalerid}'"; $db->query($query); return $db->nf(); }
function getsalepaycardbackstate() { $db = new DB_test(); $query = "select fd_selt_state as state,fd_stdetail_paycardid as paycardid,fd_selt_date as date,fd_stdetail_memo as memo from tb_salelistbackdetail\n\tleft join tb_salelistback on fd_selt_id=fd_stdetail_seltid"; $db->query($query); $arr_data = $db->getFiledData(); foreach ($arr_data as $value) { $arr_pacardid = explode(",", $value['paycardid']); foreach ($arr_pacardid as $v1) { $arr_state[$v1]['state'] = $value['state']; $arr_state[$v1]['date'] = $value['date']; $arr_state[$v1]['memo'] = $value['memo']; } } return $arr_state; }
function readsalebackdunshu($year, $month, $memid) { $db = new DB_test(); $dberp = new DB_erp2(); $query = "select * from tb_organmem where fd_organmem_id = '{$memid}'"; $db->query($query); $db->next_record(); $cusid = $db->f(fd_organmem_cusid); $month = $month + 0; $year = $year + 0; $query = "select \n sum(fd_sebk_alldunshu) as allquantity,\n fd_sebk_cusid\n from tb_saleback \n left join tb_salelist on fd_sebk_salelistid = fd_selt_id\n where year(fd_selt_date) = '{$year}' and month(fd_sebk_date) = '{$month}' and fd_sebk_state = 1\n and fd_sebk_iskickback = 0 and fd_sebk_organid = 1 and fd_sebk_cusid = '{$cusid}'\n group by fd_sebk_cusid\n "; $dberp->query($query); $dberp->next_record(); $dunshu = $dberp->f(allquantity); return $dunshu; }
function makeorderno($tablename, $fieldname, $preno = "pay") { $db = new DB_test(); $db2 = new DB_test(); $year = trim(date("Y", mktime())); $month = trim(date("m", mktime())); $day = trim(date("d", mktime())); $strlenght = strlen($preno); $nowdate = $year . $month . $day; $query = "select fd_" . $fieldname . "_no as no from " . $tablename . " order by fd_" . $fieldname . "_no desc"; $db2->query($query); if ($db2->nf()) { $db2->next_record(); $orderno = $db2->f(no); $orderdate = substr($orderno, $strlenght, 8); //截取前8位判断是否当前日期 if ($nowdate == $orderdate) { $newlenght = $strlenght + 11; $orderno = substr($orderno, $newlenght, 14) + 1; //是当前日期流水帐加1 if ($orderno < 10) { $orderno = "00000" . $orderno; } else { if ($orderno < 100) { $orderno = "0000" . $orderno; } else { if ($orderno < 1000) { $orderno = "000" . $orderno; } else { if ($orderno < 10000) { $orderno = "00" . $orderno; } else { $orderno = $orderno; } } } } $orderno = $preno . $nowdate . $orderno; } else { $orderno = $preno . $nowdate . "000001"; //不是当前日期,为5位流水帐,开始值为1。 } } else { $orderno = $preno . $nowdate . "000001"; } return $orderno; }
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); //修改该单据的反冲状态 } }
function authorReg() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $aumobile = trim($arr_body['aumobile']); $aupassword = trim(md5($arr_body['aupassword'])); $autruename = u2g(trim($arr_body['autruename'])); $auidcard = trim($arr_body['auidcard']); $auemail = trim($arr_body['auemail']); $query = "select 1 from tb_author where fd_author_username = '******'"; $db->query($query); if ($db->nf()) { $arr_message = array("result" => "failure", "message" => "该手机号码已注册"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 $havemobile = 1; } else { $havemobile = 0; } if ($havemobile != 1) { $query = "insert into tb_author (fd_author_password ,fd_author_mobile ,fd_author_truename,\n\t\t\t\t\t\t\t fd_author_idcard,fd_author_email ,fd_author_username,fd_author_regtime,fd_author_datetime \n\t\t\t\t\t\t\t )values( '{$aupassword}' ,'{$aumobile}','{$autruename}','{$auidcard}','{$auemail}','{$aumobile}',now(),now())"; $db->query($query); $listid = $db->insert_id(); $sdcrid = 3; $auindustryid = 4; $slotpayfsetid = 8; $slotscdmsetid = 14; $bkcardpayfsetid = 25; $bkcardscdmsetid = 9; $memid = 3554; $shopid = 102; $authortypeid = 5; $query = "update tb_author set \n\t\t\t\t\t fd_author_isstop='0'," . "fd_author_state = '9'," . "fd_author_sdcrid = '{$sdcrid}'," . "fd_author_auindustryid = '{$auindustryid}',\n\t\t fd_author_slotpayfsetid = '{$slotpayfsetid}',\n\t\t fd_author_slotscdmsetid = '{$slotscdmsetid}',\n\t\t\t\t\t fd_author_bkcardpayfsetid='{$bkcardpayfsetid}',\n\t\t\t\t\t fd_author_bkcardscdmsetid='{$bkcardscdmsetid}' ,\n\t\t\t\t\t fd_author_couponstate = 0 ," . "fd_author_memid = '{$memid}'," . "fd_author_shopid = '{$shopid}'," . "fd_author_authortypeid = '{$authortypeid}' \n\t\t\t\t\t \t\t\t\t\t\t\n\t\t\t\t\t where fd_author_id='{$listid}'"; $db->query($query); $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; }
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; }
function autologin($username, $password) { $db = new DB_test(); $db1 = new DB_test(); $query = "select * from web_teller where fd_tel_name ='{$username}' "; $db->query($query); if ($db->nf()) { $db->next_record(); $pass = $db->f(fd_tel_pass); //密码 $error = $db->f(fd_tel_error); //错误次数 $recsts = $db->f(fd_tel_recsts); //是否已经被禁此 $isin = $db->f(fd_tel_isin); //是否已经登陆 $telid = $db->f(fd_tel_id); //id号 if ($pass != $password) { $errmsg = "密码错误!(请注意区分大小写)"; $query = "update web_teller set fd_tel_error = fd_tel_error +1 where fd_tel_name ='{$username}'"; $db1->query($query); $return = 2; } if ($error >= 6) { $errmsg = "由于密码错误多次,禁止使用该用户!"; $return = 3; } if ($recsts == 1) { $errmsg = "该用户被停用!"; $return = 4; } if ($pass == $password and $return < 2) { // 密码正确 $query = "update web_teller set \t\t\t \n\t \t\t fd_tel_lasttime = fd_tel_intime, fd_tel_intime = now(),fd_tel_outtime = now(),\n\t \t\t fd_tel_error = 0,fd_tel_isin = 1 , fd_tel_onlinetime = now()\n\t where fd_tel_id ='{$telid}'"; $db->query($query); $return = 1; } } else { $errmsg = "该用户不存在!"; $return = 9; } return $return; }
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); //修改该单据的反冲状态 //------------------------------------ } }
function getshowpaycradid($tabname, $filename, $id) { $db = new DB_test(); $query = 'select fd_' . $filename . '_paycardid as paycardid from ' . $tabname . ' where fd_' . $filename . '_id="' . $id . '" '; $db->query($query); if ($db->nf()) { $db->next_record(); $paycardid = $db->f(paycardid); $arr_paycardid1 = explode(",", $paycardid); foreach ($arr_paycardid1 as $va) { if ($strpaycardid) { $strpaycardid .= "," . "'{$va}'"; } else { $strpaycardid = "'{$va}'"; } } } return $strpaycardid; }
public function RelateAgent($authorId, $agentCode) { $logger = Logger::getLogger('AuthorInfo'); $logger->info("开始绑定代理商 : authorId : $authorId, agentCode : $agentCode"); $db = new DB_test(); $query = "SELECT fd_cus_id FROM tb_customer WHERE fd_cus_no = '$agentCode'"; $logger->debug("开始绑定代理商 : query : $query"); $agentId = $db->get_all($query); if(!is_array($agentId) || count($agentId) != 1) { $logger->debug("开始绑定代理商 : return 0"); return 0; } else { $query = "UPDATE tb_author SET fd_author_bdagentno = '$agentCode', fd_author_bdagentid = " . $agentId[0]["fd_cus_id"] . ", fd_author_bdagenttime = NOW() WHERE fd_author_id = $authorId"; $logger->debug("开始绑定代理商 : query : $query"); $db->query($query); return 1; } }
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; }
public function readAccglistdetail() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $acctypeid = trim($arr_body['acctypeid']); $authorid = trim($arr_channelinfo['authorid']); $msgstart = trim($arr_body['msgstart']) + 0; $msgdisplay = trim($arr_body['msgdisplay']) + 0; //echo var_dump($arr_body); $accyear = substr(trim($arr_body['accmonth']), 0, 4); $accmonth = str_replace($accyear, "", $arr_body['accmonth']); if ($acctypeid == 'coupon') { $wherequery1 = " and 1=2"; } if ($acctypeid == 'recharge') { $wherequery2 = " and 1=2"; } if ($msgdisplay == 0) { $msgdisplay = 100; } $paytype = '充值'; $paytype = u2g($paytype); $paytype3 = '订单支付'; $paytype3 = u2g($paytype); $paytype1 = '购买抵用券'; $paytype1 = u2g($paytype1); $paystate = '交易完成'; $paystate = u2g($paystate); $query = "select * from (select fd_accglist_bkordernumber as accglistno," . " case \n when fd_accglist_paytype ='coupon' then '购买抵用券'\n when fd_accglist_paytype ='creditcard' then '信用卡还款'" . "when fd_accglist_paytype ='recharge' then '" . $paytype . "'" . "when fd_accglist_paytype ='pay' then '还贷款'" . "when fd_accglist_paytype ='order' then '" . $paytype3 . "'" . "when fd_accglist_paytype ='tfmg' then '转账汇款'\n else '其他业务' END accgpaymode," . " \n\t\t\t\t fd_accglist_datetime as accglistdate , fd_accglist_id as accglistid ,\n\t\t\t\t (fd_accglist_money) as accglistmoney,'" . $paystate . "' as accgstate,'' as accgtype,'' as accgmemo ," . " 'testbank' as accgcardbank,'testno' as accgcardno \n\t\t\t\t\t\t\t from tb_authoraccountglist where year(fd_accglist_datetime) = '{$accyear}' and \n\t\t\t\t\t\t\t\t\tmonth(fd_accglist_datetime) = '{$accmonth}' and fd_accglist_authorid='{$authorid}' {$wherequery1} \n\t\t\t\t " . " union all select fd_couponsale_bkordernumber as couponno,'" . $paytype1 . "' as accgpaymode ,fd_couponsale_datetime as coupondate," . "fd_couponsale_id as couponid, CONCAT_WS('=',CONCAT_WS('*',(fd_couponsale_money/fd_coupon_money),fd_coupon_money),fd_couponsale_money+0) as couponmoney,'" . $paystate . "','' as accgtype,'' as accgmemo ,'testbank' as accgcardbank,'testno' as accgcardno \n\t\t\t from \n\t\t\t tb_couponsale left join tb_coupon on fd_coupon_id =fd_couponsale_couponid where fd_couponsale_authorid = '{$authorid}' and fd_couponsale_payrq = '00' and fd_couponsale_isagentpay = '0'" . " and year(fd_couponsale_datetime) = '{$accyear}' and \n\t\t\t\t\t\t\t\t\tmonth(fd_couponsale_datetime) = '{$accmonth}' {$wherequery2}) as a order by accglistdate desc "; $db->query($query); $msgallcount = $db->nf(); //$query = " $query limit $msgstart,$msgdisplay "; //$db->query($query); $msgdiscount = $db->nf(); // echo $query; // echo $query; $arr_msg = auto_charset($db->getData('', 'msgbody'), 'gbk', 'utf-8'); $arr_message = array("result" => "success", "message" => "读取成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 $arr_msg['msgbody']['result'] = $arr_message['result']; $arr_msg['msgbody']['message'] = $arr_message['message']; $arr_msg['msgbody']['msgallcount'] = $msgallcount; $arr_msg['msgbody']['msgdiscount'] = $msgdiscount + $msgstart; $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }
public function authorFeedbck() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $authorid = trim($arr_channelinfo['authorid']); $fdcontent = u2g(trim($arr_body['fdcontent'])); $fdlinkmethod = u2g(trim($arr_body['fdlinkmethod'])); $fdcontent = str_replace("'", "‘", $fdcontent); $fdcontent = str_replace("¥", "¥", $fdcontent); //addslashes $query = "insert into tb_feedback (fd_feedback_authorid ,fd_feedback_content ,fd_feedback_linkman,\n\t fd_feedback_datetime)values( '{$authorid}' ,'{$fdcontent}','{$fdlinkmethod}',now())"; $db->query($query); $arr_message = array("error_id" => "0", "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; }
function changeaccount($authorid, $money, $type) { //$type =0表示增加金钱 , 1表示减少金钱 $db = new DB_test(); if ($type == 0) { $endmoney = $money; } else { $endmoney = -$money; } if ($endmoney == "") { $endmoney = 0; } /*$query = "select fd_account_money from tb_account where fd_account_id = '$accountid'"; $db->query($query); if($db->nf()){ $db->next_record(); $beginmoney = $db->f(fd_account_money); $allmoney = $beginmoney+$endmoney; }*/ $query = "update tb_account set fd_acc_money = fd_acc_money + '" . $endmoney . "' where fd_acc_authorid = '{$authorid}' "; $db->query($query); //更新记录 }
public function modifyAuBkCardInfo() { $db = new DB_test(); $arr_header = $this->arr_header; $arr_body = $this->arr_body; $arr_channelinfo = $this->arr_channelinfo; $authorid = trim($arr_channelinfo['authorid']); $shoucardman = u2g(trim($arr_body['aushoucardman'])); $shoucardphone = trim($arr_body['aushoucardphone']); $shoucardno = trim($arr_body['aushoucardno']); $shoucardbank = u2g(trim($arr_body['aushoucardbank'])); $query = "select * from tb_author where fd_author_id = '{$authorid}' and fd_author_couponstate='1'"; $db->query($query); if ($db->nf()) { $arr_message = array("result" => "failure", "message" => "银行卡资料已经审批,如需修改请联系客服!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 $Error = array('result' => 'failure', 'retcode' => '200', 'retmsg' => $arr_message['message']); $arr_msg['msgbody'] = array("result" => "failure", "message" => "银行卡资料已经审批,如需修改请联系客服!"); $retcode = "200"; //反馈状态 0 成功 200 自定义错误 $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; //$ErrorReponse->reponError($Error); //出错反馈 //return false; } $query = "update tb_author set fd_author_shoucardman = '{$shoucardman}',\n\t\t\t fd_author_shoucardphone = '{$shoucardphone}',\n\t\t\t fd_author_shoucardno='{$shoucardno}',\n\t\t\t fd_author_shoucardbank='{$shoucardbank}',fd_author_couponstate = '0' where fd_author_id = '{$authorid}' "; $db->query($query); $arr_msg['msgbody'] = array("error_id" => "0", "result" => "success", "message" => "恭喜您,我的银行卡修改成功!"); $retcode = "0"; //反馈状态 0 成功 200 自定义错误 $returnvalue = array("msgbody" => $arr_msg['msgbody']); $returnval = TfbxmlResponse::ResponsetoApp($retcode, $returnvalue); return $returnval; }