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


PHP DBUtil::findById方法代碼示例

本文整理匯總了PHP中DBUtil::findById方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBUtil::findById方法的具體用法?PHP DBUtil::findById怎麽用?PHP DBUtil::findById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBUtil的用法示例。


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

示例1: doMobileUserShare

 /**
  * author: 微讚科技
  * 用戶分享
  */
 public function doMobileUserShare()
 {
     global $_W, $_GPC;
     $egid = $_GPC['egid'];
     $egg = DBUtil::findById(DBUtil::$TABLE_EGG, $egid);
     $openid = $this->getOpenId();
     if (!empty($egg) && $egg['share_enable'] == 1 && !empty($openid)) {
         $user = DBUtil::findUnique(DBUtil::$TABLE_EGG_USER, array(":egid" => $egid, ":openid" => $openid));
         if (!empty($user)) {
             $user_DayShare = $this->findUserDayShareCount($egg['id'], $openid);
             $userDayCount = $this->findUserDayRecordCount($egg['id'], $openid);
             //查找用戶今天的次數
             //分享獎勵次數還有,並且  用戶抽獎次數大於等於 每天限製基本次數
             if ($user_DayShare < $egg['share_times'] && $userDayCount >= $egg['day_count']) {
                 $shareData = array('egid' => $egid, 'uid' => $user['id'], 'openid' => $openid, 'createtime' => TIMESTAMP);
                 DBUtil::create(DBUtil::$TABLE_EGG_SHARE, $shareData);
                 die(json_encode(array('code' => 250, 'leftShare' => $egg['share_times'] - 1 - $user_DayShare, 'awardCount' => $egg['share_award_count'])));
             }
         }
     }
     die(json_encode(array('code' => 200)));
 }
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:26,代碼來源:site.php

示例2: doMobilePaySuccess

 public function doMobilePaySuccess()
 {
     global $_GPC;
     $oid = $_GPC['oid'];
     $order = DBUtil::findById(DBUtil::$TABLE_ORDER_ORDER, $oid);
     $item = DBUtil::findById(DBUtil::$TABLE_ORDER_ITEM, $order['iid']);
     if (!empty($order) && !empty($item)) {
         $this->sendPayTemplateMsg($order, $item);
     }
     die(json_encode(array('code' => 200)));
 }
開發者ID:aspnmy,項目名稱:weizan,代碼行數:11,代碼來源:site.php

示例3: die

<?php

