예제 #1
0
 public function edit()
 {
     $brandid = intval($this->segment(4));
     $brands = $this->db()->Getone("select * from `@#_brand` where id='{$brandid}'");
     if (!$brands) {
         _message("参数错误!");
     }
     $categorys = $this->db->GetList("SELECT * FROM `@#_category` WHERE 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);
     $topcat = $this->db->GetOne("SELECT * FROM `@#_category` WHERE `cateid` = '{$brands['cateid']}'");
     $categoryshtml .= "<option value='{$topcat['cateid']}' selected>≡ {$topcat['name']} ≡</option>";
     if (isset($_POST['dosubmit'])) {
         $info = array();
         $info['cateid'] = intval($_POST['cateid']);
         if (!$info['cateid']) {
             _message("请选择所属栏目");
         }
         $info['name'] = htmlspecialchars($_POST['name']);
         $info['order'] = intval($_POST['order']) ? intval($_POST['order']) : 1;
         $sql = "UPDATE `@#_brand` SET `cateid`='{$info['cateid']}', `name`='{$info['name']}', `order`='{$info['order']}' WHERE (`id`='{$brandid}') LIMIT 1";
         $this->db->Query($sql);
         if ($this->db->affected_rows()) {
             _message("操作成功!", WEB_PATH . '/' . ROUTE_M . '/brand/lists');
         } else {
             _message("操作失败!");
         }
     }
     include $this->tpl(ROUTE_M, 'brand.edit');
 }
예제 #2
0
 public function upimage()
 {
     //System::load_app_class('Uploader','','no');
     //上传图片框中的描述表单名称,
     //$title = htmlspecialchars($_POST['pictitle'], ENT_QUOTES);
     //$path = htmlspecialchars($_POST['dir'], ENT_QUOTES);
     if (!isset($_POST['pictitle']) && !isset($_FILES['upfile'])) {
         exit;
     }
     $title = $_POST['pictitle'];
     $path = G_UPLOAD . 'shopimg/';
     System::load_sys_class('upload', 'sys', 'no');
     upload::upload_config(array('png', 'jpg', 'jpeg', 'gif'), 500000, 'shopimg');
     upload::go_upload($_FILES['upfile']);
     if (!upload::$ok) {
         $url = '';
         $title = $title;
         $originalName = '';
         $state = upload::$error;
     } else {
         $url = G_UPLOAD_PATH . '/shopimg/' . upload::$filedir . "/" . upload::$filename;
         $title = $title;
         $originalName = '';
         $state = 'SUCCESS';
     }
     echo "{'url':'" . $url . "','title':'" . $title . "','original':'" . $originalName . "','state':'" . $state . "'}";
     //{'url':'upload/20130728/13749880933714.jpg','title':'梨花.jpg','original':'梨花.jpg','state':'SUCCESS'}
 }
예제 #3
0
 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata']);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
예제 #4
0
 public function adminuser()
 {
     $curtime = time();
     $ruleinfo = $this->db->GetOne("select * from `@#_egglotter_rule` where `starttime`<='{$curtime}' and `endtime`>='{$curtime}' and `startusing`=1");
     $rule_id = $ruleinfo['rule_id'];
     $spoilinfo = $this->db->GetList("select * from `@#_egglotter_spoil` where `rule_id`='{$rule_id}'");
     $spoil_id = $spoilinfo[2]['spoil_id'];
     //分页
     $num = 30;
     $total = $this->db->GetCount("select * from `@#_egglotter_award` where `spoil_id`!='{$spoil_id}' ");
     $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;
     }
     $award = $this->db->GetPage("select * from `@#_egglotter_award` where `spoil_id`!='{$spoil_id}'  order by `award_id` DESC", array("num" => $num, "page" => $pagenum, "type" => 1, "cache" => 0));
     $rule = $this->db->GetList("select * from `@#_egglotter_rule`");
     $slinfo = $this->db->GetList("select * from `@#_egglotter_spoil` ");
     $member = $this->db->GetList("select * from `@#_member`");
     //print_r($award);
     include "tpl/egglotter_user.adminuser.php";
 }
