当前位置: 首页>>代码示例>>PHP>>正文


PHP DBUtil::updateById方法代码示例

本文整理汇总了PHP中DBUtil::updateById方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtil::updateById方法的具体用法?PHP DBUtil::updateById怎么用?PHP DBUtil::updateById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBUtil的用法示例。


在下文中一共展示了DBUtil::updateById方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     global $_GPC;
     $fid = $_GPC['fid'];
     $data = array('rid' => $rid, 'weid' => $this->weid, 'oname' => $_GPC['oname'], 'pname' => $_GPC['pname'], 'odesc' => htmlspecialchars_decode($_GPC['odesc']), 'p_desc' => htmlspecialchars_decode($_GPC['p_desc']), 'p_tel' => $_GPC['p_tel'], 'lng' => $_GPC['lng'], 'lat' => $_GPC['lat'], 'p_title_pg' => $_GPC['p_title_pg'], 'p_titile_url' => $_GPC['p_titile_url'], 'location_p' => $_GPC['location_p'], 'location_c' => $_GPC['location_c'], 'location_a' => $_GPC['location_a'], 'address' => $_GPC['address'], 'follow_url' => $_GPC['follow_url'], 'copyright' => $_GPC['copyright'], 'new_title' => $_GPC['new_title'], 'new_icon' => $_GPC['new_icon'], 'new_content' => $_GPC['new_content'], 'share_title' => $_GPC['share_title'], 'share_icon' => $_GPC['share_icon'], 'share_content' => $_GPC['share_content'], 'emailenable' => $_GPC['emailenable'], 'email' => $_GPC['email'], 'updatetime' => TIMESTAMP);
     if (empty($fid)) {
         $data['createtime'] = TIMESTAMP;
         DBUtil::create(DBUtil::$TABLE_ORDER_FORM, $data);
     } else {
         DBUtil::updateById(DBUtil::$TABLE_ORDER_FORM, $data, $fid);
     }
     return true;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:13,代码来源:module.php

示例2: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     global $_GPC;
     $egid = $_GPC['egid'];
     $data = array('rid' => $rid, 'weid' => $this->weid, 'title' => $_GPC['title'], 'starttime' => strtotime($_GPC['starttime']), 'endtime' => strtotime($_GPC['endtime']), 'follow_url' => $_GPC['follow_url'], 'copyright' => $_GPC['copyright'], 'follow_btn_name' => $_GPC['follow_btn_name'], 'follow_dlg_tip' => $_GPC['follow_dlg_tip'], 'new_title' => $_GPC['new_title'], 'new_icon' => $_GPC['new_icon'], 'new_content' => $_GPC['new_content'], 'share_title' => $_GPC['share_title'], 'share_icon' => $_GPC['share_icon'], 'share_content' => $_GPC['share_content'], 'intro' => htmlspecialchars_decode($_GPC['intro']), 'banner_bg' => $_GPC['banner_bg'], 'bg_img' => $_GPC['bg_img'], 'share_bg' => $_GPC['share_bg'], 'day_count' => $_GPC['day_count'], 'prize_limit' => $_GPC['prize_limit'], 'dpassword' => $_GPC['dpassword'], 'share_enable' => $_GPC['share_enable'], 'share_times' => $_GPC['share_times'], 'share_award_count' => $_GPC['share_award_count'], 'music' => $_GPC['music'], 'exchangeEnable' => $_GPC['exchangeEnable'], 'updatetime' => TIMESTAMP);
     if (empty($egid)) {
         $data['createtime'] = TIMESTAMP;
         DBUtil::create(DBUtil::$TABLE_EGG, $data);
         $egid = pdo_insertid();
     } else {
         DBUtil::updateById(DBUtil::$TABLE_EGG, $data, $egid);
     }
     $prizids = array();
     $pids = $_GPC['pids'];
     $display_orders = $_GPC['display_orders'];
     $plevels = $_GPC['plevels'];
     $pnames = $_GPC['pnames'];
     $pimgs = $_GPC['pimgs'];
     $ptypes = $_GPC['ptypes'];
     $jfs = $_GPC['jfs'];
     $pcounts = $_GPC['pcounts'];
     $pbs = $_GPC['pbs'];
     $pimgs = $_GPC['pimgs'];
     if (is_array($pids)) {
         foreach ($pids as $key => $value) {
             $value = intval($value);
             $d = array("egid" => $egid, "plevel" => $plevels[$key], 'display_order' => $display_orders[$key], 'pname' => $pnames[$key], 'pimg' => $pimgs[$key], 'pcount' => $pcounts[$key], 'ptype' => $ptypes[$key], 'pb' => $pbs[$key], 'jf' => $jfs[$key], "createtime" => TIMESTAMP);
             if (empty($value)) {
                 DBUtil::create(DBUtil::$TABLE_EGG_PRIZE, $d);
                 $prizids[] = pdo_insertid();
             } else {
                 DBUtil::updateById(DBUtil::$TABLE_EGG_PRIZE, $d, $value);
                 $prizids[] = $value;
             }
         }
         if (count($prizids) > 0) {
             pdo_query("delete from " . tablename(DBUtil::$TABLE_EGG_PRIZE) . " where egid='{$egid}' and id not in (" . implode(",", $prizids) . ")");
         } else {
             pdo_query("delete from " . tablename(DBUtil::$TABLE_EGG_PRIZE) . " where egid='{$egid}'");
         }
     }
     return true;
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:43,代码来源:module.php