if (PHP_SAPI == 'cli') {
    die('This example should only be run from a Web Browser');
}
global $_GPC, $_W;
$kid = intval($_GPC['kid']);
if (empty($kid)) {
    message('抱歉,傳遞的參數錯誤!', '', 'error');
}
$wkj = DBUtil::findById(DBUtil::$TABLE_WKJ, $kid);
$list = pdo_fetchall("select * from " . tablename(DBUtil::$TABLE_WJK_ORDER) . " where kid=:kid order by createtime desc ", array(':kid' => $kid));
$tableheader = array($this->encode("商品"), $this->encode("款式"), $this->encode('用戶openID'), $this->encode("訂單編號"), $this->encode("微信支付單號"), $this->encode("收貨人"), $this->encode("電話"), $this->encode("收貨地址"), $this->encode("商品原價"), $this->encode("砍後價格"), $this->encode("運費"), $this->encode("支付金額"), $this->encode("狀態"), $this->encode("下單時間"), $this->encode("支付時間"));
$html = "";
foreach ($tableheader as $value) {
    $html .= $value . "\t ,";
}
$html .= "\n";
foreach ($list as $value) {
    $html .= $this->encode($wkj['p_name']) . "\t ,";
    $html .= $this->encode($value['p_model']) . "\t ,";
    $html .= $value['openid'] . "\t ,";
    $html .= $value["order_no"] . "\t ,";
    $html .= $value["wxorder_no"] . "\t ,";
    $html .= $this->encode($value["uname"]) . "\t ,";
    $html .= $value["tel"] . "\t ,";
    $html .= $this->encode($value["address"]) . "\t ,";
    $html .= $value["y_price"] . "\t ,";
    $html .= $value["kh_price"] . "\t ,";
    $html .= $value["yf_price"] . "\t ,";
    $html .= $value["total_price"] . "\t ,";
開發者ID:ChainBoy,項目名稱:wxfx,代碼行數:31,代碼來源:orderdownload.php

示例4: die

<?php

if (PHP_SAPI == 'cli') {
    die('This example should only be run from a Web Browser');
}
global $_GPC, $_W;
$kid = intval($_GPC['kid']);
if (empty($kid)) {
    message('抱歉,傳遞的參數錯誤!', '', 'error');
}
$xkwkj = DBUtil::findById(DBUtil::$TABLE_XKWKJ, $kid);
$where = '';
$params = array(':kid' => $kid);
$status = $_GPC['status'];
if ($status != '') {
    $where .= ' and status =:status';
    $params[':status'] = $_GPC['status'];
}
$list = pdo_fetchall("SELECT * FROM " . tablename(DBUtil::$TABLE_XKWJK_ORDER) . " WHERE kid =:kid " . $where . "  ORDER BY createtime DESC ", $params);
$dc = $_GPC['dc'];
$tableheader = array($this->encode("商品", $dc), $this->encode("款式", $dc), $this->encode('用戶openID', $dc), $this->encode("訂單編號", $dc), $this->encode("微信支付單號", $dc), $this->encode("收貨人", $dc), $this->encode("電話", $dc), $this->encode("郵編", $dc), $this->encode("收貨地址", $dc), $this->encode("商品原價", $dc), $this->encode("砍後價格", $dc), $this->encode("運費", $dc), $this->encode("支付金額", $dc), $this->encode("狀態", $dc), $this->encode("下單時間", $dc), $this->encode("支付時間", $dc));
$html = "";
foreach ($tableheader as $value) {
    $html .= $value . "\t ,";
}
$html .= "\n";
foreach ($list as $value) {
    $html .= $this->encode($xkwkj['p_name'], $dc) . "\t ,";
    $html .= $this->encode($value['p_model'], $dc) . "\t ,";
    $html .= $value['openid'] . "\t ,";
    $html .= $value["order_no"] . "\t ,";
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:31,代碼來源:orderdownload.php

示例5: doWebJoinUser

 /**
  * author: codeMonkey QQ:631872807
  * 參與用戶
  */
 public function doWebJoinUser()
 {
     global $_W, $_GPC;
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     if ($operation == 'display') {
         $kid = $_GPC['kid'];
         $wkj = DBUtil::findById(DBUtil::$TABLE_WKJ, $kid);
         if (empty($wkj)) {
             message("砍價活動刪除或不存在");
         }
         $keyword = $_GPC['keyword'];
         $where = '';
         $params = array(':kid' => $kid);
         if (!empty($keyword)) {
             $where .= ' and (nickname like :nickname)';
             $params[':nickname'] = "%{$keyword}%";
         }
         $pindex = max(1, intval($_GPC['page']));
         $psize = 20;
         $list = pdo_fetchall("SELECT * FROM " . tablename(DBUtil::$TABLE_WKJ_USER) . " WHERE kid =:kid " . $where . "  ORDER BY createtime DESC, id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $params);
         $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename(DBUtil::$TABLE_WKJ_USER) . " WHERE kid =:kid  " . $where, $params);
         $pager = pagination($total, $pindex, $psize);
     } else {
         if ($operation == 'delete') {
             $id = $_GPC['id'];
             pdo_delete(DBUtil::$TABLE_WJK_ORDER, array("uid" => $id));
             pdo_delete(DBUtil::$TABLE_WKJ_FIREND, array("uid" => $id));
             pdo_delete(DBUtil::$TABLE_WKJ_USER, array("id" => $id));
             message('刪除成功!', referer(), 'success');
         }
     }
     include $this->template("user_list");
 }
開發者ID:ChainBoy,項目名稱:wxfx,代碼行數:37,代碼來源:site.php


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