Example #1
0
 public function newest_active()
 {
     $obj = new Model('t_active');
     $my_content = $obj->order('date_time_start DESC')->limit(5)->select();
     $this->assign('my_content', $my_content);
     $this->display();
 }
Example #2
0
 public function _initialize()
 {
     parent::_initialize();
     $model = new Model('gonggao');
     $gonggao = $model->order('time desc')->limit(8)->select();
     $this->assign('gonggao_list', $gonggao);
     $model = new Model('help');
     $help = $model->order('time desc')->limit(8)->select();
     $this->assign('help_list', $help);
     $model = new Model('article');
     $article = $model->order('article_time desc')->limit(8)->select();
     $this->assign('article_list', $article);
     $model = new Model('about');
     $about = $model->order('time desc')->limit(8)->select();
     $this->assign('about_list', $about);
 }
Example #3
0
 public function type_index()
 {
     $model = new Model('kefu_type');
     $count = $model->count();
     $this->assign('count', $count);
     $type_list = $model->order('sort_order asc ')->select();
     $this->assign('type_list', $type_list);
     $this->display();
 }
Example #4
0
 public function xh()
 {
     import('ORG.Util.Page');
     $config = M('config')->where('id=1')->find();
     $xiaohao_config = json_decode($config['xiaohao_config'], true);
     if ($xiaohao_config['valid'] != 1) {
         $this->message2('无该项业务或者业务暂停!', __APP__ . '/Index');
     }
     $kongbao_page = json_decode($config['kongbao_page'], true);
     $kongbao_page_temp = array();
     foreach ($kongbao_page as $key1 => $v1) {
         $kongbao_page_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('kongbao_page', $kongbao_page_temp);
     $seo_seoo = json_decode($config['seo_seoo'], true);
     $seo_seoo_temp = array();
     foreach ($seo_seoo as $key1 => $v1) {
         $seo_seoo_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('seo_seoo', $seo_seoo_temp);
     $userid = session('userid');
     $model = new Model('xiaohao_type');
     $list = $model->order('sort_order asc')->select();
     $type_list = array();
     $type_list_temp = array();
     foreach ($list as $k => $v) {
         if ($xiaohao_config['stop_view'] == 0 && $v['state'] == 1) {
             continue;
         }
         if ($v['state'] == 0) {
             $v['name'] = $v['name'] . '(正常出售)';
         }
         if ($v['state'] == 1) {
             $v['name'] = $v['name'] . '(暂停出售)';
         }
         $v['config'] = json_decode($v['config'], true);
         $type_list[] = $v;
         $type_list_temp[$v['id']] = $v;
     }
     $this->assign('type_list', $type_list);
     $user = M('user')->where('id=' . $userid)->find();
     $user_type = $user['user_type'];
     if (empty($user_type) || $user_type == '') {
         $user_type = 1;
     }
     $user_level = M('user_level')->where('id=' . $user_type)->find();
     $level_config = json_decode($user_level['config'], true);
     $this->assign('level_config', $level_config);
     $where = array();
     $where['isused'] = 0;
     $xh_type_id = I('xh_type_id', '');
     if ($xh_type_id != '') {
         $where['type_id'] = $xh_type_id;
     }
     if ($xiaohao_config['stop_view'] == 0) {
         $where['state'] = 0;
     }
     $xh_model = new XiaohaoViewModel();
     $xh_counts = $xh_model->where($where)->count();
     $page = new Page($xh_counts, 10);
     $show = $page->show();
     $xh_list_temp = $xh_model->where($where)->order('addtime desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     $xh_list = array();
     if (!empty($xh_list_temp)) {
         foreach ($xh_list_temp as $xh) {
             $temp = array();
             $temp['id'] = $xh['id'];
             $temp['account'] = rtrim(cut_str($xh['account'], 2, 0), '...') . '';
             if ($xh['encry_key'] != '') {
                 $temp['account'] = rtrim(cut_str(encrypt($xh['account'], 'D', $xh['encry_key']), 2, 0), '...') . '***';
             }
             $temp['query_url'] = U('xh_query', array('id' => $xh['id']));
             $temp['type_name'] = $type_list_temp[$xh['type_id']]['name'];
             $temp['price'] = $type_list_temp[$xh['type_id']]['config']['price']['a' . $user_type];
             $xh_list[] = $temp;
         }
     }
     $this->assign('xh_list', $xh_list);
     $this->assign('show', $show);
     $user_type_list = M('user_level')->order('sort_order asc')->select();
     $level_list = array();
     foreach ($user_type_list as $ulevel) {
         $ulevel['config'] = json_decode($ulevel['config'], true);
         if (isset($ulevel['config']['level_view']) && $ulevel['config']['level_view'] == 1) {
             continue;
         }
         $ulevel['id'] = 'a' . $ulevel['id'];
         $level_list[] = $ulevel;
     }
     $this->assign('user_level_list', $level_list);
     $this->display();
 }
Example #5
0
 public function help_category_list()
 {
     $model = new Model('help_category');
     $datas = $model->order('path,sort desc')->findAll();
     $result = Common::treeArray($datas);
     $this->assign("help_category", $result);
     $this->redirect();
 }
Example #6
0
 public function _initialize()
 {
     $config = M('config')->where('id=1')->find();
     if ($config['site_status'] == 0) {
         $this->message3($config['close_reason']);
     }
     $current_moban = $config['site_template'];
     $_POST['t'] = $current_moban;
     $_GET['t'] = $current_moban;
     $this->assign('config', $config);
     $kongbao_config = json_decode($config['kongbao_config'], true);
     $this->assign('kongbao_config', $kongbao_config);
     $kongbao_page = json_decode($config['kongbao_page'], true);
     $danhao_config = json_decode($config['danhao_config'], true);
     $xiaohao_config = json_decode($config['xiaohao_config'], true);
     $this->assign('danhao_config', $danhao_config);
     $this->assign('xiaohao_config', $xiaohao_config);
     $reg_setting = json_decode($config['reg_setting'], true);
     $this->assign('reg_setting', $reg_setting);
     $qq_setting = json_decode($config['qq_setting'], true);
     $this->assign('qq_setting', $qq_setting);
     $sj_setting = json_decode($config['sj_setting'], true);
     $this->assign('sj_setting', $sj_setting);
     $kongbao_page_temp = array();
     foreach ($kongbao_page as $key1 => $v1) {
         $kongbao_page_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('kongbao_page', $kongbao_page_temp);
     $seo_seoo = json_decode($config['seo_seoo'], true);
     $seo_seoo_temp = array();
     foreach ($seo_seoo as $key1 => $v1) {
         $seo_seoo_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('seo_seoo', $seo_seoo_temp);
     $this->assign('seo_keyword', $config['metakeys']);
     $this->assign('seo_desc', $config['metadesc']);
     $this->assign('seo_title', $config['metatitle']);
     $rand_num = rand(1, 5);
     $header_adv = M('adv')->where('typeid=2')->order($rand_num)->find();
     $adv_id = $header_adv['id'];
     $this->assign('header_adv', $header_adv);
     $rand_num = rand(1, 5);
     $header_adv1 = M('adv')->where('typeid=2 and id<>' . $adv_id)->order($rand_num)->find();
     $this->assign('header_adv1', $header_adv1);
     $slide_list = M('adv')->where('typeid=1')->select();
     $this->assign('slide_list', $slide_list);
     $footer_adv = M('adv')->where('typeid=3')->order($rand_num)->find();
     $this->assign('footer_adv', $footer_adv);
     $kbhdp_list = M('adv')->where('typeid=4')->select();
     $this->assign('kbhdp_list', $kbhdp_list);
     $loging_adv = M('adv')->where('typeid=5')->order($rand_num)->find();
     $this->assign('loging_adv', $loging_adv);
     $loginj_adv = M('adv')->where('typeid=6')->order($rand_num)->find();
     $this->assign('loginj_adv', $loginj_adv);
     $model = new Model('link');
     $flink = $model->order('addtime asc')->select();
     $this->assign('flink_list', $flink);
     $kefu_type_list = M('kefu_type')->order('sort_order asc')->select();
     $kefu_list = array();
     foreach ($kefu_type_list as $ktype => $kvalue) {
         $kefu_list[$kvalue['id']]['title'] = $kvalue['title'];
         $kf_list = M('kefu')->where('kf_type=' . $kvalue['id'])->order('sort_order asc')->select();
         $kefu_list[$kvalue['id']]['data'] = $kf_list;
     }
     $this->assign('kefu_list', $kefu_list);
     if (session('IS_LOGIN') == 1) {
         $userid = session('userid');
         $model = new UserViewModel();
         $user = $model->where('user.id=' . $userid)->find();
         $this->assign('user', $user);
         if (0 < $user['refer_id']) {
             $refer_qq = '';
             $refer_user = M('user')->where('id=' . $user['refer_id'])->find();
             if (!empty($refer_user)) {
                 $refer_qq = $refer_user['user_qq'];
             }
             $this->assign('refer_qq', $refer_qq);
         }
     }
 }
Example #7
0
 public function order_exp_new()
 {
     import('ORG.Util.Page');
     $model = new Model('exp_log');
     $last_time = M('kongbao_type')->max('last_down_time');
     if (empty($last_time)) {
         $last_time = '系统尚未进行过批量导出!';
     } else {
         $last_time = date('Y-m-d H:i:s', $last_time);
     }
     $count = $model->count();
     $page = new Page($count, 15);
     $show = $page->show();
     $log_list = $model->order('exp_time desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     $this->assign('show', $show);
     $this->assign('count', $count);
     $this->assign('log_list', $log_list);
     $this->assign('last_time', $last_time);
     $type_list = $this->get_kongbao_type();
     $this->assign('type_list', $type_list);
     $this->display();
 }
Example #8
0
 public function index()
 {
     $exp_time = time();
     $exp_datetime = date('Y-m-d H:i:s', $exp_time);
     $config = M('config')->where('id=1')->find();
     $tuiguang_url = 'http://' . $_SERVER['HTTP_HOST'] . __APP__ . '?ruid=' . session('userid');
     if ($config['tuiguang_shorturl'] == 1) {
         if (!class_exists('Short_Url')) {
             require 'Public/Short_Url.php';
         }
         $short_url = new Short_Url();
         $tuiguang_url = $short_url->url_short($tuiguang_url);
     }
     $image_url = 'http://' . $_SERVER['HTTP_HOST'] . $config['tg_images'];
     $tg_content1 = '';
     $tg_content2 = '';
     $tg_content3 = '';
     if ($config['tg_content1'] != '') {
         $tg_content1 = str_replace('{refer_url}', $tuiguang_url, $config['tg_content1']);
     }
     if ($config['tg_content2'] != '') {
         $tg_content2 = str_replace('{refer_url}', $tuiguang_url, $config['tg_content2']);
     }
     if ($config['tg_content3'] != '') {
         $tg_content3 = str_replace('{refer_url}', $tuiguang_url, $config['tg_content3']);
     }
     $this->assign('image_url', $image_url);
     $this->assign('tuiguang_url', $tuiguang_url);
     $this->assign('tg_content', array($tg_content1, $tg_content2, $tg_content3));
     $refer_nums = D('user')->where('refer_id=' . session('userid'))->count();
     $this->assign('refer_nums', $refer_nums);
     $reg_setting = M('user')->where('id=' . session('userid'))->find();
     $wrefer_id = $reg_setting['refer_id'];
     $vip_setting = json_decode($reg_setting['vip_set'], true);
     $wrefer = M('user')->where('id=' . $wrefer_id)->find();
     $wusername = $wrefer['username'];
     $this->assign('wusername', $wusername);
     $this->assign('vip_setting', $vip_setting);
     $refer_id = I('ruid', 0);
     if (0 < $refer_id) {
         $refer_user = M('user')->where('id=' . $refer_id)->find();
         if (!empty($refer_user)) {
             $refer_user_type = $refer_user['user_type'];
             $user_level = M('user_level')->where('id=' . $refer_user_type)->find();
             $level_config = json_decode($user_level['config'], true);
             if ($level_config['refer'] == 1) {
                 $cruid = cookie('vgs-referid');
                 if (!$cruid) {
                     cookie('vgs-referid', $refer_id, 604800);
                 }
             }
         }
     }
     $model = new Model('gonggao');
     $gonggao = $model->order('time desc')->limit(8)->select();
     $this->assign('gonggao_list', $gonggao);
     $config = M('config')->where('id=1')->find();
     $kongbao_config = json_decode($config['kongbao_config'], true);
     $model = new Model('kongbao_type');
     $list = $model->where('is_true=0')->order('sort_order asc')->select();
     $type_list = array();
     foreach ($list as $k => $v) {
         if ($kongbao_config['stop_view'] == 0 && $v['state'] == 1) {
             continue;
         }
         if ($v['state'] == 0) {
             $v['name'] = $v['name'] . '(正常出售)';
         }
         if ($v['state'] == 1) {
             $v['name'] = $v['name'] . '(暂停出售)';
         }
         $v['config'] = json_decode($v['config'], true);
         $type_list[] = $v;
     }
     $this->assign('type_list', $type_list);
     $user = M('user')->where('id=' . $userid)->find();
     $user_type = $user['user_type'];
     $user_default_kuaidi = $user['default_kuaidi'];
     $this->assign('user_default_kuaidi', $user_default_kuaidi);
     $config = M('config');
     $setting = $config->where('id=1')->find();
     $mibao_setting = json_decode($setting['mibao_setting'], true);
     $this->assign('mibao_setting', $mibao_setting);
     $cwsz_config = json_decode($this->user['cwsz_config'], true);
     $this->assign('cwsz_config', $cwsz_config);
     $model = new Model('help');
     $help = $model->order('time desc')->limit(8)->select();
     $this->assign('help_list', $help);
     $model = new Model('article');
     $article = $model->order('article_time desc')->limit(8)->select();
     $this->assign('article_list', $article);
     $model = new Model('about');
     $about = $model->order('time desc')->limit(8)->select();
     $this->assign('about_list', $about);
     $model = new UserOrderViewModel();
     $where = array();
     $where['type'] = 1;
     $where['status'] = 1;
     $recharge_list = $model->where($where)->order('addtime desc')->limit(100)->select();
     $this->assign('recharge_list', $recharge_list);
     $where['type'] = 0;
     $where['status'] = 1;
     $pay_order_list = $model->where($where)->order('addtime desc')->limit(100)->select();
     $this->assign('order_list', $pay_order_list);
     if (session('IS_LOGIN') == 1) {
         $userid = session('userid');
         $model = new UserViewModel();
         $user = $model->where('user.id=' . $userid)->find();
         $this->assign('user', $user);
     } else {
         $sys_config = M('config')->where('id=1')->find();
         $current_moban = $sys_config['site_template'];
         if ($current_moban == 'default' || $current_moban == 'longxiang' || $current_moban == 'php') {
             $this->display('index_login');
             exit;
         }
     }
     $this->display();
 }
Example #9
0
 public function _initialize()
 {
     /*$frequency=10;
             $period=60;
             $limitTime=600;
             $now=time();
             $userId=session('userid');
     		$userId=$userId?:0;
             $clientIP = get_client_ip();
             M('access_statistics')->where("time+$period<$now")->delete();
     		M('access_statistics')->add([
     			'ip'=> $clientIP,
                 'time'=>$now,
                 'action'=>ACTION_NAME,
                 'user_id'=>$userId
     		]);
             $deny=M('access_deny')->where(['ip'=>$clientIP,"time>$now"])->find();
             if($deny){
                 exit('deny');
             }
             $limitActions=M('access_statistics')->query("select * from access_statistics group by ip,`action` having count(*)>{$frequency}");
             foreach ($limitActions as $item){
                 M('access_deny')->add(['ip'=>$item['ip'],'time'=>$now+$limitTime],[],true);
             }*/
     $_GET = array_map([$this, 'wdreplace'], $_GET);
     $_POST = array_map([$this, 'wdreplace'], $_POST);
     $config = M('config')->where('id=1')->find();
     if ($config['site_status'] == 0) {
         $this->message3($config['close_reason']);
     }
     $current_moban = $config['site_template'];
     $_POST['t'] = $current_moban;
     $_GET['t'] = $current_moban;
     $this->assign('config', $config);
     $kongbao_config = json_decode($config['kongbao_config'], true);
     $this->assign('kongbao_config', $kongbao_config);
     $kongbao_page = json_decode($config['kongbao_page'], true);
     $danhao_config = json_decode($config['danhao_config'], true);
     $xiaohao_config = json_decode($config['xiaohao_config'], true);
     $this->assign('danhao_config', $danhao_config);
     $this->assign('xiaohao_config', $xiaohao_config);
     $reg_setting = json_decode($config['reg_setting'], true);
     $this->assign('reg_setting', $reg_setting);
     $qq_setting = json_decode($config['qq_setting'], true);
     $this->assign('qq_setting', $qq_setting);
     $sj_setting = json_decode($config['sj_setting'], true);
     $this->assign('sj_setting', $sj_setting);
     $kongbao_page_temp = array();
     foreach ($kongbao_page as $key1 => $v1) {
         $kongbao_page_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('kongbao_page', $kongbao_page_temp);
     $seo_seoo = json_decode($config['seo_seoo'], true);
     $seo_seoo_temp = array();
     foreach ($seo_seoo as $key1 => $v1) {
         $seo_seoo_temp[$key1] = stripslashes(htmlspecialchars_decode($v1));
     }
     $this->assign('seo_seoo', $seo_seoo_temp);
     $this->assign('seo_keyword', $config['metakeys']);
     $this->assign('seo_desc', $config['metadesc']);
     $this->assign('seo_title', $config['metatitle']);
     $rand_num = rand(1, 5);
     $header_adv = M('adv')->where('typeid=2')->order($rand_num)->find();
     $adv_id = $header_adv['id'];
     $this->assign('header_adv', $header_adv);
     $rand_num = rand(1, 5);
     $header_adv1 = M('adv')->where('typeid=2 and id<>' . $adv_id)->order($rand_num)->find();
     $this->assign('header_adv1', $header_adv1);
     $slide_list = M('adv')->where('typeid=1')->select();
     $this->assign('slide_list', $slide_list);
     $footer_adv = M('adv')->where('typeid=3')->order($rand_num)->find();
     $this->assign('footer_adv', $footer_adv);
     $kbhdp_list = M('adv')->where('typeid=4')->select();
     $this->assign('kbhdp_list', $kbhdp_list);
     $loging_adv = M('adv')->where('typeid=5')->order($rand_num)->find();
     $this->assign('loging_adv', $loging_adv);
     $loginj_adv = M('adv')->where('typeid=6')->order($rand_num)->find();
     $this->assign('loginj_adv', $loginj_adv);
     $model = new Model('link');
     $flink = $model->order('addtime asc')->select();
     $this->assign('flink_list', $flink);
     $kefu_type_list = M('kefu_type')->order('sort_order asc')->select();
     $kefu_list = array();
     foreach ($kefu_type_list as $ktype => $kvalue) {
         $kefu_list[$kvalue['id']]['title'] = $kvalue['title'];
         $kf_list = M('kefu')->where('kf_type=' . $kvalue['id'])->order('sort_order asc')->select();
         $kefu_list[$kvalue['id']]['data'] = $kf_list;
     }
     $this->assign('kefu_list', $kefu_list);
     if (session('IS_LOGIN') == 1) {
         $userid = session('userid');
         $model = new UserViewModel();
         $user = $model->where('user.id=' . $userid)->find();
         $this->assign('user', $user);
         if (0 < $user['refer_id']) {
             $refer_qq = '';
             $refer_user = M('user')->where('id=' . $user['refer_id'])->find();
             if (!empty($refer_user)) {
                 $refer_qq = $refer_user['user_qq'];
             }
             $this->assign('refer_qq', $refer_qq);
         }
     }
 }