예제 #5
0
 private function config_jsdz()
 {
     $this->db = System::load_sys_class('model');
     $param = array("version" => "1.0", "token" => "", "merchantNum" => ConfigUtil::get_val_by_key('merchantNum'), "merchantRemark" => $this->config['shouname'], "tradeNum" => $this->config['code'], "tradeName" => $this->config['title'], "tradeDescription" => $this->config['title'], "tradeTime" => date('Y-m-d H:i:s', time()), "tradeAmount" => $this->config['money'] * 100, "currency" => "CNY", "notifyUrl" => $this->config['NotifyUrl'], "successCallbackUrl" => $this->config['ReturnUrl'], "failCallbackUrl" => $this->config['ReturnUrl']);
     $sign = SignUtil::sign($param);
     $param["merchantSign"] = $sign;
     if ($param["version"] == "1.0") {
         //敏感信息未加密
     } else {
         if ($param["version"] == "2.0") {
             //敏感信息加密
             //获取商户 DESkey
             //对敏感信息进行 DES加密
             $desUtils = new DesUtils();
             $key = ConfigUtil::get_val_by_key("desKey");
             $param["merchantRemark"] = $desUtils->encrypt($param["merchantRemark"], $key);
             $param["tradeNum"] = $desUtils->encrypt($param["tradeNum"], $key);
             $param["tradeName"] = $desUtils->encrypt($param["tradeName"], $key);
             $param["tradeDescription"] = $desUtils->encrypt($param["tradeDescription"], $key);
             $param["tradeTime"] = $desUtils->encrypt($param["tradeTime"], $key);
             $param["tradeAmount"] = $desUtils->encrypt($param["tradeAmount"], $key);
             $param["currency"] = $desUtils->encrypt($param["currency"], $key);
             $param["notifyUrl"] = $desUtils->encrypt($param["notifyUrl"], $key);
             $param["successCallbackUrl"] = $desUtils->encrypt($param["successCallbackUrl"], $key);
             $param["failCallbackUrl"] = $desUtils->encrypt($param["failCallbackUrl"], $key);
         }
     }
     $cbjpaySubmit = new CbjpaySubmit($param);
     $this->url = $cbjpaySubmit->buildRequestForm($param, 'POST', 'submit');
 }
예제 #6
0
 public static function config($config = array())
 {
     if (!is_array($config)) {
         return false;
     }
     self::$config = $config;
     self::$mail = System::load_sys_class("phpmailer");
     self::$mail->IsSMTP();
     // 启用SMTP
     self::$mail->Host = $config['stmp_host'];
     //SMTP服务器
     self::$mail->SMTPAuth = true;
     //开启SMTP认证
     self::$mail->Username = $config['user'];
     // SMTP用户名
     self::$mail->Password = $config['pass'];
     // SMTP密码
     self::$mail->From = $config['from'];
     //发件人地址
     self::$mail->FromName = $config['fromName'];
     //发件人
     self::$mail->AddReplyTo($config['from'], $config['fromName']);
     //回复地址
     self::$mail->WordWrap = 50;
     //设置每行字符长度
 }
