Exemplo n.º 1
0
 public function score_list()
 {
     $ScorenoteModel = new \Common\Model\ScorenoteModel();
     $uid = $this->uid;
     $where['id'] = array("GT", 0);
     $where['uid'] = $uid;
     $count = $ScorenoteModel->where($where)->count();
     $size = 15;
     //每页显示条数
     $Page = new \Think\Page($count, $size);
     $pages = $Page->show();
     // 分页显示输出
     $list = $ScorenoteModel->where($where)->limit($Page->firstRow . ',' . $Page->listRows)->select();
     $this->assign("list", $list);
     $this->assign("count", $count);
     $this->assign("start", $Page->firstRow);
     $this->assign("end", $Page->firstRow + $size);
     $this->assign("pages", $pages);
     $this->display();
 }
Exemplo n.º 2
0
 public function index()
 {
     //用户积分查询
     $ScorenoteModel = new \Common\Model\ScorenoteModel();
     $uid = $this->uid;
     $time = time();
     $todayB = date("Y-m-d", $time) . " 00:00:00";
     //今天开始时间
     $todayE = date("Y-m-d", $time) . " 23:59:59";
     //今天结束时间
     $YesterdayB = date("Y-m-d", strtotime("-1 day")) . " 00:00:00";
     //昨天开始时间
     $YesterdayE = date("Y-m-d", strtotime("-1 day")) . " 23:59:59";
     //昨天结束时间
     $totalB = date("Y-m-d", strtotime("-7 day")) . " 00:00:00";
     //7天前开始时间
     $totalE = date("Y-m-d", $time) . " 23:59:59";
     //今天结束时间
     //------------今天积分
     $todayScore = $ScorenoteModel->where("uid=%d and cdate>'%s' and cdate<'%s'", $uid, $todayB, $todayE)->sum("score");
     if (is_null($todayScore)) {
         $todayScore = 0;
         //今天没有积分
     }
     $this->assign("todayScore", $todayScore);
     //------------今天积分
     //------------昨天积分------------
     $yesterdayScore = $ScorenoteModel->where("uid=%d and cdate>'%s' and cdate<'%s'", $uid, $YesterdayB, $YesterdayE)->sum("score");
     if (is_null($yesterdayScore)) {
         $yesterdayScore = 0;
         //今天没有积分
     }
     $this->assign("yesterdayScore", $yesterdayScore);
     //------------昨天积分----------
     //------------最近7天积分------------
     $totalScore = $ScorenoteModel->where("uid=%d and cdate>'%s' and cdate<'%s'", $uid, $totalB, $totalE)->sum("score");
     if (is_null($totalScore)) {
         $totalScore = 0;
         //今天没有积分
     }
     $this->assign("totalScore", $totalScore);
     //------------最近7天积分----------
     //End
     $brokeragenoteModel = M("brokeragenote");
     //------------------新邻居----邀请注册的人----------
     //------------今天邻居数量
     $Todayneighbor = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 0, $todayB, $todayE)->count();
     $this->assign("Todayneighbor", $Todayneighbor);
     //------------今天邻居数量
     //------------昨天邻居数量
     $yesterdayneighbor = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 0, $YesterdayB, $YesterdayE)->count();
     $this->assign("yesterdayneighbor", $yesterdayneighbor);
     //------------昨天邻居数量
     //------------最近7天邻居数量
     $totalneighbor = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 0, $totalB, $totalE)->count();
     $this->assign("totalneighbor", $totalneighbor);
     //------------最近7天邻居数量
     //------------------新邻居---------------End
     //------------------订单成交量----邀请注册的人----------
     //------------今天订单成交量
     $TodayOrder = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $todayB, $todayE)->count();
     $this->assign("TodayOrder", $TodayOrder);
     //------------今天订单成交量
     //------------昨天订单成交量
     $yesterdayOrder = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $YesterdayB, $YesterdayE)->count();
     $this->assign("yesterdayOrder", $yesterdayOrder);
     //------------昨天订单成交量
     //------------最近7天订单成交量
     $totalOrder = $brokeragenoteModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $totalB, $totalE)->count();
     $this->assign("totalOrder", $totalOrder);
     //------------最近7天订单成交量
     //------------------订单成交量---------------End
     $cooperateModel = M("cooperate");
     //对接物业--------1物业
     $type1CountToday = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $todayB, $todayE)->count();
     $this->assign("type1CountToday", $type1CountToday);
     $type1CountYes = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $YesterdayB, $YesterdayE)->count();
     $this->assign("type1CountYes", $type1CountYes);
     $type1CountTotal = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 1, $totalB, $totalE)->count();
     $this->assign("type1CountTotal", $type1CountTotal);
     //对接社区-----------2社区
     $type2CountToday = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 2, $todayB, $todayE)->count();
     $this->assign("type2CountToday", $type2CountToday);
     $type2CountYes = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 2, $YesterdayB, $YesterdayE)->count();
     $this->assign("type2CountYes", $type2CountYes);
     $type2CountTotal = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 2, $totalB, $totalE)->count();
     $this->assign("type2CountTotal", $type2CountTotal);
     //对接商家--------------3商家
     $type3CountToday = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 3, $todayB, $todayE)->count();
     $this->assign("type3CountToday", $type3CountToday);
     $type3CountYes = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 3, $YesterdayB, $YesterdayE)->count();
     $this->assign("type3CountYes", $type3CountYes);
     $type3CountTotal = $cooperateModel->where("uid=%d and type=%d and cdate>'%s' and cdate<'%s'", $uid, 3, $totalB, $totalE)->count();
     $this->assign("type3CountTotal", $type3CountTotal);
     $lists = M("content")->select();
     $this->display();
 }