示例3: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     global $_GPC, $_W;
     $kid = $_GPC['kid'];
     $kj_rules = array();
     $rule_ids = $_GPC['rule_id'];
     $rule_prices = $_GPC['rule_pice'];
     $rule_start = $_GPC['rule_start'];
     $rule_end = $_GPC['rule_end'];
     if (is_array($rule_ids)) {
         foreach ($rule_ids as $key => $value) {
             $d = array('rule_pice' => $rule_prices[$key], 'rule_start' => $rule_start[$key], 'rule_end' => $rule_end[$key]);
             $kj_rules[] = $d;
         }
     }
     $data = array('rid' => $rid, 'weid' => $this->weid, 'title' => $_GPC['title'], 'starttime' => strtotime($_GPC['starttime']), 'endtime' => strtotime($_GPC['endtime']), 'p_name' => $_GPC['p_name'], 'p_kc' => $_GPC['p_kc'], 'p_y_price' => $_GPC['p_y_price'], 'p_low_price' => $_GPC['p_low_price'], 'p_pic' => $_GPC['p_pic'], 'p_preview_pic' => $_GPC['p_preview_pic'], 'yf_price' => $_GPC['yf_price'], 'follow_url' => $_GPC['follow_url'], 'copyright' => $_GPC['copyright'], 'new_title' => $_GPC['new_title'], 'new_icon' => $_GPC['new_icon'], 'new_content' => $_GPC['new_content'], 'share_title' => $_GPC['share_title'], 'share_icon' => $_GPC['share_icon'], 'share_content' => $_GPC['share_content'], 'p_url' => $_GPC['p_url'], 'copyright_url' => $_GPC['copyright_url'], 'hot_tel' => $_GPC['hot_tel'], 'p_intro' => htmlspecialchars_decode($_GPC['p_intro']), 'kj_dialog_tip' => $_GPC['kj_dialog_tip'], 'u_fist_tip' => $_GPC['u_fist_tip'], 'u_already_tip' => $_GPC['u_already_tip'], 'rank_tip' => $_GPC['rank_tip'], 'fk_fist_tip' => $_GPC['fk_fist_tip'], 'fk_already_tip' => $_GPC['fk_already_tip'], 'pay_type' => $_GPC['pay_type'], 'p_model' => $_GPC['p_model'], 'kj_rule' => serialize($kj_rules), 'createtime' => TIMESTAMP);
     if (empty($kid)) {
         DBUtil::create(DBUtil::$TABLE_WKJ, $data);
     } else {
         DBUtil::updateById(DBUtil::$TABLE_WKJ, $data, $kid);
     }
     return true;
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:23,代码来源:module.php

