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; }
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; }
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; }
/** * 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)); }
/** * 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"); }
/** * 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"); }