예제 #7
0
 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     $watermark = $_POST['iswatermark'] == "true" ? "yes" : "no";
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     System::load_app_class("admin", G_ADMIN_DIR, "no");
     $admincheck = admin::StaticCheckAdminInfo() ? 1 : 0;
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata'], $watermark);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
예제 #8
0
 protected final function view($module = '', $template = '', $StyleTheme = '')
 {
     if (empty($StyleTheme)) {
         $style = G_STYLE . DIRECTORY_SEPARATOR . G_STYLE_HTML;
     } else {
         $templates = System::load_sys_config('templates', $style);
         $style = $templates['dir'] . DIRECTORY_SEPARATOR . $templates['html'];
     }
     $FileTpl = G_CACHES . 'caches_template' . DIRECTORY_SEPARATOR . dirname($style) . DIRECTORY_SEPARATOR . md5($module . '.' . $template) . '.tpl.php';
     $FileHtml = G_TEMPLATES . $style . DIRECTORY_SEPARATOR . $module . '.' . $template . '.html';
     if (file_exists($FileHtml)) {
         if (file_exists($FileTpl) && @filemtime($FileTpl) >= @filemtime($FileHtml)) {
             return include $FileTpl;
         } else {
             $template_cache = System::load_sys_class('template_cache');
             if (!is_dir(dirname(dirname($FileTpl)))) {
                 mkdir(dirname(dirname($FileTpl)), 0777, true) or die("Not Dir");
                 chmod(dirname(dirname($FileTpl)), 0777);
             }
             if (!is_dir(dirname($FileTpl))) {
                 mkdir(dirname($FileTpl), 0777, true) or die("Not Dir");
                 chmod(dirname($FileTpl), 0777);
             }
             $PutFileTpl = $template_cache->template_init($FileTpl, $FileHtml, $module, $template);
             if ($PutFileTpl) {
                 return include $FileTpl;
             } else {
                 _error('template message', 'The "' . $module . '.' . $template . '" template file does not exist');
             }
         }
     }
     _error('template message', 'The "' . $module . '.' . $template . '" template file does not exist');
 }
예제 #9
0
 public function tag()
 {
     $search = $this->segment_array();
     array_shift($search);
     array_shift($search);
     array_shift($search);
     $search = implode('/', $search);
     if (!$search) {
         _message("输入搜索关键字");
     }
     $search = urldecode($search);
     $search = safe_replace($search);
     if (!_is_utf8($search)) {
         $search = iconv("GBK", "UTF-8", $search);
     }
     $mysql_model = System::load_sys_class('model');
     $search = str_ireplace("union", '', $search);
     $search = str_ireplace("select", '', $search);
     $search = str_ireplace("delete", '', $search);
     $search = str_ireplace("update", '', $search);
     $search = str_ireplace("/**/", '', $search);
     $title = $search . ' - ' . _cfg('web_name');
     $shoplist = $mysql_model->GetList("select title,thumb,id,sid,zongrenshu,canyurenshu,shenyurenshu,money from `@#_shoplist` WHERE shenyurenshu !=0 and `title` LIKE '%" . $search . "%' order by shenyurenshu desc");
     $list = count($shoplist);
     include templates("search", "search");
 }
예제 #10
0
 public function config($config = null)
 {
     include_once dirname(__FILE__) . "/wxpay/WxPayPubHelper.php";
     //引入文件需求
     /*echo "<pre/>";
     		print_r($config);exit;*/
     $this->config = $config;
     $this->db = System::load_sys_class('model');
     $pay_type = $this->db->GetOne("SELECT * from `@#_pay` where `pay_class` = 'wxpay' and `pay_start` = '1'");
     $pay_type_key = unserialize($pay_type['pay_key']);
     WxPayConf_pub::$APPID = $pay_type_key['APPID']['val'];
     //微信的APPID
     WxPayConf_pub::$MCHID = $pay_type_key['MCHID']['val'];
     //微信商户号
     WxPayConf_pub::$KEY = $pay_type_key['KEY']['val'];
     //微信支付秘钥
     WxPayConf_pub::$APPSECRET = $pay_type_key['APPSECRET']['val'];
     WxPayConf_pub::$NOTIFY_URL = $config['NotifyUrl'];
     if ($config['type'] == 1) {
         $this->config_jsdz();
     }
     if ($config['type'] == 2) {
         $this->config_dbjy();
     }
 }
