function index() { $user = new UserViewModel(); $list = $user->select(); dump($list); //$this->display(); }
public function index() { $user = new UserViewModel(); $list = $user->select(); dump($list); //select * from think_user,think_user_message where think_user.id=think_user_message.userid; }
public function index() { $id = $this->_session('id'); $user = M('user'); $ulist = $user->find($id); $this->assign('ulist', $ulist); $testuser = M('testuser'); $tlist = $testuser->where('pid=' . $id)->find(); $this->assign('tlist', $tlist); $shiyong = M('shiyong'); $slist = $shiyong->where('pid=' . $id)->find(); $this->assign('slist', $slist); $bianhao = new UserViewModel(); $blist = $bianhao->where('pid=' . $id)->find(); $this->assign('blist', $blist); if ($slist['num'] == '' or $slist['home'] == '' or $slist['tsj'] == '' or $slist['xsq'] == '') { $a = '<b>修改设备编号</b>'; $this->assign('a', $a); } $this->display(); }
public function manframe() { if (!session('?adminid')) { redirect(U(C('USER_AUTH_GATEWAY'))); } $config = M('config')->where('id=1')->find(); $xiaohao_config = json_decode($config['xiaohao_config'], true); $kongbao_config = json_decode($config['kongbao_config'], true); $this->assign('xiaohao_config', $xiaohao_config); $user_array = array(); $counts = M('user')->count(); $user_array['user_counts'] = $counts; $model = new UserViewModel(); $user_array['user_detail'] = $model->field('user_type,type_name,count(1) counts')->group('user_type')->order('user_type asc')->select(); $this->assign('user_array', $user_array); $recharge = array(); $where = array(); $where['type'] = 1; $recharge_list = M('pay_order')->where($where)->field('status,count(1) counts,sum(pay_money) money')->group('status')->select(); foreach ($recharge_list as $rk => $rv) { if ($rv['status'] == 0) { $recharge['n'] = $rv; } else { $recharge['y'] = $rv; } } $recharge['a']['counts'] = $recharge['n']['counts'] + $recharge['y']['counts']; $recharge['a']['money'] = $recharge['n']['money'] + $recharge['y']['money']; $this->assign('recharge', $recharge); $where['type'] = 0; $buy_order['y'] = M('pay_order')->where($where)->field('count(1) counts,sum(pay_money) money')->find(); $this->assign('buy_order', $buy_order); $tixian = array(); $where = array(); $tixian_list = M('tixian')->where($where)->field('status,count(1) counts,sum(money) money')->group('status')->select(); foreach ($tixian_list as $tk => $tv) { if ($tv['status'] == 1) { $tixian['n'] = $tv; } else { if ($tv['status'] == 2) { $tixian['y'] = $tv; } else { if ($tv['status'] == 3) { $tixian['f'] = $tv; } } } } $tixian['a']['counts'] = $tixian['n']['counts'] + $tixian['y']['counts'] + $tixian['f']['counts']; $tixian['a']['money'] = $tixian['n']['money'] + $tixian['y']['money'] + $tixian['f']['money']; $this->assign('tixian', $tixian); $kongbao = array(); $model = new KongbaoViewModel(); $kongbao['n'] = M('kongbao')->where('isused=0')->count(); $kongbao['detail'] = $model->field('type_id,name,count(1) counts')->where('isused=0')->group('type_id')->order('type_id asc')->select(); $this->assign('kongbao', $kongbao); $tixing_kb = $kongbao_config['tixing']; $tixing_text_kb = ''; if ($kongbao['n'] <= $tixing_kb) { $close_url = ' <a href=\'javascript:void(0)\' onclick=\'btn_close("kongbao")\'>【关闭提示】</a>'; $tixing_text_kb = '你当前的未使用空包数量已不足,请及时补货!' . $close_url; } $this->assign('tixing_text_kb', $tixing_text_kb); if ($xiaohao_config['valid'] == 1) { $xiaohao = array(); $model = new XiaohaoViewModel(); $xiaohao['n'] = M('xiaohao')->where('isused=0')->count(); $xiaohao['detail'] = $model->field('type_id,name,count(1) counts')->where('isused=0')->group('type_id')->order('type_id asc')->select(); $this->assign('xiaohao', $xiaohao); $tixing_xh = $xiaohao_config['tixing']; $tixing_text_xh = ''; if ($xiaohao['n'] <= $tixing_xh) { $close_url = ' <a href=\'javascript:void(0)\' onclick=\'btn_close("xiaohao")\'>【关闭提示】</a>'; $tixing_text_xh = '你当前的未使用小号数量已不足,请及时补货!' . $close_url; } $this->assign('tixing_text_xh', $tixing_text_xh); } $auth_code = ''; if ($config['auth_code'] != '') { $auth_code = $config['auth_code']; $key_code = $config['auth_keycode']; $CommonAction = new CommonAction(); $auth_code = $CommonAction->passport_decrypt($auth_code, $key_code); $auth_code = explode('&', $auth_code); } $this->assign('auth_code', $auth_code); $array['osinfo'] = PHP_OS; $array['osinfo'] .= @ini_get('safe_mode') ? ' Safe Mode' : NULL; $array['serverinfo'] = $_SERVER['SERVER_SOFTWARE']; $sqlinfo = M()->query('SELECT VERSION()'); $array['sqlinfo'] = $sqlinfo[0]['VERSION()']; $array['serverip'] = $_SERVER['SERVER_NAME'] . ' [ ' . gethostbyname($_SERVER['SERVER_NAME']) . ' ]'; $array['servertime'] = date('Y年n月j日 H:i:s'); if (@ini_get('file_uploads')) { $upload = ini_get('upload_max_filesize'); } else { $upload = '<font color="red">不支持上传</font>'; } $array['upload'] = $upload; $this->assign('config', $config); $this->assign($array); $this->display(); }
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); } } }
public function edit() { $userid = I('id', 0); $type_model = new UserLevelModel(); $type_list = $type_model->order('sort_order asc')->select(); $this->assign('type_list', $type_list); if (0 < $userid) { $user = new UserViewModel(); $where['id'] = $userid; $data = $user->where($where)->find(); $cwsz_config = array(); if ($data['cwsz_config'] != '') { $cwsz_config = json_decode($data['cwsz_config'], true); } $this->assign('userdata', $data); $this->assign('cwsz_config', $cwsz_config); $this->display(); } else { $this->message('未指定任何用户信息', __URL__ . '/index'); } }
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(); }
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); } } }
public function Addorder11() { $user = new UserViewModel(); $list = $user->select(); //dump($list); }
function expActUser() { $xlsName = '参与'; $xlsCell = array(array('id', '序号'), array('username', '用户名'), array('act_name', '活动名称'), array('cp_name', '开始时间'), array('count', '活跃度')); $xlsModel = new UserViewModel(); $xlsData = $xlsModel->select(); $this->exportExcel($xlsName, $xlsCell, $xlsData); }