示例4: doMobileBindUser

 /**
  * author: weizan012 QQ:800083075
  * 绑定用户
  */
 public function doMobileBindUser()
 {
     global $_W, $_GPC;
     $egid = $_GPC['egid'];
     $tel = $_GPC['tel'];
     $uname = $_GPC['uname'];
     $openid = $this->getOpenId();
     $user = DBUtil::findUnique(DBUtil::$TABLE_EGG_USER, array(":egid" => $egid, ":openid" => $openid));
     $res = array();
     if (empty($user)) {
         $res['code'] = 500;
         $res['msg'] = "用户不存在";
         die(json_encode($res));
     }
     DBUtil::updateById(DBUtil::$TABLE_EGG_USER, array('tel' => $tel, 'uname' => $uname), $user['id']);
     $res['code'] = 200;
     die(json_encode($res));
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:22,代码来源:site.php

示例5: doMobileOrderPay

 /**
  * author: 微赞
  */
 public function doMobileOrderPay()
 {
     global $_W, $_GPC;
     $oid = $_GPC['oid'];
     $order = DBUtil::findById(DBUtil::$TABLE_ORDER_ORDER, $oid);
     MonUtil::emtpyMsg($order, "订单删除或不存在");
     $item = DBUtil::findById(DBUtil::$TABLE_ORDER_ITEM, $order['iid']);
     $form = DBUtil::findById(DBUtil::$TABLE_ORDER_FORM, $order['fid']);
     if ($order['status'] == $this::$STATUS_UNPAY && $order['pay_type'] == 1) {
         //立即支付
         $jsApi = new JsApi_pub($this->mOrderSetting);
         $jsApi->setOpenId($order['openid']);
         $unifiedOrder = new UnifiedOrder_pub($this->mOrderSetting);
         $unifiedOrder->setParameter("openid", $order['openid']);
         //商品描述
         $unifiedOrder->setParameter("body", "预约订单" . $item['iname']);
         //商品描述
         $out_trade_no = date("YmdHis", TIMESTAMP);
         $unifiedOrder->setParameter("out_trade_no", $out_trade_no);
         //商户订单号
         //$unifiedOrder->setParameter("total_fee", 1);//总金额
         $unifiedOrder->setParameter("total_fee", $order['zf_price'] * 100);
         //总金额
         $notifyUrl = $_W['siteroot'] . "addons/" . MON_ORDER . "/notify.php";
         $unifiedOrder->setParameter("notify_url", $notifyUrl);
         //通知地址
         $unifiedOrder->setParameter("trade_type", "JSAPI");
         //交易类型
         $prepay_id = $unifiedOrder->getPrepayId();
         $jsApi->setPrepayId($prepay_id);
         $jsApiParameters = $jsApi->getParameters();
         DBUtil::updateById(DBUtil::$TABLE_ORDER_ORDER, array('outno' => $out_trade_no), $oid);
     }
     include $this->template("orderPay");
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:38,代码来源:site.php

示例6: doWebOrderList

 /**
  * author: codeMonkey QQ:631872807
  * 砍价 订单
  */
 public function doWebOrderList()
 {
     global $_W, $_GPC;
     $operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
     $kid = $_GPC['kid'];
     if ($operation == 'display') {
         $wkj = DBUtil::findById(DBUtil::$TABLE_WKJ, $kid);
         if (empty($wkj)) {
             message("砍价活动删除或不存在");
         }
         $keyword = $_GPC['keyword'];
         $where = '';
         $params = array(':kid' => $kid);
         if (!empty($keyword)) {
             $where .= ' and (order_no like :keyword) or (tel like :keyword)';
             $params[':keyword'] = "%{$keyword}%";
         }
         if ($_GPC['status'] != '') {
             $where .= ' and status =:status';
             $params[':status'] = $_GPC['status'];
         }
         $pindex = max(1, intval($_GPC['page']));
         $psize = 20;
         $list = pdo_fetchall("SELECT * FROM " . tablename(DBUtil::$TABLE_WJK_ORDER) . " 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_WJK_ORDER) . " WHERE kid =:kid  " . $where, $params);
         $pager = pagination($total, $pindex, $psize);
     } else {
         if ($operation == 'delete') {
             $id = $_GPC['id'];
             pdo_delete(DBUtil::$TABLE_WJK_ORDER, array("id" => $id));
             message('删除成功!', $this->createWebUrl('OrderList', array('kid' => $kid)), 'success');
         } else {
             if ($operation == 'fh') {
                 $id = $_GPC['id'];
                 DBUtil::updateById(DBUtil::$TABLE_WJK_ORDER, array('status' => $this::$KJ_STATUS_YFH), $id);
                 message('发货成功!', $this->createWebUrl('OrderList', array('kid' => $kid)), 'success');
             }
         }
     }
     include $this->template("order_list");
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:45,代码来源:site.php


注:本文中的DBUtil::updateById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。