<?php
class IndexAction extends Action {
//后台菜单管理
public function admin_menu_manage_list(){
$adminmenu=M('adminmenu')->where("dev_hidden=1")->order("id asc")->select();
$this->assign('adminmenu',$adminmenu);
$this->display();
}
//后台菜单添加
public function add_admin_menu_manage(){
$first_menu=M('adminmenu')->where("parentid=0 and dev_hidden=1")->order("id asc")->select();
$this->assign("first_menu",$first_menu);
$this->display();
}
//后台菜单添加动作
public function do_add_admin_menu_manage(){
//添加的菜单种类
$menutype=htmlspecialchars(trim($_POST['menutype']));
$menu_data['menuname']=htmlspecialchars(trim($_POST['menuname']));
$menu_data['url']=htmlspecialchars(trim($_POST['url']));
$menu_data['position']=trim($_POST['position']);
$menu_data['is_show']=htmlspecialchars(trim($_POST['is_show']));
$menu_data['addtime']=time();
$menu_data['dev_hidden']=1;
$adminmenu=M('adminmenu');
if($menutype==1){
$menu_data['url']='';
$menu_data['parentid']=0;
}elseif($menutype==2){
$menu_data['url']='';
$menu_data['parentid']=htmlspecialchars(trim($_POST['parentid']));
}elseif($menutype==3){
$menu_data['parentid']=htmlspecialchars(trim($_POST['twoid']));
}else{
$this->error("添加菜单失败,请选择要添加的菜单类型!");
}
$res=$adminmenu->add($menu_data);
if($res){
$this->success("添加菜单成功!");
}else{
$this->error("添加菜单失败!");
}
}
public function opt_close()
{
$dao = D("Close");
$username=$dao->where("id=$_GET[userid]")->getField("username");
switch ($_GET['action'])
{
case 'disaudit' :
if ($_GET['userid'] != '') {
$dao -> query('update ss_close set enabled="0" where id=' . $_GET['userid']);
}
userLog(session('adminid'), "修改注册用户状态为禁止,用户名:".$username);
$this -> assign('jumpUrl', base64_decode($_REQUEST['return']) . '#' . time());
$this -> success('操作成功');
break;
case 'audit' :
if ($_GET['userid'] != '') {
$dao -> query('update ss_close set enabled="1" where id=' . $_GET['userid']);
}
userLog(session('adminid'), "修改注册用户状态为启用,用户名:".$username);
$this -> assign('jumpUrl', base64_decode($_REQUEST['return']) . '#' . time());
$this -> success('操作成功');
break;
}
}
public function admin_close()
{
$condition = 'id>0';
$orderby = 'id desc';
$goodnum = D("Close");
$count = $goodnum -> where($condition) -> count();
$listRows = 20;
$linkFront = '';
import("@.ORG.Page");
$p = new Page($count, $listRows, $linkFront);
$goodnums = $goodnum -> limit($p -> firstRow . "," . $p -> listRows) -> where($condition) -> select();
$p -> setConfig('header', '条');
$page = $p -> show();
$this -> assign('page', $page);
$this -> assign('goodnums', $goodnums);
$this -> display();
}
//秀币转盘消费排行榜
public function admin_xiubitongji()
{
$condition = 'id>0';
if ($_GET['start_time'] != '') {
$timeArr = explode("-", $_GET['start_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime>=' . $unixtime;
}
if ($_GET['end_time'] != '') {
$timeArr = explode("-", $_GET['end_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime<=' . $unixtime;
}
if ($_GET['keyword'] != '' && $_GET['keyword'] != '请输入用户名') {
$keyuinfo = D("Member") -> where('username="' . $_GET['keyword'] . '"') -> select();
if ($keyuinfo) {
$condition .= ' and uid=' . $keyuinfo[0]['id'];
} else {
$this -> error('没有该用户的记录');
}
}
$beandetail = D("Coindetail");
$condition .= ' and giftid="7878" ' ;
$count = $beandetail -> where($condition) -> count();
$listRows = 20;
$linkFront = '';
import("@.ORG.Page");
$p = new Page($count, $listRows, $linkFront);
$orderby = 'sum(coin) desc';
$details = $beandetail -> field('id,uid,touid,sum(coin) as coin,sum(giftcount) as giftcount')->limit($p -> firstRow . "," . $p -> listRows) -> where($condition) -> order($orderby) -> group("uid")->select();
foreach ($details as $n => $val) {
$details[$n]['voo'] = D("Member") -> where('id=' . $val['uid']) -> select();
}
$p -> setConfig('header', '条');
$page = $p -> show();
$this -> assign('page', $page);
$this -> assign('details', $details);
$this -> display();
}
//礼物转盘消费排行榜
public function admin_liwutongji()
{
$condition = 'id>0';
if ($_GET['start_time'] != '') {
$timeArr = explode("-", $_GET['start_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime>=' . $unixtime;
}
if ($_GET['end_time'] != '') {
$timeArr = explode("-", $_GET['end_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime<=' . $unixtime;
}
if ($_GET['keyword'] != '' && $_GET['keyword'] != '请输入用户名') {
$keyuinfo = D("Member") -> where('username="' . $_GET['keyword'] . '"') -> select();
if ($keyuinfo) {
$condition .= ' and uid=' . $keyuinfo[0]['id'];
} else {
$this -> error('没有该用户的记录');
}
}
$beandetail = D("Coindetail");
$condition .= ' and giftid="5656" ' ;
$count = $beandetail -> where($condition) -> count();
$listRows = 20;
$linkFront = '';
import("@.ORG.Page");
$p = new Page($count, $listRows, $linkFront);
if($_GET['start_time'] != ''&&$_GET['end_time'] != '')
{
$orderby = 'sum(coin) desc';
$details = $beandetail -> field('id,uid,touid,sum(coin) as coin,count(uid) as content')->limit($p -> firstRow . "," . $p -> listRows) -> where($condition) -> order($orderby) -> group("uid")->select();
//var_dump($details);
foreach ($details as $n => $val) {
$details[$n]['voo'] = D("Member") -> where('id=' . $val['uid']) -> select();
}
$p -> setConfig('header', '条');
$page = $p -> show();
$this -> assign('page', $page);
$this -> assign('details', $details);
// $shijian= date("Y-m-d h:i:s");
// $_GET['shijian']=date("Y-m-d h:i:s");
}
else
{
$orderby = 'id desc';
$details = $beandetail -> limit($p -> firstRow . "," . $p -> listRows) -> where($condition) -> order($orderby) -> select();
foreach ($details as $n => $val) {
$details[$n]['voo'] = D("Member") -> where('id=' . $val['uid']) -> select();
}
$p -> setConfig('header', '条');
$page = $p -> show();
$this -> assign('page', $page);
$this -> assign('details', $details);
}
$this -> display();
}
//砸蛋游戏中奖排行榜
public function admin_famehall()
{
$condition = 'id>0';
if ($_GET['start_time'] != '') {
$timeArr = explode("-", $_GET['start_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime>=' . $unixtime;
}
if ($_GET['end_time'] != '') {
$timeArr = explode("-", $_GET['end_time']);
$unixtime = mktime(0, 0, 0, $timeArr[1], $timeArr[2], $timeArr[0]);
$condition .= ' and addtime<=' . $unixtime;
}
if ($_GET['keyword'] != '' && $_GET['keyword'] != '请输入用户名')
{
$keyuinfo = D("Member") -> where('username="' . $_GET['keyword'] . '"') -> select();
if ($keyuinfo) {
$condition .= ' and touid=' . $keyuinfo[0]['id'];
} else {
$this -> error('没有该用户的记录');
}
}
$beandetail = D("Giveaway");
$orderby = 'sum(content) desc';
$condition .= ' and remark="砸蛋奖励" ' ;
$count = $beandetail -> where($condition) -> count();
$listRows = 20;
$linkFront = '';
import("@.ORG.Page");
$p = new Page($
毕业课程设计
- 粉丝: 2317
- 资源: 2563
最新资源
- 19 工资发放明细表-可视化图表.xlsx
- 27 员工工资表(图表分析).xlsx
- 23 财务报告工资数据图表模板.xlsx
- 22 财务报告工资数据图表模板.xlsx
- 24 工资表-年度薪资可视化图表.xlsx
- 26 财务分析部门工资支出图表.xlsx
- Python爬虫技术详解:从基础到实战.zip
- 25 工资费用支出表-可视化图表.xlsx
- 30公司各部门工资支出数据图表1.xlsx
- 29 员工月度工资支出数据图表.xlsx
- 28 工资表(自动计算,图表显示).xlsx
- 31 财务分析工资年度开支图表.xlsx
- 33 年度工资预算表(可视化看板).xlsx
- 32 公司年度工资成本数据图表.xlsx
- 34 年度工资汇总-数据可视化看板.xlsx
- 36 财务报表新年度部门工资预算表.xlsx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