Commit c630fc36 authored by houdong's avatar houdong

交易页面加周排名

parent a819f93e
......@@ -1332,15 +1332,16 @@ class IndexAction extends IdentityAction {
}
public function getMyData(){
$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);
$table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a';
//->cache(true,cacheTime())
$myData = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find();
if(!empty($myData)){
$myData['userId']=$userId;
$myData['userName']=$this->user['userName'];
$tData = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->find();
if(!empty($tData)){
$myData['lastweekup']=$tData['lastweekup'];
$myData['monthzzl']=$tData['monthzzl'];
//取周排行
$where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
//->cache(true,cacheTime())
......
......@@ -1543,11 +1543,12 @@ class PkTopAction extends IdentityAction{
public function setMyData(){
$userId = $this->user['userID'];
if($userId){
$myData=['userId'=>$userId,'userName'=>$this->user['userName']];
$tid=$this->GID.'X'.$userId;
$myData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->cache(true,300)->find();
if(!empty($myData)){
$myData['userId']=$userId;
$myData['userName']=$this->user['userName'];
$tData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->cache(true,300)->find();
if(!empty($tData)){
$myData['lastweekup']=$tData['lastweekup'];
$myData['monthzzl']=$tData['monthzzl'];
$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();
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