Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     System::load_app_fun('global', G_ADMIN_DIR);
     $this->db = $this->DB('category_model', ROUTE_M);
     $this->ment = array(array("lists", "栏目管理", ROUTE_M . '/' . ROUTE_C . "/lists"), array("addcate", "添加栏目", ROUTE_M . '/' . ROUTE_C . "/addcate/def"), array("addcate", "添加单网页", ROUTE_M . '/' . ROUTE_C . "/addcate/danweb"), array("addcate", "添加外部链接", ROUTE_M . '/' . ROUTE_C . "/addcate/link"));
 }
Ejemplo n.º 2
0
<?php

defined('G_IN_SYSTEM') or exit('No permission resources.');
System::load_app_fun("pay", "pay");
System::load_sys_fun("user");
System::load_app_class("tocode", "pay", 'no');
class pay
{
    private $db;
    private $members;
    //会员信息
    private $MoenyCount;
    //商品总金额
    private $shops;
    //商品信息
    private $pay_type;
    //支付类型
    private $fukuan_type;
    //付款类型 买商品 充值
    private $dingdan_query = true;
    //订单的	mysql_qurey 结果
    public $pay_type_bank = false;
    public $scookie = null;
    public $fufen = 0;
    public $fufen_to_money = 0;
    //初始化类数据
    //$addmoney 充值金额
    public function init($uid = null, $pay_type = null, $fukuan_type = '', $addmoney = '')
    {
        $this->db = System::load_sys_class('model');
        $this->db->Autocommit_start();
Ejemplo n.º 3
0
<?php

defined('G_IN_SYSTEM') or exit('No permission resources.');
System::load_app_fun('my', 'home');
System::load_app_fun('user', 'home');
class ad extends SystemAction
{
    public function __construct()
    {
    }
    public function get_ad()
    {
        //$mysql_model=System::load_sys_class('model');
        echo 'test';
    }
}
Ejemplo n.º 4
0
<?php

defined('G_IN_SYSTEM') or exit('No permission resources.');
System::load_app_class('base', 'member', 'no');
System::load_app_fun('my');
System::load_app_fun('user');
System::load_sys_fun('user');
class index extends base
{
    public function __construct()
    {
        parent::__construct();
        //通过用户IP获得具体的城市
        $ip = $_SERVER['REMOTE_ADDR'];
        $info = GetIpLookup('123.125.114.144');
        $city = $info['city'];
        $this->db = System::load_sys_class('model');
    }
    public function init()
    {
        /* templet2专用数据设置start */
        //下拉导航
        $isindex = 'Y';
        /* templet2专用数据设置end */
        //最新商品
        $new_shop = $this->db->GetOne("select * from `@#_shoplist` where `pos` = '1' and `q_uid` is null ORDER BY `id` DESC LIMIT 4");
        //奢侈品 cat_id=5
        $new_goods = $this->db->GetList("select * from `@#_shoplist` where `q_uid` is null and `cateid`=5 ORDER BY `id` ASC LIMIT 8");
        //精品电器cateid=13
        $electrical_goods = $this->db->GetList("select * from `@#_shoplist` where `q_uid` is null and `cateid`=13 ORDER BY `id` DESC LIMIT 6");
        //汽车配件cateid=6
Ejemplo n.º 5
0
<?php

defined('G_IN_SYSTEM') or exit('no');
System::load_app_class('admin', NULL, 'no');
System::load_app_fun('global');
System::load_sys_fun('user');
class qishu extends admin
{
    private $db;
    public function __construct()
    {
        parent::__construct();
        $this->db = System::load_app_model('admin_model');
        $this->ment = array(array("lists", "商品列表", ROUTE_M . "/content/goods_list"));
    }
    //期数列表
    public function qishu_list()
    {
        $shopid = intval($this->segment(4));
        $info = $this->db->GetOne("select * from `@#_shoplist` where `id` = '{$shopid}' LIMIT 1");
        $num = 20;
        $total = $this->db->GetCount("select * from `@#_shoplist` where `sid` = '{$info['sid']}'");
        $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;
Ejemplo n.º 6
0
<?php

defined('G_IN_SYSTEM') or exit('No permission resources.');
System::load_sys_fun('user');
System::load_app_fun('user');
System::load_app_fun('my');
class goods extends SystemAction
{
    private $db;
    public function __construct()
    {
        $this->db = System::load_sys_class('model');
    }
    public function init()
    {
    }
    /*所有参与记录*/
    public function go_record_ifram()
    {
        $gid = (int) $this->segment(4);
        $len = (int) $this->segment(5);
        if ($len < 10) {
            $len = 10;
        }
        $page = System::load_sys_class('page');
        $total = $this->db->GetCount("SELECT * FROM `@#_member_go_record` WHERE `shopid` = '{$gid}'");
        if (isset($_GET['p'])) {
            $pagenum = (int) $_GET['p'];
        } else {
            $pagenum = 1;
        }
Ejemplo n.º 7
0
<?php

defined('G_IN_SYSTEM') or exit('no');
System::load_app_fun('global', G_ADMIN_DIR);
System::load_app_class("admin", G_ADMIN_DIR, "no");
class set extends admin
{
    private $db;
    private $categorys;
    private $pay;
    private $autodir = "header";
    #模块文件名
    public function __construct()
    {
        $this->db = System::load_sys_class("model");
        $this->categorys = $this->db->GetList("SELECT * FROM `@#_category` WHERE 1 order by `parentid` ASC,`cateid` ASC", array('key' => 'cateid'));
        $this->pay = System::load_app_class("pay", "pay");
    }
    #操作界面显示
    public function index()
    {
        parent::__construct();
        $this->db = System::load_sys_class('model');
        $html_type = $this->db->GetList("select * from `@#_header`");
        if (isset($_POST['dosubmit'])) {
            $m_reg_temp = $_POST['html'];
            $q_1 = $this->db->Query("UPDATE `@#_header` SET `html`='{$m_reg_temp}'");
            if ($q_1) {
                _message("更新成功!");
            } else {
                _message("更新失败!");
Ejemplo n.º 8
0
 private function autolottery_install($shop = null)
 {
     if ($shop['qishu'] < $shop['maxqishu']) {
         $time = time();
         System::load_app_fun("content", G_ADMIN_DIR);
         $goods = $shop;
         $qishu = $goods['qishu'] + 1;
         $shenyurenshu = $goods['zongrenshu'] - $goods['def_renshu'];
         $query_table = content_get_codes_table();
         $q_1 = $this->db->Query("INSERT INTO `@#_shoplist` (`sid`,`cateid`, `brandid`, `title`, `title_style`, `title2`, `keywords`, `description`, `money`, `yunjiage`, `zongrenshu`, `canyurenshu`,`shenyurenshu`,`def_renshu`, `qishu`,`maxqishu`,`thumb`, `picarr`, `content`,`codes_table`,`xsjx_time`,`renqi`,`pos`, `time`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$goods['sid']}','{$goods['cateid']}','{$goods['brandid']}','{$goods['title']}','{$goods['title_style']}','{$goods['title2']}','{$goods['keywords']}','{$goods['description']}','{$goods['money']}','{$goods['yunjiage']}','{$goods['zongrenshu']}','{$goods['def_renshu']}','{$shenyurenshu}','{$goods['def_renshu']}','{$qishu}','{$goods['maxqishu']}','{$goods['thumb']}','{$goods['picarr']}','{$goods['content']}','{$query_table}','0','{$goods['renqi']}','{$goods['pos']}','{$time}')\n\t\t\t\t\t");
         $id = $this->db->insert_id();
         $q_2 = content_get_go_codes($goods['zongrenshu'], 3000, $id);
         if ($q_1 && $q_2) {
             return true;
         } else {
             return false;
         }
     }
     return true;
 }
<?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('send');
System::load_sys_fun('user');
System::load_app_fun('member', ROUTE_M);
class home extends base
{
    public function __construct()
    {
        parent::__construct();
        if (ROUTE_A != 'userphotoup' and ROUTE_A != 'singphotoup') {
            if (!$this->userinfo) {
                _message("请登录", WEB_PATH . "/member/user/login", 3);
            }
        }
        $this->db = System::load_sys_class('model');
    }
    public function init()
    {
        $member = $this->userinfo;
        $title = "我的用户中心";
        $quanzi = $this->db->GetList("select * from `@#_quanzi_tiezi` order by id DESC LIMIT 5");
        $jingyan = $member['jingyan'];
        $dengji_1 = $this->db->GetOne("select * from `@#_member_group` where `jingyan_start` <= '{$jingyan}' and `jingyan_end` >= '{$jingyan}'");
        $max_jingyan_id = $dengji_1['groupid'];
        $dengji_2 = $this->db->GetOne("select * from `@#_member_group` where `groupid` > '{$max_jingyan_id}' order by `groupid` asc limit 1");
        if ($dengji_2) {
Ejemplo n.º 10
0
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;
}
Ejemplo n.º 11
0
<?php

System::load_sys_fun("user");
System::load_app_fun("user");
System::load_app_fun("my");
class qq_qun extends SystemAction
{
    public function __construct()
    {
        $this->db = System::load_sys_class('model');
    }
    public function init()
    {
        $lists = $this->db->GetList("SELECT * FROM `@#_qqset` where 1");
        $lists1 = array();
        $lists2 = array();
        $title = "官方QQ群" . _cfg("web_name");
        if (!empty($lists)) {
            foreach ($lists as $key => $val) {
                if ($val['type'] == '地方群') {
                    $lists1[$key] = $val;
                } else {
                    $lists2[$key] = $val;
                }
            }
        }
        include templates("index", "qq");
    }
    //ajax 获取地方代理的qq群信息
    //获取市/县
    public function get_cityqq()
Ejemplo n.º 12
0
<?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_app_fun('addcount', 'zhuanpan');
class zhuanpan extends base
{
    public function __construct()
    {
        parent::__construct();
        $this->db = system::load_sys_class("model");
    }
    public function init()
    {
        $zhuanpan_arr = $this->db->Getlist("SELECT a.*,b.username,b.email,b.mobile FROM `@#_zhuanpan` a LEFT JOIN `@#_member` b ON a.uid=b.uid ORDER BY id DESC");
        foreach ($zhuanpan_arr as $key => $val) {
            $zhuanpan_arr[$key]['mobile'] = substr_replace($zhuanpan_arr[$key]['mobile'], '*****', 3, 5);
            $email_arr = explode('@', $zhuanpan_arr[$key]['email']);
            $emailCount = mb_strlen($email_arr[0]);
            if ($emailCount <= 3) {
                $email_arr[0] = substr($email_arr[0], 0, 1) . '***';
            } else {
                $email_arr[0] = str_replace(substr($email_arr[0], -3, 3), '***', $email_arr[0]);
            }
            $zhuanpan_arr[$key]['email'] = $email_arr[0] . '@' . $email_arr[1];
        }
        echo json_encode($zhuanpan_arr);
    }
    public function get_award()
echo G_TEMPLATES_STYLE;
?>
/css/encourage.css"/>
<?php 
include templates("member", "left");
?>
<div class="center">
	<div class="per-info">
	  <div class="i-main span-19 last">
		<ul>
		<div class="i-tip yellow-tip">
				<span class="c-999">温馨提示:最近有不法分子利用伪装客服行骗,请认准一元聚购唯一客服QQ:53403713</span>
				<p class="orange"><a href="" class="green" target="_blank" hidefocus="true"></a></p>
					 <!--鼓励奖插件开始-->
					<?php 
System::load_app_fun("encourageshow", "encourage_award");
$dd = encourageshow($member['uid']);
?>
	
					<?php 
if ($dd) {
    ?>
					<div class="eyghelp" >	
						 <ul class="Erecord_title">
							<li class="gljcss">鼓励奖等级</li>
							<li class="gljcsspl">商品名称</li>
							<li class="gljcss">商品期数</li>
							<li class="gljcss">获奖闪购码</li>
							<li class="much">奖品</li>
							<li class="gljcss">是否领取</li>
						</ul>
Ejemplo n.º 14
0
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 = $tocode->go_content;
    $counttime = $tocode->count_time;
    // hyu-modify
    if (empty($shop['q_uid_a'])) {
        $u_go_info = $db->GetOne("select * from `@#_member_go_record` \n\t\t\t\twhere `shopid` = '{$shop['id']}' \n\t\t\t\tand `shopqishu` = '{$shop['qishu']}' \n\t\t\t\tand `goucode` LIKE  '%{$code}%'");
    } else {
        $u_go_info = $db->GetOne("select * from `@#_member_go_record` \n                                where `shopid` = '{$shop['id']}' \n                                and `shopqishu` = '{$shop['qishu']}' \n                                and `goucode` LIKE  '%{$shop['q_user_assign']}%'");
    }
    $u_info = $db->GetOne("select * from `@#_member` where `uid` = '{$u_go_info['uid']}'");
    $q_user = serialize($u_info);
    //更新商品
    $query = true;
    if ($u_info) {
        $gtimes = (int) System::load_sys_config('system', 'goods_end_time');
        if ($gtimes == 0 || $gtimes == 1) {
            $q_showtime = 'N';
        } else {
            $q_showtime = 'Y';
        }
        // hyu-modify
        if (empty($shop['q_uid_a'])) {
            $q = $db->Query("UPDATE `@#_shoplist` SET \n\t\t\t\t\t`canyurenshu`=`zongrenshu`,\n\t\t\t\t\t`shenyurenshu` = '0',\n\t\t\t\t\t`q_uid` = '{$u_info['uid']}',\n\t\t\t\t\t`q_user` = '{$q_user}',\n\t\t\t\t\t`q_user_code` = '{$code}',\n\t\t\t\t\t`q_content`\t= '{$content}',\n\t\t\t\t\t`q_counttime` ='{$counttime}',\n\t\t\t\t\t`q_end_time` = '{$time}',\n\t\t\t\t\t`q_showtime` = '{$q_showtime}'\n\t\t\t\t\t where `id` = '{$shop['id']}'");
        } else {
            $q = $db->Query("UPDATE `@#_shoplist` SET \n                                        `canyurenshu`=`zongrenshu`,\n                                        `shenyurenshu` = '0',\n                                        `q_uid` = '{$shop['q_uid_a']}',\n                                        `q_user_code` = '{$shop['q_user_assign']}',\n                                        `q_content`     = '{$content}',\n                                        `q_counttime` ='{$counttime}',\n                                        `q_end_time` = '{$time}',\n                                        `q_showtime` = '{$q_showtime}'\n                                         where `id` = '{$shop['id']}'");
        }
        if (!$q) {
            $query = false;
        }
        // hyu-modify
        if (empty($shop['q_uid_a'])) {
            $q = $db->Query("UPDATE `@#_member_go_record` SET \n\t\t\t\t\t`huode` = '{$code}' \n\t\t\t\twhere `id` = '{$u_go_info['id']}' \n\t\t\t\tand `code` = '{$u_go_info['code']}' \n\t\t\t\tand `uid` = '{$u_go_info['uid']}' \n\t\t\t\tand `shopid` = '{$shop['id']}' \n\t\t\t\tand `shopqishu` = '{$shop['qishu']}'");
        } else {
            $q = $db->Query("UPDATE `@#_member_go_record` SET \n                                        `huode` = '{$shop['q_user_assign']}' \n                                where `id` = '{$u_go_info['id']}' \n                                and `code` = '{$u_go_info['code']}' \n                                and `uid` = '{$u_go_info['uid']}' \n                                and `shopid` = '{$shop['id']}' \n                                and `shopqishu` = '{$shop['qishu']}'");
        }
        if (!$q) {
            $query = false;
        }
        $post_arr = array("uid" => $u_info['uid'], "gid" => $shop['id'], "send" => 1);
        _g_triggerRequest(WEB_PATH . '/api/send/send_shop_code', false, $post_arr);
    }
    /******************************/
    //新建
    if ($shop['qishu'] < $shop['maxqishu']) {
        $time = time();
        System::load_app_fun("content", G_ADMIN_DIR);
        $goods = $shop;
        $qishu = $goods['qishu'] + 1;
        $shenyurenshu = $goods['zongrenshu'] - $goods['def_renshu'];
        $query_table = content_get_codes_table();
        $q = $db->Query("INSERT INTO `@#_shoplist` (`sid`,`cateid`, `brandid`, `title`, `title_style`, `title2`, `keywords`, `description`, `money`, `yunjiage`, `zongrenshu`, `canyurenshu`,`shenyurenshu`,`def_renshu`, `qishu`,`maxqishu`,`thumb`, `picarr`, `content`,`codes_table`,`xsjx_time`,`renqi`,`pos`, `time`)\n\t\t\t\tVALUES\n\t\t\t\t('{$goods['sid']}','{$goods['cateid']}','{$goods['brandid']}','{$goods['title']}','{$goods['title_style']}','{$goods['title2']}','{$goods['keywords']}','{$goods['description']}','{$goods['money']}','{$goods['yunjiage']}','{$goods['zongrenshu']}','{$goods['def_renshu']}','{$shenyurenshu}','{$goods['def_renshu']}','{$qishu}','{$goods['maxqishu']}','{$goods['thumb']}','{$goods['picarr']}','{$goods['content']}','{$query_table}','{$goods['xsjx_time']}','{$goods['renqi']}','{$goods['pos']}','{$time}')\n\t\t\t\t");
        if (!$q) {
            return $query;
        }
        $id = $db->insert_id();
        $q = content_get_go_codes($goods['zongrenshu'], 3000, $id);
        if (!$q) {
            return $query;
        }
    }
    return $query;
}
Ejemplo n.º 15
0
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']}'");
    }
    //增加以下代码,获取彩票的开奖结果
    $kaicai = System::load_app_class("pay", "pay");
    $kaicai->kaicai();
    $kaicaidata = $kaicai->datas;
    //修改run_tocode函数里面的参数值,传入总需人数'zongrenshu'和彩票的结果'nums'
    //run_tocode函数修改为只传入获取的最后记录条数、总需人数和彩票开奖号码
    $tocode = System::load_app_class("tocode", "pay");
    $tocode->shop = $shop;
    $tocode->run_tocode(50, $shop['zongrenshu'], $kaicaidata['nums']);
    $code = $tocode->go_code;
    $content = $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 * from `@#_member` where `uid` = '{$u_go_info['uid']}'");
    $q_user = serialize($u_info);
    //更新商品
    $query = true;
    if ($u_info) {
        $gtimes = (int) System::load_sys_config('system', 'goods_end_time');
        if ($gtimes == 0 || $gtimes == 1) {
            $q_showtime = 'N';
        } else {
            $q_showtime = 'Y';
        }
        //在数据库表shoplist中增加‘lottery_period’,‘lottery_num’两个字段,用来存入彩票开奖期数与结果
        $q = $db->Query("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`lottery_period` = '{$kaicaidata['qishu']}',\n\t\t\t\t\t\t\t`lottery_num` = '{$kaicaidata['nums']}'\n\t\t\t\t\t\t\t where `id` = '{$shop['id']}'");
        if (!$q) {
            $query = false;
        }
        $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;
        }
        $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 {
        //增加没有中奖人的信息写入,q_uid等于0就表示无人中奖。
        $gtimes = (int) System::load_sys_config('system', 'goods_end_time');
        if ($gtimes == 0 || $gtimes == 1) {
            $q_showtime = 'N';
        } else {
            $q_showtime = 'Y';
        }
        $q = $db->Query("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` = '0',\n\t\t\t\t\t\t\t`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`lottery_period` = '{$kaicaidata['qishu']}',\n\t\t\t\t\t\t\t`lottery_num` = '{$kaicaidata['nums']}'\n\t\t\t\t\t\t\t where `id` = '{$shop['id']}'");
        if (!$q) {
            $query = false;
        }
        $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;
        }
        $post_arr = array("uid" => $u_info['uid'], "gid" => $shop['id'], "send" => 1);
        _g_triggerRequest(WEB_PATH . '/api/send/send_shop_code', false, $post_arr);
    }
    /******************************/
    //新建
    if ($shop['qishu'] < $shop['maxqishu']) {
        $time = time();
        System::load_app_fun("content", G_ADMIN_DIR);
        $goods = $shop;
        $qishu = $goods['qishu'] + 1;
        $shenyurenshu = $goods['zongrenshu'] - $goods['def_renshu'];
        $query_table = content_get_codes_table();
        $q = $db->Query("INSERT INTO `@#_shoplist` (`sid`,`cateid`, `brandid`, `title`, `title_style`, `title2`, `keywords`, `description`, `money`, `yunjiage`, `zongrenshu`, `canyurenshu`,`shenyurenshu`,`def_renshu`, `qishu`,`maxqishu`,`thumb`, `picarr`, `content`,`codes_table`,`xsjx_time`,`renqi`,`pos`, `time`)\n\t\t\t\tVALUES\n\t\t\t\t('{$goods['sid']}','{$goods['cateid']}','{$goods['brandid']}','{$goods['title']}','{$goods['title_style']}','{$goods['title2']}','{$goods['keywords']}','{$goods['description']}','{$goods['money']}','{$goods['yunjiage']}','{$goods['zongrenshu']}','{$goods['def_renshu']}','{$shenyurenshu}','{$goods['def_renshu']}','{$qishu}','{$goods['maxqishu']}','{$goods['thumb']}','{$goods['picarr']}','{$goods['content']}','{$query_table}','{$goods['xsjx_time']}','{$goods['renqi']}','{$goods['pos']}','{$time}')\n\t\t\t\t");
        if (!$q) {
            return $query;
        }
        $id = $db->insert_id();
        $q = content_get_go_codes($goods['zongrenshu'], 3000, $id);
        if (!$q) {
            return $query;
        }
    }
    return $query;
}
Ejemplo n.º 16
0
<?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');
class finduser extends SystemAction
{
    public function __construct()
    {
    }
    //找回密码
    public function findpassword()
    {
        if (isset($_POST['submit'])) {
            $name = isset($_POST['name']) ? $_POST['name'] : "";
            $txtRegSN = strtoupper($_POST['txtRegSN']);
            if (md5($txtRegSN) != _getcookie('checkcode')) {
                _message("验证码错误");
            }
            $regtype = null;
            if (_checkmobile($name)) {
                $regtype = 'mobile';
            }
            if (_checkemail($name)) {
                $regtype = 'email';
            }
            if ($regtype == null) {
                _message("帐号类型不正确!", null, 3);
            }
            $info = $this->DB()->GetOne("SELECT * FROM `@#_member` WHERE {$regtype} = '{$name}' LIMIT 1");
Ejemplo n.º 17
0
<?php

date_default_timezone_set("Asia/Shanghai");
System::load_app_fun("user", "go");
class egglotter extends SystemAction
{
    private $userid;
    private $username;
    private $mysql_model;
    private $rule_id;
    public $userinfo;
    public $ruleinfo;
    public $spoilinfo;
    public $prize_arr;
    public function __construct()
    {
        $this->mysql_model = System::load_sys_class('model');
        $this->userid = intval(_encrypt(_getcookie("uid"), 'DECODE'));
        //获取当前客户的基本信息 (积分、剩余金额等)
        $this->userinfo = $this->mysql_model->GetOne("SELECT * from `@#_member` where `uid` = '{$this->userid}'");
        $curtime = time();
        /* if(!$this->userid){
        			_message("你还未登录,无权限访问该页!",WEB_PATH."/member/user/login");
        	    } */
        //显示当前抽奖第几期
        $this->ruleinfo = $this->mysql_model->GetOne("select * from `@#_egglotter_rule` where `starttime`<='{$curtime}' and `endtime`>='{$curtime}' and `startusing`=1");
        $this->username = $this->userinfo['username'];
        $rule_id = $this->ruleinfo['rule_id'];
        if (!$this->ruleinfo) {
            _message("没有设置游戏");
        }
Ejemplo n.º 18
0
 /**
  *	重置商品价格
  **/
 public function goods_set_money()
 {
     $this->ment = array(array("lists", "商品管理", ROUTE_M . '/' . ROUTE_C . "/goods_list"), array("add", "添加商品", ROUTE_M . '/' . ROUTE_C . "/goods_add"), array("renqi", "人气商品", ROUTE_M . '/' . ROUTE_C . "/goods_list/renqi"), array("xsjx", "限时揭晓商品", ROUTE_M . '/' . ROUTE_C . "/goods_list/xianshi"), array("qishu", "雨数倒序", ROUTE_M . '/' . ROUTE_C . "/goods_list/qishu"), array("danjia", "单价倒序", ROUTE_M . '/' . ROUTE_C . "/goods_list/danjia"), array("money", "商品价格倒序", ROUTE_M . '/' . ROUTE_C . "/goods_list/money"), array("money", "已揭晓", ROUTE_M . '/' . ROUTE_C . "/goods_list/jiexiaook"), array("money", "<font color='#f00'>雨数已满商品</font>", ROUTE_M . '/' . ROUTE_C . "/goods_list/maxqishu"));
     $this->db->Autocommit_start();
     $gid = abs(intval($this->segment(4)));
     $shopinfo = $this->db->GetOne("SELECT * FROM `@#_shoplist` where `id` = '{$gid}' for update");
     if (!$shopinfo || !empty($shopinfo['q_uid'])) {
         _message("参数不正确!");
         exit;
     }
     if (isset($_POST['money']) || isset($_POST['yunjiage'])) {
         $new_money = abs(intval($_POST['money']));
         $new_one_m = abs(intval($_POST['yunjiage']));
         if ($new_one_m > $new_money) {
             _message("单人次购买价格不能大于商品总价格!");
         }
         if (!$new_one_m || !$new_money) {
             _message("价格填写错误!");
         }
         if ($new_one_m == $shopinfo['yunjiage'] && $new_money == $shopinfo['money']) {
             _message("价格没有改变!");
         }
         System::load_app_fun("content");
         $table = $shopinfo['codes_table'];
         $this->db->Autocommit_start();
         $q1 = $this->db->Query("DELETE FROM `@#_member_go_record` WHERE `shopid` = '{$gid}'");
         $q2 = $this->db->Query("DELETE FROM `@#_{$table}` WHERE `s_id` = '{$gid}'");
         $zongrenshu = ceil($new_money / $new_one_m);
         $q3 = content_get_go_codes($zongrenshu, 3000, $gid);
         $q4 = $this->db->Query("UPDATE `@#_shoplist` SET \r\n\t\t\t`canyurenshu` = '0',\r\n\t\t\t`zongrenshu` = '{$zongrenshu}', \r\n\t\t\t`money` = '{$new_money}', \r\n\t\t\t`yunjiage` = '{$new_one_m}', \r\n\t\t\t`shenyurenshu` = `zongrenshu`\r\n\t\t\twhere `id` = '{$gid}'");
         if ($q1 && $q2 && $q3 && $q4) {
             $this->db->Autocommit_commit();
             _message("更新成功!", WEB_PATH . '/' . ROUTE_M . '/content/goods_list/');
         } else {
             $this->db->Autocommit_rollback();
             _message("更新失败!");
         }
     }
     include $this->tpl(ROUTE_M, 'shop.set_money');
 }
Ejemplo n.º 19
0
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;
}
Ejemplo n.º 20
0
<?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;
        }
Ejemplo n.º 21
0
 /**
  *	重置商品价格
  **/
 public function jf_goods_set_money()
 {
     $this->ment = array(array("lists", "商品管理", ROUTE_M . '/' . ROUTE_C . "/jf_goods_list"), array("add", "添加商品", ROUTE_M . '/' . ROUTE_C . "/jf_goods_add"), array("renqi", "人气商品", ROUTE_M . '/' . ROUTE_C . "/jf_goods_list/renqi"), array("danjia", "单价倒序", ROUTE_M . '/' . ROUTE_C . "/jf_goods_list/danjia"), array("money", "商品价格倒序", ROUTE_M . '/' . ROUTE_C . "/jf_goods_list/money"));
     $this->db->Autocommit_start();
     $gid = abs(intval($this->segment(4)));
     $shopinfo = $this->db->GetOne("SELECT * FROM `@#_jf_shoplist` where `id` = '{$gid}' for update");
     if (!$shopinfo || !empty($shopinfo['q_uid'])) {
         _message("参数不正确!");
         exit;
     }
     if (isset($_POST['yunjiage'])) {
         $new_one_m = abs(intval($_POST['yunjiage']));
         if (!$new_one_m) {
             _message("价格填写错误!");
         }
         if ($new_one_m == $shopinfo['yunjiage']) {
             _message("价格没有改变!");
         }
         System::load_app_fun("content");
         //$table = $shopinfo['codes_table'];
         $this->db->Autocommit_start();
         $q1 = $this->db->Query("DELETE FROM `@#_member_go_jf_record` WHERE `shopid` = '{$gid}'");
         $q4 = $this->db->Query("UPDATE `@#_jf_shoplist` SET\r\n\t\t\t`canyurenshu` = '0',\r\n\t\t\t`yunjiage` = '{$new_one_m}',\r\n\t\t\t`shenyurenshu` = `zongrenshu`\r\n\t\t\twhere `id` = '{$gid}'");
         if ($q1 && $q4) {
             $this->db->Autocommit_commit();
             _message("更新成功!");
         } else {
             $this->db->Autocommit_rollback();
             _message("更新失败!");
         }
     }
     include $this->tpl(ROUTE_M, 'shop.jf_set_money');
 }