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(); }
public function used_index() { $config = M('config')->where('id=1')->find(); $xiaohao_config = json_decode($config['xiaohao_config'], true); import('ORG.Util.Page'); $type_list = $this->get_xiaohao_type(); $this->assign('type_list', $type_list); $xh_model = new XiaohaoViewModel(); $keyword = I('keyword'); $ftype = I('ftype'); if (!empty($keyword) && !empty($ftype)) { $where[$ftype] = array('like', '%' . $keyword . '%'); } $type_id = I('type_id', ''); if ($type_id != '') { $where['type_id'] = $type_id; } $where['isused'] = 1; $count = $xh_model->where($where)->count(); $numsOfpage = $xiaohao_config['numsofpage']; if ($numsOfpage == '') { $numsOfpage = 30; } $page = new Page($count, $numsOfpage); $show = $page->show(); $xiaohao_temp = $xh_model->where($where)->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select(); $xiaohao = array(); foreach ($xiaohao_temp as $k => $v) { if ($v['encry_key'] != '') { $v['note_no'] = '***' . str_replace('...', '***', cut_str(encrypt($v['note_no'], 'D', $v['encry_key']), 30, 3)); $v['account'] = '***' . str_replace('...', '***', cut_str(encrypt($v['account'], 'D', $v['encry_key']), 3, 2)); $v['email'] = '***' . str_replace('...', '***', cut_str(encrypt($v['email'], 'D', $v['encry_key']), 10, 3)); } else { $v['note_no'] = '***' . str_replace('...', '***', cut_str($v['note_no'], 30, 3)); $v['account'] = '***' . str_replace('...', '***', cut_str($v['account'], 3, 2)); $v['email'] = '***' . str_replace('...', '***', cut_str($v['email'], 10, 3)); } $xiaohao[] = $v; } $this->assign('count', $count); $this->assign('show', $show); $this->assign('xiaohao_list', $xiaohao); $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(); }