예제 #11
0
 private function send_insert($uid, $gid, $username, $shoptitle, $send_type)
 {
     $db = System::load_sys_class("model");
     $time = time();
     $sql = "INSERT INTO `@#_send` (`uid`,`gid`,`username`,`shoptitle`,`send_type`,`send_time`) VALUES ";
     $sql .= "('{$uid}','{$gid}','{$username}','{$shoptitle}','{$send_type}','{$time}')";
     $db->Query($sql);
 }
예제 #12
0
 public function buyrecordbai()
 {
     $this->db = System::load_sys_class("model");
     $res = $this->db->GetOne("select sum(gonumber) gonumber from `@#_member_go_record`");
     $this->db->query("update `@#_caches` set value='{$res['gonumber']}' where `key`='goods_count_num'");
     $RecordList = $this->db->GetList("select username,uid,shopid,shopname,shopqishu,gonumber,time from `@#_member_go_record` where 1 order by id desc limit 0,100");
     include templates("index", "buyrecordbai");
 }
예제 #13
0
 public function init()
 {
     $mysql_model = System::load_sys_class('model');
     $title = "友情链接";
     $link_size = $mysql_model->GetList("select * from `@#_link` where `type`='1'");
     $link_img = $mysql_model->GetList("select * from `@#_link` where `type`='2'");
     include templates("link", "link");
 }
예제 #14
0
 public function __construct()
 {
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
     header("Cache-Control: no-cache, must-revalidate");
     header("Pragma:no-cache");
     $this->Cartlist = _getcookie('Cartlist');
     $this->db = System::load_sys_class("model");
 }
예제 #15
0
 public function init()
 {
     $this->db = System::load_sys_class("model");
     $e_id = intval($this->segment(4));
     $this->db->Query("UPDATE  `@#_encourage_award`  SET  `e_get`='Y'  where `e_id`='{$e_id}'");
     //_message("修改成功");
     echo "<script>alert('修改成功!');window.location.href='" . WEB_PATH . "/encourage_award/encourage_award/init';</script>";
 }
예제 #16
0
 public function __construct()
 {
     parent::__construct();
     $this->db = System::load_sys_class('model');
     $this->ment = array(array("init", "模板管理", ROUTE_M . '/' . ROUTE_C . "/init"));
     $this->templates = System::load_sys_config("templates");
     $this->thistemp = System::load_sys_config("system", "templates_name");
 }
예제 #17
0
 public function init()
 {
     $db = System::load_sys_class("model");
     $q = $db->Query("\t\t\n\t\t\tCREATE TABLE `@#_qqset` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `qq` varchar(11) DEFAULT NULL,\n\t\t\t  `name` varchar(50) DEFAULT NULL,\n\t\t\t  `type` varchar(20) DEFAULT NULL,\n\t\t\t  `province` varchar(50) DEFAULT NULL,\n\t\t\t  `city` varchar(50) DEFAULT NULL,\n\t\t\t  `county` varchar(50) DEFAULT NULL,\n\t\t\t  `qqurl` varchar(250) DEFAULT NULL,\n\t\t\t  `full` varchar(6) DEFAULT NULL COMMENT '是否已满',\n\t\t\t  `subtime` int(11) DEFAULT NULL,\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;\n\t\t");
     if ($q) {
         unlink(__FILE__);
         _message("升级成功");
     }
 }
