将值班系统和value系统。。从123搬迁到144
parent
83460c7eea
commit
72ab473a8b
@ -0,0 +1,334 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
|
||||
class ding_value_model extends CI_Model {
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->HT = $this->load->database('HT', TRUE);
|
||||
}
|
||||
|
||||
//扫码获取相应人的信息
|
||||
function get_dingding_user($unionid){
|
||||
$sql = "select
|
||||
*
|
||||
from
|
||||
Dingding_User
|
||||
where
|
||||
ddu_Unionid = ?";
|
||||
$query = $this->HT->query($sql, array($unionid));
|
||||
if ($query->num_rows() > 0){
|
||||
$row = $query->row();
|
||||
return $row;
|
||||
}
|
||||
else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//根据姓名获取唯一unionid
|
||||
public function get_dingding_unionid($name){
|
||||
$sql = "select ddu_Unionid from Dingding_User where ddu_Name = ?";
|
||||
$query = $this->HT->query($sql, array($name));
|
||||
if ($query->num_rows() > 0){
|
||||
$row = $query->row();
|
||||
return $row;
|
||||
}
|
||||
else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//添加用户
|
||||
function add_dingding_user($name,$unionid,$mobile,$email,$position,$avatar,$time){
|
||||
$sql = "INSERT INTO Dingding_User (ddu_Name,ddu_Unionid,ddu_Mobile,ddu_Email,ddu_Position,ddu_Avatar,ddu_Datetime) VALUES (N?,?,?,?,N?,?,?)";
|
||||
$query = $this->HT->query($sql,array($name,$unionid,$mobile,$email,$position,$avatar,$time));
|
||||
if ($query){
|
||||
return TRUE;
|
||||
}else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//添加value事件
|
||||
function add_value($data){
|
||||
$sql = "INSERT INTO Dingding_Value (ddv_Type,ddv_Name,ddv_User_Unionid,ddv_Comment_Name,ddv_Comment_Unionid,ddv_Content,ddv_Identify,ddv_Createtime) VALUES (?,N?,?,N?,?,N?,?,?)";
|
||||
$query = $this->HT->query($sql,array($data['type'],$data['user'],$data['user_unionid'],$data['comment_name'],$data['comment_unionid'],$data['content'],$data['mail_identify'],$data['createtime']));
|
||||
if($query){
|
||||
return TRUE;
|
||||
}else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//统计like人数
|
||||
function count_like($unionid){
|
||||
$year_start = strtotime(date('Y-01-01', time()));
|
||||
$year_end = strtotime(date('Y-12-31', time()));
|
||||
$sql = "SELECT COUNT(*) AS count FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'like' AND ddv_Type = 'like' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->row();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取like的人是那些
|
||||
function whos_like($unionid){
|
||||
$year_start = strtotime(date('Y-01-01', time()));
|
||||
$year_end = strtotime(date('Y-12-31', time()));
|
||||
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'like' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}' ORDER BY ddv_Sn DESC";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取value点赞的人
|
||||
function value_whos_like($identify){
|
||||
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Identify = ? and ddv_Type = 'like' and ddv_Comment_Name = 'value邮件' ORDER BY ddv_Createtime DESC";
|
||||
$query = $this->HT->query($sql,$identify);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取value拍砖的人
|
||||
function value_whos_unlike($identify){
|
||||
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Identify = ? and ddv_Type = 'unlike' and ddv_Comment_Name = 'value邮件' ORDER BY ddv_Createtime DESC";
|
||||
$query = $this->HT->query($sql,$identify);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//根据Identify获取value邮件
|
||||
function get_mail($identify){
|
||||
$sql = "SELECT * FROM Dingding_Mail where ddm_Identify = ?";
|
||||
$query = $this->HT->query($sql, array($identify));
|
||||
if ($query->num_rows() > 0){
|
||||
$row = $query->row();
|
||||
return $row;
|
||||
}
|
||||
else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//根据Identify获取value邮件中value的人
|
||||
function get_value($identify,$user_unionid){
|
||||
$sql = "select * from Dingding_user_mail left join Dingding_User on(ddum_Name = ddu_Name) where ddum_Identify = ? and ddu_Unionid != '$user_unionid'";
|
||||
$query = $this->HT->query($sql, array($identify));
|
||||
if ($query->num_rows() > 0){
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//统计unlike人数
|
||||
function count_unlike($unionid){
|
||||
$year_start = strtotime(date('Y-01-01', time()));
|
||||
$year_end = strtotime(date('Y-12-31', time()));
|
||||
$sql = "SELECT COUNT(*) AS count FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'unlike' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->row();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取unlike的人是那些
|
||||
function whos_unlike($unionid){
|
||||
$year_start = strtotime(date('Y-01-01', time()));
|
||||
$year_end = strtotime(date('Y-12-31', time()));
|
||||
$sql = "SELECT ddv_Name FROM Dingding_Value WHERE ddv_Comment_Unionid = ? AND ddv_Type = 'unlike' and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}' ORDER BY ddv_Sn DESC";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//获取所有点评了的人的列表
|
||||
function all_comment($unionid){
|
||||
$year_start = strtotime(date('Y-01-01', time()));
|
||||
$year_end = strtotime(date('Y-12-31', time()));
|
||||
$sql = "SELECT *
|
||||
FROM Dingding_Value
|
||||
left join Dingding_User on ddu_Unionid = ddv_User_Unionid
|
||||
left join Dingding_Mail on ddv_Identify = ddm_Identify
|
||||
where ddv_Comment_Unionid = '$unionid'
|
||||
and ddv_Createtime > '{$year_start}' and ddv_Createtime < '{$year_end}'
|
||||
ORDER BY ddv_Sn DESC";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
/*
|
||||
//获取所有点评了的人的列表
|
||||
function all_comment($unionid){
|
||||
$sql = "SELECT * FROM Dingding_Value WHERE ddv_Comment_Unionid = ? ORDER BY ddv_Sn DESC";
|
||||
$query = $this->HT->query($sql,$unionid);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
*/
|
||||
//获取所有员工的姓名以及邮箱(钉钉邮箱)
|
||||
function all_email($data = null){
|
||||
if($data){
|
||||
$where = "where ddu_Name in ($data)";
|
||||
}else{
|
||||
$where = '';
|
||||
}
|
||||
$sql = "SELECT ddu_Name,ddu_Email FROM Dingding_User ".$where;
|
||||
$query = $this->HT->query($sql);
|
||||
$row = $query->result();
|
||||
return $row;
|
||||
}
|
||||
|
||||
//根据名字确定是否存在
|
||||
public function has_user($user_name){
|
||||
$sql="SELECT * FROM Dingding_User WHERE ddu_Name='$user_name' ";
|
||||
$query = $this->HT->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
//新增value邮件
|
||||
public function add_mail($data){
|
||||
$sql="INSERT INTO Dingding_Mail(
|
||||
ddm_subject,
|
||||
ddm_content,
|
||||
ddm_touser,
|
||||
ddm_ccuser,
|
||||
ddm_fromuser,
|
||||
ddm_value_key,
|
||||
ddm_identify,
|
||||
ddm_createtime
|
||||
)
|
||||
VALUES (N?,N?,N?,N?,N?,?,?,?)";
|
||||
$this->HT->query($sql, array($data['mail_subject'],$data['mail_content'],$data['mail_touser'],$data['mail_ccuser'],$data['mail_fromuser'],$data['mail_value_key'],$data['mail_identify'],$data['mail_createtime']));
|
||||
return $this->HT->last_id('Dingding_Mail');
|
||||
}
|
||||
|
||||
//新增value的名单
|
||||
public function add_value_user($data){
|
||||
$sql="INSERT INTO Dingding_User_Mail (
|
||||
ddum_name,
|
||||
ddum_identify,
|
||||
ddum_createtime)
|
||||
VALUES (?,?,?)";
|
||||
$this->HT->query($sql, array($data['value_user_name'],$data['value_user_identify'],$data['value_user_createtime']));
|
||||
return $this->HT->last_id('webht_user_mail');
|
||||
}
|
||||
|
||||
//检测是否已经点赞(仅用于value邮件点赞)
|
||||
public function is_liked($data){
|
||||
$sql = "select * from Dingding_Value where ddv_Identify = ? and ddv_User_Unionid = ? and ddv_Comment_Name = 'value邮件'";
|
||||
$query = $this->HT->query($sql,array($data['mail_identify'],$data['user_unionid']));
|
||||
if($query->num_rows() >= 1){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//获取用户最新一次被点赞的时间以及人
|
||||
public function get_user_time($unionid,$user_unionid,$identify=false){
|
||||
if($identify){
|
||||
$where = "and ddv_identify = '$identify'";
|
||||
}else{
|
||||
$where = "";
|
||||
}
|
||||
$sql = "select ddv_Name,ddv_Createtime from Dingding_Value where ddv_Comment_Unionid = '$unionid' and ddv_User_Unionid = '$user_unionid'$where order by ddv_Createtime desc";
|
||||
$query = $this->HT->query($sql);
|
||||
if($query){
|
||||
return $query->row();
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//获取最新一次被评论的时间
|
||||
public function get_last_comment($comment_name,$comment_unionid){
|
||||
$sql = "select
|
||||
top 1 *
|
||||
from
|
||||
Dingding_Value
|
||||
where
|
||||
ddv_Comment_Name = '$comment_name'
|
||||
and
|
||||
ddv_Comment_Unionid = '$comment_unionid'
|
||||
and
|
||||
ddv_Type in ('comment','hidden_comment')
|
||||
order by
|
||||
ddv_Createtime desc";
|
||||
$query = $this->HT->query($sql);
|
||||
$result=$query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
//获取点赞排行榜
|
||||
public function get_person_rank($from_date=false,$to_date=false){
|
||||
$datesql="";
|
||||
if ($from_date) {
|
||||
$datesql=" AND ddv_Createtime BETWEEN '$from_date' AND '$to_date' ";
|
||||
}
|
||||
$sql="SELECT TOP 15
|
||||
ddv_Comment_Name,
|
||||
ddv_Comment_Unionid,
|
||||
COUNT(ddv_Comment_Name) as like_count
|
||||
FROM Dingding_Value
|
||||
WHERE ddv_Type='like' AND ddv_Comment_Name != 'value邮件'
|
||||
$datesql
|
||||
GROUP BY ddv_Comment_Name,ddv_Comment_Unionid
|
||||
ORDER BY like_count DESC";
|
||||
|
||||
$query = $this->HT->query($sql);
|
||||
$result=$query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
//更新用户信息
|
||||
function update_dingding_user($name,$unionid,$mobile,$email,$position,$avatar,$time){
|
||||
$sql = "UPDATE Dingding_User SET
|
||||
ddu_Name = '$name',
|
||||
ddu_Mobile = '$mobile',
|
||||
ddu_Email = '$email',
|
||||
ddu_Position = '$position',
|
||||
ddu_Avatar = '$avatar',
|
||||
ddu_Datetime = '$time'
|
||||
WHERE ddu_Unionid = '$unionid'";
|
||||
$query = $this->HT->query($sql);
|
||||
if ($query){
|
||||
return true;
|
||||
}else{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//获取value邮件列表
|
||||
public function get_valuemail_list(){
|
||||
$year = strtotime(date('Y-01-01'));
|
||||
$sql = "select * from Dingding_Mail where ddm_Createtime > '$year' order by ddm_Createtime desc ";
|
||||
$query = $this->HT->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
//获取所有value邮件所用的价值观
|
||||
public function get_allvalueitems(){
|
||||
$sql = "select ddm_value_key from Dingding_Mail where ddm_value_key != ''";
|
||||
$query = $this->HT->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
public function delete_value($sn){
|
||||
$sql = "DELETE FROM Dingding_Value WHERE ddv_Sn = '{$sn}'";
|
||||
$query = $this->HT->query($sql);
|
||||
}
|
||||
|
||||
public function test(){
|
||||
$sql = "delete from Dingding_Value where ddv_Sn = '9125'";
|
||||
$query = $this->HT->query($sql);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>value系统登录</title>
|
||||
<link href="http://data.chtcdn.com/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="http://data.chtcdn.com/js/poshytip/tip-yellow/tip-yellow.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://data.chtcdn.com/js/modaldialog/css/jquery.modaldialog.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://data.chtcdn.com/js/kindeditor/themes/default/default.css" type="text/css" media="screen" />
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/jquery.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/poshytip/jquery.poshytip.min.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/jquery.form.min.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/modaldialog/jquery.modaldialog.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/kindeditor/kindeditor-min.js"></script>
|
||||
<script type="text/javascript" src="http://data.chtcdn.com/js/basic.js"></script>
|
||||
<script src="https://g.alicdn.com/dingding/dinglogin/0.0.2/ddLogin.js"></script>
|
||||
<script type="text/javascript" src="/dinglogin/dingmail.js"></script>
|
||||
<link rel="stylesheet" href="/dinglogin/dingding.css">
|
||||
<!--
|
||||
<link rel="stylesheet" href="/min/?f=/bootstrap/css/bootstrap.min.css,/js/poshytip/tip-yellow/tip-yellow.css,/js/modaldialog/css/jquery.modaldialog.css,/js/kindeditor/themes/default/default.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="/min/?f=/js/jquery.js,/bootstrap/js/bootstrap.min.js,/js/poshytip/jquery.poshytip.min.js,/js/jquery.form.min.js,/js/modaldialog/jquery.modaldialog.js,/js/kindeditor/kindeditor-min.js,/js/basic.js"></script>
|
||||
|
||||
-->
|
||||
|
||||
<link rel="shortcut icon" href="http://data.chtcdn.com/bootstrap/img/glyphicons_290_skull.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span3"></div>
|
||||
<div class="span6">
|
||||
<form action="<?php echo site_url('login/check') ?>" class="form-horizontal" name="form_login" id="form_login" method="post">
|
||||
<legend>
|
||||
<p>Welcome</p>
|
||||
<div class="login_header">
|
||||
<div class="login_type login_type_active">钉钉扫码登录</div>
|
||||
<div class="login_type"><a href="https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=dingoagxeeheunc0p95eu8&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=http://www.mycht.cn/webht.php/apps/dingmail/index/auth_login">钉钉账号密码登录</a></div>
|
||||
</div>
|
||||
</legend>
|
||||
<div class="ding_login">
|
||||
<div id="login_container"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="alert alert-error">
|
||||
<h4>IE6 isn't allowed!</h4>
|
||||
Please use Google Chrome, Firefox, Safair, or IE7+.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="span3"></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -0,0 +1,251 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>HT在线平台</title>
|
||||
<!-- <link href="/css/webht/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/webht/webht.css?v=1" rel="stylesheet">-->
|
||||
<link href="/min?f=/css/webht/bootstrap.min.css,/css/webht/webht.css" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!--
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/webht.js?v=1"></script>
|
||||
-->
|
||||
<script src="/min?f=/js/jquery.min.js,/js/bootstrap.min.js,/js/webht.js,/js/jquery.suggest.js"></script>
|
||||
<script src="/js/jquery-ui.min.js?v=1"></script>
|
||||
|
||||
<link href="/css/webht/jquery-ui-1.10.0.custom.css" rel="stylesheet">
|
||||
|
||||
<link rel="shortcut icon" href="/css/images/webht.jpg">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse navbar-red">
|
||||
<div class="container-fluid">
|
||||
<!-- Brand and toggle get grouped for better mobile display -->
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="<?php echo site_url('');?>"><span class="icon-home"></span> 中华游在线</a>
|
||||
<a class="navbar-brand visible-xs-block"><?php if(isset($navtitle)) echo $navtitle;?></a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="<?php echo site_url('apps/dingmail/index/mail_index');?>">Value发送</a></li>
|
||||
<li><a href="<?php echo site_url('apps/dingmail/index/index/'.$this->session->userdata('dingding_user_info')->ddu_Unionid);?>">个人中心</a></li>
|
||||
<li><a href="<?php echo site_url('apps/dingmail/index/rank_person');?>">排行榜</a></li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="<?php echo site_url('apps/dingmail/index/logout');?>">退出</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- /.container-fluid -->
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-xs-24 btn-lg"></div>
|
||||
<div class="col-xs-24">
|
||||
<h3>个人获赞排行榜</h3>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="col-xs-24 bg-white min-height-500">
|
||||
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
|
||||
<div class="col-xs-4"><p style="font-size:15px;color:#333;padding-top:8px;">周榜</p></div>
|
||||
<div class="col-xs-10"><input class="form-control" placeholder="起始时间" id="from_time" value=""/></div>
|
||||
<div class="col-xs-10"><input class="form-control" placeholder="截止时间" id="to_time" value=""/></div>
|
||||
</div>
|
||||
<ul class="nav rank_ul" id="week_data">
|
||||
<?php foreach ($rank_week as $key_rw => $rw) { ?>
|
||||
<li class="col-xs-24 nopadding">
|
||||
<span class="text-danger<?php echo $key_rw+1; ?>">No.<?php echo $key_rw+1; ?></span>
|
||||
<span>
|
||||
<a href="<?php echo site_url('apps/dingmail/index/index/'.$rw->ddv_Comment_Unionid); ?>">
|
||||
<?php echo $rw->ddv_Comment_Name; ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="badge pull-right"><?php echo $rw->like_count;?> like</span>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if(empty($rank_week)) { ?><p>暂无数据</p><?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="col-xs-24 bg-white min-height-500">
|
||||
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
|
||||
<div class="col-xs-4"><p style="font-size:15px;color:#333;padding-top:8px;">月榜</p></div>
|
||||
<div class="col-xs-10">
|
||||
<select class="form-control" id="month_time">
|
||||
<option select="selected" value="null">选择月份</option>
|
||||
<option value="1">一月</option>
|
||||
<option value="2">二月</option>
|
||||
<option value="3">三月</option>
|
||||
<option value="4">四月</option>
|
||||
<option value="5">五月</option>
|
||||
<option value="6">六月</option>
|
||||
<option value="7">七月</option>
|
||||
<option value="8">八月</option>
|
||||
<option value="9">九月</option>
|
||||
<option value="10">十月</option>
|
||||
<option value="11">十一月</option>
|
||||
<option value="12">十二月</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-10">
|
||||
<select class="form-control" id="month_year_time">
|
||||
<!--<option select="selected" value="null">选择年份</option>-->
|
||||
<?php
|
||||
for($i=2017; $i<=date('Y'); $i++){
|
||||
if($i == date('Y')){
|
||||
echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
|
||||
}else{
|
||||
echo '<option value="'.$i.'">'.$i.'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav rank_ul" id="month_data">
|
||||
<?php foreach ($rank_month as $key_rm => $rm) { ?>
|
||||
<li class="col-xs-24 nopadding">
|
||||
<span class="text-danger<?php echo $key_rm+1; ?>">No.<?php echo $key_rm+1; ?></span>
|
||||
<span>
|
||||
<a href="<?php echo site_url('apps/dingmail/index/index/'.$rm->ddv_Comment_Unionid); ?>">
|
||||
<?php echo $rm->ddv_Comment_Name; ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="badge pull-right"><?php echo $rm->like_count;?> like</span>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if(empty($rank_month)) { ?><p>暂无数据</p><?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-8">
|
||||
<div class="col-xs-24 bg-white min-height-500">
|
||||
<div class="row" style="border-bottom:1px solid #e5e5e5;margin-bottom:20px;">
|
||||
<div class="col-xs-6"><p style="font-size:15px;color:#333;padding-top:8px;">年榜</p></div>
|
||||
<div class="col-xs-18">
|
||||
<select class="form-control" id="year_time">
|
||||
<?php
|
||||
for($i=2017; $i<=date('Y'); $i++){
|
||||
if($i == date('Y')){
|
||||
echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
|
||||
}else{
|
||||
echo '<option value="'.$i.'">'.$i.'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav rank_ul" id="year_data">
|
||||
<?php foreach ($rank_year as $key_ry => $ry) { ?>
|
||||
<li class="col-xs-24 nopadding">
|
||||
<span class="text-danger<?php echo $key_ry+1; ?>">No.<?php echo $key_ry+1; ?></span>
|
||||
<span>
|
||||
<a href="<?php echo site_url('apps/dingmail/index/index/'.$ry->ddv_Comment_Unionid); ?>">
|
||||
<?php echo $ry->ddv_Comment_Name; ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="badge pull-right"><?php echo $ry->like_count;?> like</span>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if(empty($rank_year)) { ?><p>暂无数据</p><?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
$(function(){
|
||||
//日期选择
|
||||
$('#from_time,#to_time').datepicker({
|
||||
|
||||
});
|
||||
|
||||
//周榜触发事件
|
||||
var from_time = '';
|
||||
var to_time = '';
|
||||
var month_time = '';
|
||||
var year_time = '';
|
||||
var type = '';
|
||||
var month_year_time = '';
|
||||
$('#from_time,#to_time').change(function(){
|
||||
from_time = $('#from_time').val();
|
||||
to_time = $('#to_time').val();
|
||||
if(from_time != '' && to_time != ''){
|
||||
type = 'week';
|
||||
ajax_gethtml(from_time,to_time,type);
|
||||
}
|
||||
});
|
||||
|
||||
//月榜触发事件
|
||||
$('#month_time').change(function(){
|
||||
month_time = $('#month_time').val();
|
||||
month_year_time = $('#month_year_time').val();
|
||||
if(month_time != null){
|
||||
type = 'month';
|
||||
if(month_year_time == 'null'){
|
||||
var myDate = new Date();
|
||||
from_time = myDate.getFullYear()+'-'+month_time+'-01';
|
||||
}else{
|
||||
from_time = month_year_time+'-'+month_time+'-01';
|
||||
}
|
||||
to_time = '';
|
||||
ajax_gethtml(from_time,to_time,type);
|
||||
}
|
||||
});
|
||||
|
||||
$('#month_year_time').change(function(){
|
||||
month_time = $('#month_time').val();
|
||||
month_year_time = $('#month_year_time').val();
|
||||
if(month_time != 'null'){
|
||||
type = 'month';
|
||||
from_time = month_year_time+'-'+month_time+'-01';
|
||||
to_time = '';
|
||||
ajax_gethtml(from_time,to_time,type);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//年榜触发事件
|
||||
$('#year_time').change(function(){
|
||||
year_time = $('#year_time').val();
|
||||
if(year_time != null){
|
||||
type = 'year';
|
||||
from_time = year_time+'-01-01';
|
||||
to_time = year_time+'-12-31';
|
||||
ajax_gethtml(from_time,to_time,type);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function ajax_gethtml(from_time,to_time,type){
|
||||
$.ajax({
|
||||
url:'http://www.mycht.cn/webht.php/apps/dingmail/index/ajax_get_data/?from_time='+from_time+'&to_time='+to_time+'&type='+type,
|
||||
type:'get',
|
||||
success:function(data){
|
||||
$('#'+type+'_data').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue