private function goods_user_go($uid = null, $gid = null, $num = null) { System::load_sys_fun('user'); $good_info = $gid; $gid = $good_info['id']; $uinfo = $uid; $uid = $uinfo['uid']; $gtitle = $good_info['title']; $utitle = get_user_name($uinfo); $paydb = System::load_app_class('pay', 'pay'); $number = $num; $reg = $paydb->pay_user_go_shop($uid, $gid, $number); if ($reg) { $specify = $this->db->GetOne("select * from `@#_goodspecify` where `gid` = '{$gid}' and `uid` = '{$uid}'"); if ($specify) { $number = $specify['num'] + $number; $this->db->Query("UPDATE `@#_goodspecify` SET `num` = '{$number}' where `id` = '{$specify['id']}'"); } else { $inster = $this->db->Query("INSERT INTO `@#_goodspecify` (`uid`,`gid`,`num`,`utitle`,`gtitle`) VALUES ('{$uid}','{$gid}','{$number}','{$utitle}','{$gtitle}')"); if (!$inster) { _message("商品购买成功但准备会员插入失败!"); } } } return $reg; }
public function lottery_shop_json() { if (!isset($_GET['gid'])) { echo json_encode(array("error" => '1')); return; exit; } $gid = trim($_GET['gid']); $times = (int) System::load_sys_config('system', 'goods_end_time'); if (!$times) { $times = 1; } $db = System::load_sys_class('model'); $gid = safe_replace($gid); $gid = str_ireplace("select", "", $gid); $gid = str_ireplace("union", "", $gid); $gid = str_ireplace("'", "", $gid); $gid = str_ireplace("%27", "", $gid); $gid = trim($gid, ','); if (!$gid) { $info = $db->GetOne("select qishu,xsjx_time,id,zongrenshu,thumb,title,q_uid,q_user,q_user_code,q_end_time from `@#_shoplist` where `q_showtime` = 'Y' order by `q_end_time` ASC"); } else { $infos = $db->GetList("select qishu,xsjx_time,id,zongrenshu,thumb,title,q_uid,q_user,q_user_code,q_end_time from `@#_shoplist` where `q_showtime` = 'Y' order by `q_end_time` ASC limit 0,4"); $gid = @explode('_', $gid); $info = false; foreach ($infos as $infov) { if (!in_array($infov['id'], $gid)) { $info = $infov; break; } } } if (!$info) { echo json_encode(array("error" => '1')); return; exit; } if ($info['xsjx_time']) { $info['q_end_time'] = $info['q_end_time'] + $times; } System::load_sys_fun("user"); $user = unserialize($info['q_user']); $user = get_user_name($info['q_uid'], "username"); $uid = $info['q_uid']; $upload = G_UPLOAD_PATH; $q_time = substr($info['q_end_time'], 0, 10); if ($q_time <= time()) { $db->Query("update `@#_shoplist` SET `q_showtime` = 'N' where `id` = '{$info['id']}' and `q_showtime` = 'Y' and `q_uid` is not null"); echo json_encode(array("error" => '-1')); return; exit; } $user_shop_number = $db->GetOne("select sum(gonumber) as gonumber from `@#_member_go_record` where `uid`= '{$uid}' and `shopid` = '{$info['id']}' and `shopqishu` = '{$info['qishu']}'"); $user_shop_number = $user_shop_number['gonumber']; $times = $q_time - time(); echo json_encode(array("error" => "0", "user_shop_number" => "{$user_shop_number}", "user" => "{$user}", "zongrenshu" => $info['zongrenshu'], "q_user_code" => $info['q_user_code'], "qishu" => $info['qishu'], "upload" => $upload, "thumb" => $info['thumb'], "id" => $info['id'], "uid" => "{$uid}", "title" => $info['title'], "user" => $user, "times" => $times)); exit; }
public function next() { $webname = $this->_cfg['web_name']; //header("location: ".WEB_PATH); System::load_sys_fun('user'); $w_minri_time = strtotime(date('Y-m-d', strtotime("+1 day"))); $w_hinri_time = strtotime(date('Y-m-d', strtotime("+2 day"))); $shoplist = $this->db->GetList("select * from `@#_shoplist` where `xsjx_time` > '{$w_minri_time}' and `xsjx_time` < '{$w_hinri_time}' order by `xsjx_time` limit 0,3"); $count = count($shoplist); $titlets = '抱歉,明日还没有发布限时揭晓商品!'; $date = 'next'; $key = "限时"; include templates("mobile/index", "autolottery"); }
public function init() { //header("location: ".WEB_PATH); System::load_sys_fun('user'); $title = "限时揭晓" . "_" . $this->_cfg["web_name"]; $jinri_time = abs(date("m")) . '月' . date("d") . "日"; $minri_time = abs(date("m", strtotime("+1 day"))) . '月' . date("d", strtotime("+1 day")) . "日"; $w_jinri_time = strtotime(date('Y-m-d')); $w_minri_time = strtotime(date('Y-m-d', strtotime("+1 day"))); $w_hinri_time = strtotime(date('Y-m-d', strtotime("+2 day"))); $jinri_shoplist = $this->db->GetList("select * from `@#_shoplist` where `xsjx_time` > '{$w_jinri_time}' and `xsjx_time` < '{$w_minri_time}' order by id DESC limit 0,3"); $minri_shoplist = $this->db->GetList("select * from `@#_shoplist` where `xsjx_time` > '{$w_minri_time}' and `xsjx_time` < '{$w_hinri_time}' order by id DESC limit 0,3"); //往期回顾 $endshoplist = $this->db->GetList("select * from `@#_shoplist` where `xsjx_time` != '0' and `q_uid` != '0' order by `xsjx_time` DESC limit 0,8"); include templates("index", "autolottery"); }
<?php defined('G_IN_SYSTEM') or exit('no'); System::load_app_fun('global', G_ADMIN_DIR); System::load_app_fun('my', 'go'); System::load_app_fun('user', 'go'); System::load_app_class("base", "member", "no"); System::load_sys_fun('user'); class shaidan extends base { public $db; public function __construct() { parent::__construct(); $this->db = System::load_sys_class('model'); } public function init() { $title = "晒单分享"; $num = 40; $total = $this->db->GetCount("select * from `@#_shaidan` where 1"); $page = System::load_sys_class('page'); if (isset($_GET['p'])) { $pagenum = $_GET['p']; } else { $pagenum = 1; } $page->config($total, $num, $pagenum, "0"); if ($pagenum > $page->page) { $pagenum = $page->page; }
<?php defined('G_IN_SYSTEM') or exit('No permission resources.'); System::load_app_class('base', 'member', 'no'); System::load_app_fun('my', 'go'); System::load_app_fun('user', 'go'); System::load_sys_fun("user"); class us extends base { public function __construct() { $uid = abs(intval($this->segment(4))); if (!$uid) { _message("参数不正确!"); } if ($uid > 1000000000) { $uid = $uid - 1000000000; } $this->uid = $uid; } public function uname() { $mysql_model = System::load_sys_class('model'); $title = "个人主页"; $index = $this->uid; $tab = $this->segment(3); $member = $mysql_model->GetOne("select * from `@#_member` where uid='{$index}'"); if ($member) { $membergo = $mysql_model->GetList("select * from `@#_member_go_record` where uid='{$index}' order by `id` DESC limit 0,10 "); include templates("us", "index"); } else {
<?php defined('G_IN_SYSTEM') or exit('No permission resources.'); System::load_app_class('base', null, 'no'); System::load_app_fun('user', 'go'); System::load_app_fun('my', 'go'); System::load_sys_fun('send'); class user extends base { public function __construct() { parent::__construct(); $this->db = System::load_sys_class("model"); } public function cook_end() { _setcookie("uid", "", time() - 3600); _setcookie("ushell", "", time() - 3600); _message("退出成功", WEB_PATH); } public function login() { $user = $this->userinfo; if ($user) { header("Location:" . G_WEB_PATH); exit; } else { if (!$this->segment(4)) { global $_cfg; $url = WEB_PATH . '/' . $_cfg['param_arr']['url']; $url = rtrim($url, '/');
*/ $templates = System::load_sys_config('templates', System::load_sys_config('system', 'templates_name')); define("G_STYLE", $templates['dir']); define("G_STYLE_HTML", $templates['html']); define("G_TEMPLATES_PATH", G_WEB_PATH . '/' . $statics_path . '/templates'); define("G_TEMPLATES_STYLE", G_TEMPLATES_PATH . '/' . G_STYLE); define("G_TEMPLATES_CSS", G_TEMPLATES_PATH . '/' . G_STYLE . '/css'); define("G_TEMPLATES_JS", G_TEMPLATES_PATH . '/' . G_STYLE . '/js'); define("G_TEMPLATES_IMAGE", G_TEMPLATES_PATH . '/' . G_STYLE . '/images'); /* *--------------------------------------------------------------- * INCLUDE GLOBAL FUNCTION *--------------------------------------------------------------- * */ System::load_sys_fun('global'); /* *--------------------------------------------------------------- * error set *--------------------------------------------------------------- * */ if (System::load_sys_config('system', 'error')) { _error_handler(); } /* *--------------------------------------------------------------- * timezone set *--------------------------------------------------------------- * */
public function get_dingdan() { $code = abs(intval($this->segment(4))); $record = $this->db->GetOne("SELECT * FROM `@#_member_go_record` where `id`='{$code}'"); if (!$record) { _message("参数不正确!"); } if (isset($_POST['submit'])) { $record_code = explode(",", $record['status']); $status = $_POST['status']; $company = $_POST['company']; $company_code = $_POST['company_code']; $company_money = floatval($_POST['company_money']); $code = abs(intval($_POST['code'])); if (!$company_money) { $company_money = '0.00'; } else { $company_money = sprintf("%.2f", $company_money); } if ($status == '未完成') { $status = $record_code[0] . ',' . $record_code[1] . ',' . '未完成'; } if ($status == '已发货') { $status = '已付款,已发货,待收货'; } if ($status == '未发货') { $status = '已付款,未发货,未完成'; } if ($status == '已完成') { $status = '已付款,已发货,已完成'; } if ($status == '已作废') { $status = $record_code[0] . ',' . $record_code[1] . ',' . '已作废'; } $ret = $this->db->Query("UPDATE `@#_member_go_record` SET `status`='{$status}',`company` = '{$company}',`company_code` = '{$company_code}',`company_money` = '{$company_money}' where id='{$code}'"); if ($ret) { _message("更新成功"); } else { _message("更新失败"); } } System::load_sys_fun("user"); $uid = $record['uid']; $user = $this->db->GetOne("select * from `@#_member` where `uid` = '{$uid}'"); $user_dizhi = $this->db->GetOne("select * from `@#_member_dizhi` where `uid` = '{$uid}' and `default` = 'Y'"); $go_time = $record['time']; include $this->tpl(ROUTE_M, 'dingdan.code'); }