예제 #18
0
 public function config($config = null)
 {
     if (empty($_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false && strpos($_SERVER['HTTP_USER_AGENT'], 'Windows Phone') === false) {
         header('Location: ' . WEB_PATH . '/pay/wxpay_web_url/payinfo/nowechat');
         die;
     }
     include_once dirname(__FILE__) . "/wxpay/WxPayPubHelper.php";
     if (empty($config['pay_type_data'])) {
         $this->db = System::load_sys_class('model');
         $pay = $this->db->GetOne("SELECT * from `@#_pay` where `pay_class` = 'wxpay_web'");
         $config['pay_type_data'] = unserialize($pay['pay_key']);
     }
     WxPayConf_pub::$APPID = $config['pay_type_data']['APPID']['val'];
     WxPayConf_pub::$MCHID = $config['pay_type_data']['MCHID']['val'];
     WxPayConf_pub::$KEY = $config['pay_type_data']['KEY']['val'];
     WxPayConf_pub::$APPSECRET = $config['pay_type_data']['APPSECRET']['val'];
     $jsApi = new JsApi_pub();
     if (!isset($_GET['code'])) {
         $url = G_WEB_PATH . '/index.php/pay/wxpay_web_url/?money=' . $config['money'] . '&out_trade_no=' . $config['code'];
         $url = $jsApi->createOauthUrlForCode(urlencode($url));
         header("Location: {$url}");
         die;
     } else {
         $jsApi->setCode($_GET['code']);
         $openid = $jsApi->getOpenId();
     }
     //		var_dump($_GET);
     //		echo $openid;die;
     WxPayConf_pub::$SSLCERT_PATH = dirname(__FILE__) . '/cacert/apiclient_cert.pem';
     WxPayConf_pub::$SSLKEY_PATH = dirname(__FILE__) . '/cacert/apiclient_key.pem';
     //=========步骤2:使用统一支付接口,获取prepay_id============
     //使用统一支付接口
     $unifiedOrder = new UnifiedOrder_pub();
     //设置统一支付接口参数
     //设置必填参数
     //appid已填,商户无需重复填写
     //mch_id已填,商户无需重复填写
     //noncestr已填,商户无需重复填写
     //spbill_create_ip已填,商户无需重复填写
     //sign已填,商户无需重复填写
     $unifiedOrder->setParameter("openid", $openid);
     $unifiedOrder->setParameter("body", "购买商品");
     //商品描述
     $unifiedOrder->setParameter("out_trade_no", $config['code']);
     //商户订单号
     $unifiedOrder->setParameter("total_fee", $config['money'] * 100);
     //总金额
     $unifiedOrder->setParameter("notify_url", $config['NotifyUrl']);
     //通知地址
     $unifiedOrder->setParameter("trade_type", "JSAPI");
     //交易类型
     $prepay_id = $unifiedOrder->getPrepayId();
     //=========步骤3:使用jsapi调起支付============
     $jsApi->setPrepayId($prepay_id);
     $jsApiParameters = $jsApi->getParameters();
     include 'wxpay_web.html.php';
 }
예제 #19
0
 public function __construct()
 {
     $this->db = System::load_sys_class("model");
     if (G_CHARSET == 'utf-8') {
         $this->uppath .= 'utf8/';
     } elseif (G_CHARSET == 'gbk') {
         $this->uppath .= 'gbk/';
     }
 }
예제 #20
0
 public function __construct()
 {
     parent::__construct();
     $this->db = System::load_sys_class("model");
     $member = $this->userinfo;
     if (empty($member['uid'])) {
         _message('请先登录', WEB_PATH . '/member/user/login');
     }
 }
예제 #21
0
 public function lists()
 {
     $uid = intval($this->segment(4));
     $list_where = '';
     if (!$uid) {
         $list_where = "1";
     } else {
         $uid = "`uid` = '{$uid}'";
     }
     if (isset($_POST['sososubmit'])) {
         $posttime1 = !empty($_POST['posttime1']) ? strtotime($_POST['posttime1']) : NULL;
         $posttime2 = !empty($_POST['posttime2']) ? strtotime($_POST['posttime2']) : NULL;
         $sotype = $_POST['sotype'];
         $sosotext = $_POST['sosotext'];
         if ($posttime1 && $posttime2) {
             if ($posttime2 < $posttime1) {
                 _message("结束时间不能小于开始时间");
             }
             $list_where = "`addtime` > '{$posttime1}' AND `addtime` < '{$posttime2}'";
         }
         if ($posttime1 && empty($posttime2)) {
             $list_where = "`addtime` > '{$posttime1}'";
         }
         if ($posttime2 && empty($posttime1)) {
             $list_where = "`addtime` < '{$posttime2}'";
         }
         if (empty($posttime1) && empty($posttime2)) {
             $list_where = false;
         }
         if (!empty($sosotext)) {
             if ($sotype == 'uid') {
                 $sosotext = intval($sosotext);
                 if ($list_where) {
                     $list_where .= " AND a.uid = '{$sosotext}'";
                 } else {
                     $list_where = "a.uid = '{$sosotext}'";
                 }
             }
         } else {
             if (!$list_where) {
                 $list_where = '1';
             }
         }
     }
     $num = 20;
     $total = $this->db->GetCount("SELECT COUNT(*) FROM `@#_qzone` a LEFT JOIN `@#_member` b ON a.uid=b.uid WHERE {$list_where}");
     $page = System::load_sys_class('page');
     if (isset($_GET['p'])) {
         $pagenum = $_GET['p'];
     } else {
         $pagenum = 1;
     }
     $page->config($total, $num, $pagenum, "0");
     $arr = $this->db->GetPage("SELECT a.*,b.username,b.email,b.mobile FROM `@#_qzone` a LEFT JOIN `@#_member` b ON a.uid=b.uid WHERE {$list_where} ORDER BY id DESC", array("num" => $num, "page" => $pagenum, "type" => 1, "cache" => 0));
     include $this->tpl(ROUTE_M, 'qzonemanage');
 }
예제 #22
0
 public function init()
 {
     $this->db = System::load_sys_class('model');
     #获取全站点赞次数&已购买人次
     //$go_hits = $this->db->GetOne("select sum(hits) as hits from `@#_praise`");
     $go_count_renci = $this->db->GetOne("select value from `@#_caches` where `key` = 'goods_count_num'");
     //$go_count_renci
     $go_num = array("n" => $go_count_renci['value']);
     echo $go_num = json_encode($go_num);
 }
예제 #23
0
 public function get()
 {
     $db = System::load_sys_class('model');
     $fund = $db->GetOne("select * from `@#_fund` where `id`='1'");
     if ($fund && $fund['fund_off'] == 1) {
         echo $fund['fund_count_money'];
     } else {
         echo 0.0;
     }
 }
예제 #24
0
 public function __construct()
 {
     parent::__construct();
     /* 		if(ROUTE_A!='userphotoup' and ROUTE_A!='singphotoup'){
     			if(!$this->userinfo)_message("请登录",WEB_PATH."/mobile/user/login",3);
     		}	 */
     $this->db = System::load_sys_class('model');
     //查询购物车的信息
     $Mcartlist = _getcookie("Mcartlist");
     $this->Mcartlist = json_decode(stripslashes($Mcartlist), true);
 }
예제 #25
0
 function init()
 {
     $db = System::load_sys_class("model");
     $sql = "CREATE TABLE `@#_send` (\n\t\t\t  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t  `uid` int(10) unsigned NOT NULL,\n\t\t\t  `gid` int(10) unsigned NOT NULL,\n\t\t\t  `username` varchar(30) NOT NULL,\n\t\t\t  `shoptitle` varchar(200) NOT NULL,\n\t\t\t  `send_type` tinyint(4) NOT NULL,\n\t\t\t  `send_time` int(10) unsigned NOT NULL,\n\t\t\t  PRIMARY KEY (`id`),\n\t\t\t  KEY `uid` (`uid`),\n\t\t\t  KEY `gid` (`gid`),\n\t\t\t  KEY `send_type` (`send_type`)\n\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
     $q = $db->Query($sql);
     if ($q) {
         unlink(__FILE__);
         _message("数据库升级成功");
     }
     _message("数据库升级失败");
 }
예제 #26
0
 public function show()
 {
     parent::__construct();
     $p = $this->segment(4);
     if ($p == null) {
         $p = 1;
     }
     $num = 180;
     $total = $this->db->GetCount("SELECT COUNT(*) FROM `@#_shoplist` WHERE `q_uid` is null  order by `id` DESC");
     $page = System::load_sys_class('page');
     #if(isset($_GET['p'])){$pagenum=$_GET['p'];}else{$pagenum=1;}
     $page->config($total, $num, 1, "0");
     $shoplist = $this->db->GetPage("SELECT * FROM `@#_shoplist` WHERE `q_uid` is null  order by `id` DESC ", array("num" => $num, "page" => $p, "type" => 1, "cache" => 0));
     #获取配置文件信息
     $xml = $this->getxml();
     $times = $xml->times;
     //时间
     $endtimes = intval($xml->endtimes);
     $userid = explode("-", $xml->userid);
     //用户ID段
     $shopid = $xml->shopid;
     //商品ID 以“-” 分割
     $shopidarray = explode("-", $shopid);
     $oo = $xml->oo;
     //开启或关闭状态
     $runtime = $xml->runtime;
     //运行时间
     $autoadd = $xml->autoadd;
     //是否自动进入下一期
     $mshop = $xml->mshop;
     //是否购买多个商品
     $timeperiod = $xml->timeperiod;
     //时间段
     $tp = explode("-", $timeperiod);
     //线程是否异常停止
     $isstop = -1;
     //页码
     if ($p == 1) {
         $o_p = 1;
         $n_p = 2;
     } else {
         $o_p = $p - 1;
         $n_p = $p + 1;
     }
     /*----------判断线程是否死掉----------*/
     if ($oo == "on" && $runtime + $endtimes + 30 < time()) {
         $isstop = 0;
         //已经停止
     } else {
         $isstop = 1;
         //还在运行
     }
     include $this->tpl($this->autodir, 'auto_p');
 }
예제 #27
0
function renci()
{
    $mysql_model = System::load_sys_class('model');
    $recordx = $mysql_model->GetList("select * from `@#_member_go_record`");
    $s = 0;
    foreach ($recordx as $record) {
        $ma = explode(",", $record['goucode']);
        $s = $s + count($ma) - 1;
    }
    return $s;
}
예제 #28
0
 public function buy_count()
 {
     $db = System::load_sys_class('model');
     $info = $db->GetOne("select sum(gonumber) as count from `@#_member_go_record`");
     if (empty($info)) {
         echo json_encode(array("status" => 0, "count" => 12345));
         die;
     }
     echo json_encode(array("status" => 0, "count" => $info['count']));
     die;
 }
예제 #29
0
 private function send_insert($uid, $gid, $username, $shoptitle, $send_type)
 {
     $db = System::load_sys_class("model");
     $time = time();
     if ($send_type == '-1') {
         $sql = "INSERT INTO `@#_send` (`uid`,`gid`,`username`,`shoptitle`,`send_type`,`send_time`) VALUES ";
         $sql .= "('{$uid}','{$gid}','{$username}','{$shoptitle}','{$send_type}','{$time}')";
         $db->Query($sql);
     } else {
         $db->Query("UPDATE `@#_send` SET `send_type` = '{$send_type}' WHERE `gid` = '{$gid}' and `uid` = '{$uid}'");
     }
 }
예제 #30
0
 function sqlup()
 {
     $db = System::load_sys_class("model");
     $sds = $db->GetList("SELECT * FROM `@#_shaidan` WHERE 1");
     foreach ($sds as $k => $v) {
         $ginfo = $db->GetOne("SELECT sid,qishu FROM `@#_shoplist` WHERE `id` = '{$v['sd_shopid']}'");
         if ($ginfo) {
             $db->Query("UPDATE `@#_shaidan` SET `sd_shopsid` = '{$ginfo['sid']}',`sd_qishu`='{$ginfo['qishu']}' WHERE `sd_id` = '{$v['sd_id']}'");
         }
     }
     _message("晒单数据修复升级成功,跳转到数据修复! 不要关闭本页面", WEB_PATH . "/api/" . ROUTE_C . "/upok");
 }