Commit c630fc36 authored by houdong's avatar houdong

交易页面加周排名

parent a819f93e
...@@ -1333,14 +1333,15 @@ class IndexAction extends IdentityAction { ...@@ -1333,14 +1333,15 @@ class IndexAction extends IdentityAction {
public function getMyData(){ public function getMyData(){
$userId = $this->user['userID']; $userId = $this->user['userID'];
$tid=$this->GID.'X'.$userId; $tid=$this->GID.'X'.$userId;
$myData=['userId'=>$userId,'userName'=>$this->user['userName']];
$suffix = D('Userinfo')->getTable($this->GID); $suffix = D('Userinfo')->getTable($this->GID);
$table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a'; $table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a';
//->cache(true,cacheTime()) //->cache(true,cacheTime())
$myData = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find(); $tData = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find();
if(!empty($myData)){ if(!empty($tData)){
$myData['userId']=$userId; $myData['lastweekup']=$tData['lastweekup'];
$myData['userName']=$this->user['userName']; $myData['monthzzl']=$tData['monthzzl'];
//取周排行 //取周排行
$where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1]; $where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
//->cache(true,cacheTime()) //->cache(true,cacheTime())
......
...@@ -1543,11 +1543,12 @@ class PkTopAction extends IdentityAction{ ...@@ -1543,11 +1543,12 @@ class PkTopAction extends IdentityAction{
public function setMyData(){ public function setMyData(){
$userId = $this->user['userID']; $userId = $this->user['userID'];
if($userId){ if($userId){
$myData=['userId'=>$userId,'userName'=>$this->user['userName']];
$tid=$this->GID.'X'.$userId; $tid=$this->GID.'X'.$userId;
$myData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->cache(true,300)->find(); $tData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->cache(true,300)->find();
if(!empty($myData)){ if(!empty($tData)){
$myData['userId']=$userId; $myData['lastweekup']=$tData['lastweekup'];
$myData['userName']=$this->user['userName']; $myData['monthzzl']=$tData['monthzzl'];
$where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1]; $where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
$weekData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where($where)->order('lastweekup desc')->cache(true,300)->select(); $weekData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where($where)->order('lastweekup desc')->cache(true,300)->select();
foreach ($weekData as $k=>$v) { foreach ($weekData as $k=>$v) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment