本文整理汇总了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)));
}
示例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)));
}
示例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 ,";
示例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 ,";
示例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");
}