function hueisd_id($sd_id, $leixin = null) { $mysql_model = System::load_sys_class('model'); $sdhf = $mysql_model->GetOne("select * from `@#_shaidan_hueifu` where `sdhf_id`='{$sd_id}' order by id DESC limit 1"); if (!$sdhf) { return false; } $sdhf['sdhf_content'] = _htmtocode($sdhf['sdhf_content']); return $sdhf; }
public function detail() { $member = $this->userinfo; $sd_id = abs(intval($this->segment(4))); $shaidan = $this->db->GetOne("select * from `@#_shaidan` where `sd_id`='{$sd_id}'"); $goods = $this->db->GetOne("select sid from `@#_shoplist` where `id` = '{$shaidan['sd_shopid']}'"); $goods = $this->db->GetOne("select id,qishu,money,q_uid,maxqishu,thumb,title from `@#_shoplist` where `sid` = '{$goods['sid']}' order by `qishu` DESC"); if (isset($_POST['submit'])) { $sdhf_syzm = _getcookie("checkcode"); $sdhf_pyzm = isset($_POST['sdhf_code']) ? strtoupper($_POST['sdhf_code']) : ''; $sdhf_id = $shaidan['sd_id']; $sdhf_userid = $member['uid']; $sdhf_content = $_POST['sdhf_content']; $sdhf_time = time(); $sdhf_username = _htmtocode(get_user_name($member)); $sdhf_img = _htmtocode($member['img']); if (empty($sdhf_content)) { _message("页面错误"); } if (empty($sdhf_pyzm)) { _message("请输入验证码"); } if ($sdhf_syzm != md5($sdhf_pyzm)) { _message("验证码不正确"); } $this->db->Query("INSERT INTO `@#_shaidan_hueifu`(`sdhf_id`,`sdhf_userid`,`sdhf_content`,`sdhf_time`,`sdhf_username`,`sdhf_img`)VALUES\n\t\t\t('{$sdhf_id}','{$sdhf_userid}','{$sdhf_content}','{$sdhf_time}','{$sdhf_username}','{$sdhf_img}')"); $sd_ping = $shaidan['sd_ping'] + 1; $this->db->Query("UPDATE `@#_shaidan` SET sd_ping='{$sd_ping}' where sd_id='{$shaidan['sd_id']}'"); _message("评论成功", WEB_PATH . "/go/shaidan/detail/" . $sd_id); } $shaidannew = $this->db->GetList("select * from `@#_shaidan` order by `sd_id` DESC limit 5"); $shaidan_hueifu = $this->db->GetList("select * from `@#_shaidan_hueifu` where `sdhf_id`='{$sd_id}' LIMIT 10"); foreach ($shaidan_hueifu as $k => $v) { $shaidan_hueifu[$k]['sdhf_content'] = _htmtocode($shaidan_hueifu[$k]['sdhf_content']); } if (!$shaidan) { _message("页面错误"); } $substr = substr($shaidan['sd_photolist'], 0, -1); $sd_photolist = explode(";", $substr); $title = $shaidan['sd_title'] . "_" . _cfg("web_name"); $keywords = $shaidan['sd_title']; $description = $shaidan['sd_title']; include templates("index", "detail"); }
<li><b class="api_b">购买人邮箱:</b><?php echo $user['email']; ?> </li> <li><b class="api_b">购买人手机:</b><?php echo $user['mobile']; ?> </li> <li><b class="api_b">购买时间:</b><?php echo date("Y-m-d H:i:s", $go_time); ?> </li> <li><b class="api_b">收货信息:</b><?php if ($user_dizhi) { foreach ($user_dizhi as $k => $v) { $user_dizhi[$k] = _htmtocode($v); } echo $user_dizhi['sheng'] . ' - ' . $user_dizhi['shi'] . ' - ' . $user_dizhi['xian'] . ' - ' . $user_dizhi['jiedao']; echo " 邮编:" . $user_dizhi['youbian']; echo " 收货人:" . $user_dizhi['shouhuoren']; echo " 手机:" . $user_dizhi['mobile']; } else { echo "该用户未填写收货信息,请自行联系买家!"; } ?> </li> </div> <div class="bk10"></div> <?php if ($record['huode']) { ?>
public function goods_add() { if (isset($_POST['dosubmit'])) { $cateid = intval($_POST['cateid']); $brandid = intval($_POST['brand']); $title = _htmtocode($_POST['title']); $title_color = htmlspecialchars($_POST['title_style_color']); $title_bold = htmlspecialchars($_POST['title_style_bold']); $title2 = _htmtocode($_POST['title2']); $keywords = htmlspecialchars($_POST['keywords']); $description = htmlspecialchars($_POST['description']); $content = editor_safe_replace(stripslashes($_POST['content'])); $money = intval($_POST['money']); $yunjiage = intval($_POST['yunjiage']); $xiangou = intval($_POST['xiangou']); $thumb = htmlspecialchars($_POST['thumb']); $maxqishu = intval($_POST['maxqishu']); $canyurenshu = 0; $goods_key_pos = isset($_POST['goods_key']['pos']) ? 1 : 0; $goods_key_renqi = isset($_POST['goods_key']['renqi']) ? 1 : 0; $goods_key_bannershop = isset($_POST['goods_key']['bannershop']) ? 1 : 0; $renqipos = isset($_POST['goods_key']['renqipos']) ? 1 : 0; $newpos = isset($_POST['goods_key']['newpos']) ? 1 : 0; $posthumb = trim(htmlspecialchars($_POST['posthumb'])); if (!$cateid) { _message("请选择栏目"); } if (!$brandid) { _message("请选择品牌"); } if (!$title) { _message("标题不能为空"); } if (!$thumb) { _message("缩略图不能为空"); } $title_style = ''; if ($title_color) { $title_style .= 'color:' . $title_color . ';'; } if ($title_bold) { $title_style .= 'font-weight:' . $title_bold . ';'; } if (isset($_POST['uppicarr'])) { $picarr = serialize($_POST['uppicarr']); } else { $picarr = serialize(array()); } if ($_POST['xsjx_time'] != '') { $xsjx_time = strtotime($_POST['xsjx_time']) ? strtotime($_POST['xsjx_time']) : time(); $xsjx_time_h = intval($_POST['xsjx_time_h']) ? $_POST['xsjx_time_h'] : 36000; $xsjx_time += $xsjx_time_h; } else { $xsjx_time = '0'; } if ($maxqishu > 65535) { _message("最大雨数不能超过65535雨"); } if ($money < $yunjiage) { _message("商品价格不能小于购买价格"); } $zongrenshu = ceil($money / $yunjiage); $codes_len = ceil($zongrenshu / 3000); $shenyurenshu = $zongrenshu - $canyurenshu; if ($zongrenshu == 0 || $zongrenshu - $canyurenshu == 0) { _message("云购价格不正确"); } $time = time(); //商品添加时间 $this->db->Autocommit_start(); $query_1 = $this->db->Query("INSERT INTO `@#_shoplist` (`quyu`,`cateid`, `brandid`, `title`, `title_style`, `title2`, `keywords`, `description`, `money`, `yunjiage`, `xiangou`, `zongrenshu`, `canyurenshu`,`shenyurenshu`, `qishu`,`maxqishu`,`thumb`, `picarr`, `content`,`xsjx_time`,`renqi`,`pos`,`bannershop`,`renqipos`,`newpos`,`posthumb`, `time`) VALUES ('" . htmlspecialchars($_POST['quyu']) . "','{$cateid}', '{$brandid}', '{$title}', '{$title_style}', '{$title2}', '{$keywords}', '{$description}', '{$money}', '{$yunjiage}','{$xiangou}' ,'{$zongrenshu}', '{$canyurenshu}','{$shenyurenshu}', '1','{$maxqishu}', '{$thumb}', '{$picarr}', '{$content}','{$xsjx_time}','{$goods_key_renqi}', '{$goods_key_pos}','{$goods_key_bannershop}','{$renqipos}','{$newpos}','{$posthumb}','{$time}')"); $shopid = $this->db->insert_id(); System::load_app_fun("content"); $query_table = content_get_codes_table(); if (!$query_table) { $this->db->Autocommit_rollback(); _message("雨购码仓库不正确!"); } $query_2 = content_get_go_codes($zongrenshu, 3000, $shopid); $query_3 = $this->db->Query("UPDATE `@#_shoplist` SET `codes_table` = '{$query_table}',`sid` = '{$shopid}',`def_renshu` = '{$canyurenshu}' where `id` = '{$shopid}'"); if ($query_1 && $query_2 && $query_3) { $this->db->Autocommit_commit(); _message("商品添加成功!", WEB_PATH . '/' . ROUTE_M . '/content/goods_list/'); } else { $this->db->Autocommit_rollback(); _message("商品添加失败!"); } header("Cache-control: private"); } $cateid = intval($this->segment(4)); $categorys = $this->db->GetList("SELECT * FROM `@#_category` WHERE `model` = '1' order by `parentid` ASC,`cateid` ASC", array('key' => 'cateid')); $tree = System::load_sys_class('tree'); $tree->icon = array('│ ', '├─ ', '└─ '); $tree->nbsp = ' '; $categoryshtml = "<option value='\$cateid'>\$spacer\$name</option>"; $tree->init($categorys); $categoryshtml = $tree->get_tree(0, $categoryshtml); $categoryshtml = '<option value="0">≡ 请选择栏目 ≡</option>' . $categoryshtml; if ($cateid) { $cateinfo = $this->db->GetOne("SELECT * FROM `@#_category` WHERE `cateid` = '{$cateid}' LIMIT 1"); if (!$cateinfo) { _message("参数不正确,没有这个栏目", G_ADMIN_PATH . '/' . ROUTE_C . '/addarticle'); } $categoryshtml .= '<option value="' . $cateinfo['cateid'] . '" selected="true">' . $cateinfo['name'] . '</option>'; $BrandList = $this->db->GetList("SELECT * FROM `@#_brand` where `cateid`='{$cateid}'", array("key" => "id")); } else { $BrandList = $this->db->GetList("SELECT * FROM `@#_brand` where 1", array("key" => "id")); } $this->ment = array(array("lists", "商品管理", ROUTE_M . '/' . ROUTE_C . "/goods_list"), array("insert", "添加商品", ROUTE_M . '/' . ROUTE_C . "/goods_add")); include $this->tpl(ROUTE_M, 'shop.insert'); }
function pay_insert_shop($shop = '', $type = '') { $time = sprintf("%.3f", microtime(true) + (int) System::load_sys_config('system', 'goods_end_time')); $db = System::load_sys_class("model"); if ($shop['xsjx_time'] != '0') { return $db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,\t`shenyurenshu` = '0' where `id` = '{$shop['id']}'"); } $tocode = System::load_app_class("tocode", "pay"); $tocode->shop = $shop; $tocode->run_tocode($time, 100, $shop['canyurenshu'], $shop); $code = $tocode->go_code; $content = addslashes($tocode->go_content); $counttime = $tocode->count_time; $u_go_info = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}' and `goucode` LIKE '%{$code}%'"); $u_info = $db->GetOne("select uid,username,email,mobile,img from `@#_member` where `uid` = '{$u_go_info['uid']}'"); //更新商品 $query = true; if ($u_info) { $u_info['username'] = _htmtocode($u_info['username']); $q_user = serialize($u_info); $gtimes = (int) System::load_sys_config('system', 'goods_end_time'); if ($gtimes == 0 || $gtimes == 1) { $q_showtime = 'N'; } else { $q_showtime = 'Y'; } $sqlss = "UPDATE `@#_shoplist` SET \n\t\t\t\t\t\t\t`canyurenshu`=`zongrenshu`,\n\t\t\t\t\t\t\t`shenyurenshu` = '0',\n\t\t\t\t\t\t\t`q_uid` = '{$u_info['uid']}',\n\t\t\t\t\t\t\t`q_user` = '{$q_user}',\n\t\t\t\t\t\t\t`q_user_code` = '{$code}',\n\t\t\t\t\t\t\t`q_content`\t= '{$content}',\n\t\t\t\t\t\t\t`q_counttime` ='{$counttime}',\n\t\t\t\t\t\t\t`q_end_time` = '{$time}',\n\t\t\t\t\t\t\t`q_showtime` = '{$q_showtime}'\n\t\t\t\t\t\t\t where `id` = '{$shop['id']}'"; $q = $db->Query($sqlss); if (!$q) { $query = false; } if ($q) { $q = $db->Query("UPDATE `@#_member_go_record` SET `huode` = '{$code}' where `id` = '{$u_go_info['id']}' and `code` = '{$u_go_info['code']}' and `uid` = '{$u_go_info['uid']}' and `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}'"); if (!$q) { $query = false; } else { $post_arr = array("uid" => $u_info['uid'], "gid" => $shop['id'], "send" => 1); _g_triggerRequest(WEB_PATH . '/api/send/send_shop_code', false, $post_arr); } } else { $query = false; } } else { $query = false; } /******************************/ /*新建*/ if ($query) { if ($shop['qishu'] < $shop['maxqishu']) { $maxinfo = $db->GetOne("select * from `@#_shoplist` where `sid` = '{$shop['sid']}' order by `qishu` DESC LIMIT 1"); if (!$maxinfo) { $maxinfo = array("qishu" => $shop['qishu']); } System::load_app_fun("content", G_ADMIN_DIR); $intall = content_add_shop_install($maxinfo, false); if (!$intall) { return $query; } } } return $query; }
public function hueifuinsert() { $uid = $this->userinfo['uid']; if ($uid == null) { _message("未登录"); } $hueifu = _htmtocode($_POST['hueifu']); if ($hueifu == null) { _message("内容不能为空"); } $tzid = intval($_POST['tzid']); if ($tzid <= 0) { _message("错误"); } $hftime = time(); $this->db->Query("INSERT INTO `@#_quanzi_hueifu`(`tzid`,`hueifu`,`hueiyuan`,`hftime`)VALUES('{$tzid}','{$hueifu}','{$uid}','{$hftime}')"); $tiezi = $this->db->GetOne("select * from `@#_quanzi_tiezi` where `id`='{$tzid}'"); $hfnum = $tiezi['hueifu'] + 1; $this->db->Query("UPDATE `@#_quanzi_tiezi` SET `hueifu`='{$hfnum}' where `id`='{$tzid}'"); _message("添加成功"); }
public function singleinsert() { $member = $this->userinfo; $uid = _getcookie('uid'); $ushell = _getcookie('ushell'); $title = "添加晒单"; $recordid = intval($this->segment(4)); $shopid = $recordid; $shaidan = $this->db->GetOne("select * from `@#_member_go_record` where `id`='{$recordid}' and `uid` = '{$member['uid']}'"); if (!$shaidan) { _message("该商品您不可晒单!"); } $shaidanyn = $this->db->GetOne("select sd_id from `@#_shaidan` where `sd_shopid`='{$recordid}' and `sd_userid` = '{$member['uid']}'"); if ($shaidanyn) { _message("不可重复晒单!"); } $ginfo = $this->db->GetOne("select id,sid,qishu from `@#_shoplist` where `id`='{$shaidan['shopid']}' LIMIT 1"); if (!$ginfo) { _message("该商品已不存在!"); } if (isset($_POST['submit'])) { if ($_POST['title'] == null) { _messagemobile("标题不能为空"); } if ($_POST['content'] == null) { _messagemobile("内容不能为空"); } System::load_sys_class('upload', 'sys', 'no'); $img = $_POST['fileurl_tmp']; $num = count($img); $pic = ""; for ($i = 0; $i < $num; $i++) { $pic .= trim($img[$i]) . ";"; } $src = trim($img[0]); $size = getimagesize(G_UPLOAD . $src); $width = 220; $height = $size[1] * ($width / $size[0]); $src_houzhui = upload::thumbs($width, $height, false, G_UPLOAD . '/' . $src); $thumbs = $src . "_" . intval($width) . intval($height) . "." . $src_houzhui; $sd_userid = $this->userinfo['uid']; $sd_shopid = $ginfo['id']; $sd_shopsid = $ginfo['sid']; $sd_qishu = $ginfo['qishu']; $sd_title = _htmtocode($_POST['title']); $path = 'shaidan/'; $sd_thumbs = $path . $_POST['shaitu'] . '.jpg'; $sd_content = $_POST['content']; $sd_photolist = $path . $_POST['shaitu'] . '.jpg;'; $sd_time = time(); $sd_ip = _get_ip_dizhi(); $this->db->Query("INSERT INTO `@#_shaidan`(`sd_userid`,`sd_shopid`,`sd_shopsid`,`sd_qishu`,`sd_ip`,`sd_title`,`sd_thumbs`,`sd_content`,`sd_photolist`,`sd_time`)VALUES\n\t\t\t('{$sd_userid}','{$sd_shopid}','{$sd_shopsid}','{$sd_qishu}','{$sd_ip}','{$sd_title}','{$sd_thumbs}','{$sd_content}','{$sd_photolist}','{$sd_time}')"); _messagemobile("晒单分享成功", WEB_PATH . "/mobile/home/singlelist"); } include templates("mobile/user", "singleinsert"); }
function content_add_shop_install($info = null, $autocommit = true) { $db = System::load_sys_class("model"); if ($autocommit) { $db->Autocommit_start(); } unset($info['id']); unset($info['q_uid']); unset($info['q_user']); unset($info['q_user_code']); unset($info['q_content']); unset($info['q_counttime']); unset($info['q_end_time']); $info['xsjx_time'] = 0; $info['time'] = time(); $info['qishu'] = intval($info['qishu']); $info['qishu']++; $info['canyurenshu'] = '0'; $info['shenyurenshu'] = $info['zongrenshu']; $info['codes_table'] = content_get_codes_table(); $info['q_showtime'] = 'N'; $info['title'] = _htmtocode($info['title']); $info['title2'] = _htmtocode($info['title2']); $keys = $vals = '('; foreach ($info as $key => $val) { $keys .= "`{$key}`,"; $vals .= "'{$val}',"; } $keys = rtrim($keys, ','); $vals = rtrim($vals, ','); $keys .= ')'; $vals .= ')'; $sql = "INSERT INTO `@#_shoplist` " . $keys . " VALUES " . $vals; $q1 = $db->Query($sql); $id = $db->insert_id(); $q2 = content_get_go_codes($info['zongrenshu'], 3000, $id); if ($autocommit) { if ($q1 && $q2) { $db->Autocommit_commit(); return true; } else { $db->Autocommit_rollback(); return false; } } else { if ($q1 && $q2) { return true; } else { return false; } } }
function pay_insert_shop($shop = '', $type = '') { $time = sprintf("%.3f", microtime(true) + (int) System::load_sys_config('system', 'goods_end_time')); $db = System::load_sys_class("model"); if ($shop['xsjx_time'] != '0') { return $db->Query("UPDATE `@#_shoplist` SET `canyurenshu`=`zongrenshu`,\t`shenyurenshu` = '0' where `id` = '{$shop['id']}'"); } $apidata = file_get_contents("http://api.caipiaokong.com/lottery/?name=xjssc&format=json&uid=195161&num=1&token=3a914fc3d237dd40f6ad71b57ef5ac61793af9d4&order=sort"); $apiarray = json_decode($apidata, true); foreach ($apiarray as $key => $value) { $apinumberstr = str_replace(",", "", $apiarray[$key]['number']); } $apinumber = intval($apinumberstr); $tocode = System::load_app_class("tocode", "pay"); $tocode->shop = $shop; $tocode->run_tocode($time, 50, $shop['canyurenshu'], $apinumber, $shop); $code = $tocode->go_code; $content = addslashes($tocode->go_content); $counttime = $tocode->count_time; //20140901新增,判断是否指定中奖// if ($shop['quyu_begin'] && $shop['quyu_end']) { $ex_info = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}' and `uid` >'{$shop['quyu_begin']}' and `uid` <'{$shop['quyu_end']}' order by rand() limit 1"); if ($ex_info['goucode']) { $ex_code = explode(",", $ex_info['goucode']); $ex_count = count($ex_code); $ex_rand = rand(0, $ex_count - 1); if (!empty($ex_code[$ex_rand])) { $chazhi = $ex_code[$ex_rand] - $code; if ($chazhi > 0) { $counttime = $counttime + $chazhi; } else { $counttime = $counttime - abs($chazhi); } $code = $ex_code[$ex_rand]; /* $tempinfo = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '$shop[id]' and `shopqishu` = '$shop[qishu]' and `goucode` LIKE '%$code%'"); //本来的中奖码对应的记录 $str=str_replace($code,$ex_code[0],$tempinfo['goucode']); $db->Query("update `@#_member_go_record` set goucode='$str' where id='{$tempinfo['id']}'"); //将系统原来的中奖吗对应的购买记录换成指定中奖会员购买的code $str2=str_replace($ex_code[0],$code,$ex_info['goucode']); $db->Query("update `@#_member_go_record` set goucode='$str2' where id='{$ex_info['id']}'"); //将指定中奖会员的购买记录中的code换成系统计算出来的中奖吗 */ //添加时间校准 if (!empty($chazhi)) { $last_info = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}' order by id desc limit 1"); $time_t_str = str_replace('.', '', $last_info['time']); $time_str = bcadd($time_t_str, $chazhi); $time_arr = str_split($time_str, 10); $str_t_time = $time_arr[0] . '.' . $time_arr[1]; $db->Query("UPDATE `@#_member_go_record` SET `time`='{$str_t_time}' where `id` = '{$last_info['id']}'"); $tocode = System::load_app_class("tocode", "pay"); $tocode->shop = $shop; $tocode->run_tocode($time, 100, $shop['canyurenshu'], $shop); $content = addslashes($tocode->go_content); } } } } ///////////////// $u_go_info = $db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}' and `goucode` LIKE '%{$code}%'"); $u_info = $db->GetOne("select uid,username,email,mobile,img from `@#_member` where `uid` = '{$u_go_info['uid']}'"); //更新商品 $query = true; if ($u_info) { $u_info['username'] = _htmtocode($u_info['username']); $q_user = serialize($u_info); $gtimes = (int) System::load_sys_config('system', 'goods_end_time'); if ($gtimes == 0 || $gtimes == 1) { $q_showtime = 'N'; } else { $q_showtime = 'Y'; } $sqlss = "UPDATE `@#_shoplist` SET\n\t\t\t\t\t\t\t`canyurenshu`=`zongrenshu`,\n\t\t\t\t\t\t\t`shenyurenshu` = '0',\n\t\t\t\t\t\t\t`q_uid` = '{$u_info['uid']}',\n\t\t\t\t\t\t\t`q_user` = '{$q_user}',\n\t\t\t\t\t\t\t`q_user_code` = '{$code}',\n\t\t\t\t\t\t\t`q_content`\t= '{$content}',\n\t\t\t\t\t\t\t`q_counttime` ='{$counttime}',\n\t\t\t\t\t\t\t`q_end_time` = '{$time}',\n\t\t\t\t\t\t\t`q_showtime` = '{$q_showtime}'\n\t\t\t\t\t\t\t where `id` = '{$shop['id']}'"; $q = $db->Query($sqlss); if (!$q) { $query = false; } if ($q) { $q = $db->Query("UPDATE `@#_member_go_record` SET `huode` = '{$code}' where `id` = '{$u_go_info['id']}' and `code` = '{$u_go_info['code']}' and `uid` = '{$u_go_info['uid']}' and `shopid` = '{$shop['id']}' and `shopqishu` = '{$shop['qishu']}'"); if (!$q) { $query = false; } else { $post_arr = array("uid" => $u_info['uid'], "gid" => $shop['id'], "send" => 1); _g_triggerRequest(WEB_PATH . '/api/send/send_shop_code', false, $post_arr); } } else { $query = false; } } else { $query = false; } /******************************/ /*新建*/ if ($query) { if ($shop['qishu'] < $shop['maxqishu']) { $maxinfo = $db->GetOne("select * from `@#_shoplist` where `sid` = '{$shop['sid']}' order by `qishu` DESC LIMIT 1"); if (!$maxinfo) { $maxinfo = array("qishu" => $shop['qishu']); } if (!$maxinfo) { $maxinfo = array("qishu" => $shop['qishu']); System::load_app_fun("content", G_ADMIN_DIR); $intall = content_add_shop_install($maxinfo, false); if (!$intall) { return $query; } } else { if ($maxinfo['id'] == $shop['id']) { System::load_app_fun("content", G_ADMIN_DIR); $intall = content_add_shop_install($maxinfo, false); if (!$intall) { return $query; } } } } } return $query; }
private function qq_add_member() { $go_user_info = $this->qc->get_user_info(); $member_db = System::load_app_class('base', 'member'); $memberone = $member_db->get_user_info(); if ($memberone) { $go_user_id = $memberone['uid']; $qq_openid = $this->qq_openid; $go_user_time = time(); $this->db->Query("INSERT INTO `@#_member_band` (`b_uid`, `b_type`, `b_code`, `b_time`) VALUES ('{$go_user_id}', 'qq', '{$qq_openid}', '{$go_user_time}')"); $bands = trim($memberones['band'], ","); $bands = $bands . ",qq"; $this->db->Query("UPDATE `@#_member` SET `band` = '{$bands}' where `uid` = '{$go_user_id}' limit 1"); _message("QQ绑定成功", G_WEB_PATH); return; } $go_user_time = time(); if (!$go_user_info) { $go_user_info = array('nickname' => 'QU' . $go_user_time . rand(0, 9)); } $go_y_user = $this->db->GetOne("select * from `@#_member` where `username` = '{$go_user_info['nickname']}' LIMIT 1"); if ($go_y_user) { $go_user_info['nickname'] .= rand(1000, 9999); } $go_user_name = _htmtocode($go_user_info['nickname']); $go_user_img = 'photo/member.jpg'; $go_user_pass = md5('123456'); $qq_openid = $this->qq_openid; $this->db->Autocommit_start(); $q1 = $this->db->Query("INSERT INTO `@#_member` (`username`,`password`,`img`,`band`,`time`) VALUES ('{$go_user_name}','{$go_user_pass}','{$go_user_img}','qq','{$go_user_time}')"); $go_user_id = $this->db->insert_id(); $q2 = $this->db->Query("INSERT INTO `@#_member_band` (`b_uid`, `b_type`, `b_code`, `b_time`) VALUES ('{$go_user_id}', 'qq', '{$qq_openid}', '{$go_user_time}')"); if ($q1 && $q2) { $this->db->Autocommit_commit(); $this->qq_set_member($go_user_id, 'add'); } else { $this->db->Autocommit_rollback(); _message("登录失败!", G_WEB_PATH); } }
function _get_ip_dizhi($ip = null) { $opts = array('http' => array('method' => "GET", 'timeout' => 5)); $context = stream_context_create($opts); if ($ip) { $ipmac = $ip; } else { $ipmac = _get_ip(); if (strpos($ipmac, "127.0.0.") === true) { return ''; } } $url_ip = 'http://ip.taobao.com/service/getIpInfo.php?ip=' . $ipmac; $str = @file_get_contents($url_ip, false, $context); if (!$str) { return ""; } $json = json_decode($str, true); if ($json['code'] == 0) { $json['data']['region'] = addslashes(_htmtocode($json['data']['region'])); $json['data']['city'] = addslashes(_htmtocode($json['data']['city'])); $ipcity = $json['data']['region'] . $json['data']['city']; $ip = $ipcity . ',' . $ipmac; } else { $ip = ""; } return $ip; // return filter_var($ip, FILTER_VALIDATE_IP) ? $ip : ''; }
function address() { $mysql_model = System::load_sys_class('model'); $member = $this->userinfo; $title = "收货地址"; $member_dizhi = $mysql_model->Getlist("select * from `@#_member_dizhi` where uid='" . $member['uid'] . "' limit 5"); foreach ($member_dizhi as $k => $v) { $member_dizhi[$k] = _htmtocode($v); } $count = count($member_dizhi); include templates("mobile/invite", "address"); }
public function autolottery_ret_install() { if (!isset($_POST['shopid'])) { echo '-1'; exit; } $id = intval($_POST['shopid']); $this->db->Autocommit_start(); $shop_info = $this->db->GetOne("select * from `@#_shoplist` where `id` = '{$id}' for update"); if (!$shop_info) { echo '-1'; exit; } if ($shop_info['xsjx_time'] > time()) { echo "-4"; exit; } if ($shop_info['canyurenshu'] == '0') { //$shop_info['canyurenshu'] = rand(1,$shop_info['zongrenshu']); echo '-3'; exit; } if (!empty($shop_info['q_user_code']) && $shop_info['q_showtime'] == 'Y') { echo '-6'; exit; } if (!empty($shop_info['q_user_code']) && $shop_info['q_showtime'] == 'N') { echo $shop_info['q_user_code'] . "sdfdsfsdfdsfsdf"; exit; } $shop_info['xsjx_time'] = $shop_info['xsjx_time'] . '.000'; $tocode = System::load_app_class("tocode", "pay"); $tocode->run_tocode($shop_info['xsjx_time'], 100, $shop_info['canyurenshu']); $code = $tocode->go_code; $content = addslashes($tocode->go_content); $counttime = $tocode->count_time; $u_go_info = $this->db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop_info['id']}' and `shopqishu` = '{$shop_info['qishu']}' and `goucode` LIKE '%{$code}%'"); if ($u_go_info) { $u_info = $this->db->GetOne("select * from `@#_member` where `uid` = '{$u_go_info['uid']}'"); $u_info['username'] = _htmtocode($u_info['username']); $q_user = serialize($u_info); $q_uid = $u_info['uid']; } else { $reg_code = $this->suan_zd_code($shop_info['id'], $code); if (!$reg_code) { echo '-2'; exit; } $u_go_info = $this->db->GetOne("select * from `@#_member_go_record` where `shopid` = '{$shop_info['id']}' and `shopqishu` = '{$shop_info['qishu']}' and `goucode` LIKE '%{$reg_code}%'"); $u_info = $this->db->GetOne("select * from `@#_member` where `uid` = '{$u_go_info['uid']}'"); $u_info['username'] = addslashes($u_info['username']); $q_user = serialize($u_info); $q_uid = $u_info['uid']; } $q_1 = $this->db->Query("UPDATE `@#_shoplist` SET\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`q_uid` = '{$q_uid}',\n\t\t\t\t\t\t\t\t`q_user` = '{$q_user}',\n\t\t\t\t\t\t\t\t`q_user_code` = '{$code}',\n\t\t\t\t\t\t\t\t`q_content`\t= '{$content}',\n\t\t\t\t\t\t\t\t`q_counttime` ='{$counttime}',\n\t\t\t\t\t\t\t\t`q_end_time` = '{$shop_info['xsjx_time']}',\n\t\t\t\t\t\t\t\t`q_showtime` = 'Y'\n\t\t\t\t\t\t\t\t where `id` = '{$id}'"); if ($u_go_info) { $q_2 = $this->db->Query("UPDATE `@#_member_go_record` SET `huode` = '{$code}' where `id` = '{$u_go_info['id']}'"); } else { $q_2 = true; } $q_3 = $this->autolottery_install($shop_info); if ($q_1 && $q_2 && $q_3) { $this->db->Autocommit_commit(); //echo $code."云购码";exit; echo '-6'; exit; } else { $this->db->Autocommit_rollback(); echo '-2'; exit; } }
public function usermodify() { $mysql_model = System::load_sys_class('model'); $member = $this->userinfo; if (isset($_POST['submit'])) { $username = _htmtocode(trim($_POST['username'])); $qianming = _htmtocode(trim($_POST['qianming'])); $reg_user_str = $this->db->GetOne("select value from `@#_caches` where `key` = 'member_name_key' limit 1"); $reg_user_str = explode(",", $reg_user_str['value']); if (is_array($reg_user_str) && !empty($username)) { foreach ($reg_user_str as $rv) { if ($rv == $username) { _message("此昵称禁止使用!"); } } } //福分、经验添加 $isset_user = $this->db->GetOne("select `uid` from `@#_member_account` where (`content`='手机认证完善奖励' or `content`='完善昵称奖励') and `type`='1' and `uid`='{$member['uid']}' and (`pay`='经验' or `pay`='福分')"); if (!$isset_user) { $config = System::load_app_config("user_fufen"); //福分/经验 $time = time(); $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','福分','完善昵称奖励','{$config['f_overziliao']}','{$time}')"); $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$member['uid']}','1','经验','完善昵称奖励','{$config['z_overziliao']}','{$time}')"); $mysql_model->Query("UPDATE `@#_member` SET username='******',qianming='" . $qianming . "',`score`=`score`+'{$config['f_overziliao']}',`jingyan`=`jingyan`+'{$config['z_overziliao']}' where uid='" . $member['uid'] . "'"); } $mysql_model->Query("UPDATE `@#_member` SET username='******',qianming='" . $qianming . "' where uid='" . $member['uid'] . "'"); _message("修改成功", WEB_PATH . "/member/home/modify", 3); } }
public function hueifuinsert() { $uid = $this->userinfo['uid']; if ($uid == null) { _message("未登录"); } if (!isset($_POST['submit'])) { exit; } $group_syzm = _getcookie("checkcode"); $group_pyzm = isset($_POST['group_code']) ? strtoupper($_POST['group_code']) : ''; if (empty($group_pyzm)) { _message("请输入验证码"); } if ($group_syzm != md5($group_pyzm)) { _message("验证码不正确"); } $qzid = intval($_POST['qzid']); $qzinfo = $this->db->GetOne("SELECT * FROM `@#_quanzi` WHERE `id` = '{$qzid}'"); if (!$qzinfo || $qzinfo['huifu'] == 'N') { _message("该圈子禁用回复!"); } $hueifu = _htmtocode($_POST['hueifu']); if ($hueifu == null) { _message("内容不能为空"); } $tzid = intval($_POST['tzid']); if ($tzid <= 0) { _message("错误"); } $hftime = time(); if ($qzinfo['shenhe'] == 'Y') { $shenhe = 'N'; } else { $shenhe = 'Y'; } $this->db->Query("INSERT INTO `@#_quanzi_tiezi`(`qzid`,`tiezi`,`hueiyuan`,`neirong`,`shenhe`,`time`)VALUES('{$qzid}','{$tzid}','{$uid}','{$hueifu}','{$shenhe}','{$hftime}')"); $tiezi = $this->db->GetOne("select * from `@#_quanzi_tiezi` where `id`='{$tzid}'"); $hfnum = $tiezi['hueifu'] + 1; $this->db->Query("UPDATE `@#_quanzi_tiezi` SET `hueifu`='{$hfnum}' where `id`='{$tzid}'"); if ($qzinfo['shenhe'] == 'Y') { _message("添加成功,需要管理员审核"); } _message("添加成功"); }