Commit fd9f29e0 authored by houdong's avatar houdong

更多大赛

parent d8268e8a
......@@ -5,14 +5,15 @@ class NiuModel extends Model{
public function getMoreDs($userId,$source='m') {
$STATUS_TXT =array('1'=>'未开赛','2'=>'进行中','3'=>'已结束');
$ids = D('Group')->getGroupCache($userId);
$MAP=[NIU_BAI_ID=>M_URL.'/Niubai',NIU_SAN_ID=>M_URL.'/Niusan',NIU_STRONG_ID=>M_URL.'/Strong',M2M_GROUP=>M_URL.'/M2m'];
if($source=='m'){
$MAP[PRIZE_GROUP_2021]='/PkTop';
$MAP[ZHONGJIN_GROUP]=M_URL.'/Zjds';
}else{
$MAP[PRIZE_GROUP_2021]='/';
$MAP[ZHONGJIN_GROUP]=WWW_URL.'/Zjds';
}
// $MAP=[NIU_BAI_ID=>M_URL.'/Niubai',NIU_SAN_ID=>M_URL.'/Niusan',NIU_STRONG_ID=>M_URL.'/Strong',M2M_GROUP=>M_URL.'/M2m'];
// if($source=='m'){
// $MAP[PRIZE_GROUP_2021]='/PkTop';
// $MAP[ZHONGJIN_GROUP]=M_URL.'/Zjds';
// }else{
// $MAP[PRIZE_GROUP_2021]='/';
// $MAP[ZHONGJIN_GROUP]=WWW_URL.'/Zjds';
// }
$MAP=[ZHONGJIN_GROUP=>1,PRIZE_GROUP_2021=>2,M2M_GROUP=>3,NIU_BAI_ID=>4,NIU_SAN_ID=>5,NIU_STRONG_ID=>6];
$where=['a.group_id'=>['in',array_keys($MAP)]];
$gList = M('Group a')->join('left join cofool_group_info b on a.group_id=b.group_id')
......@@ -23,7 +24,8 @@ class NiuModel extends Model{
$gid=$g['group_id'];
$g['active']=$gid==PRIZE_GROUP_2021?1:0;
$g['joinStatus']=in_array($gid,$ids)?1:0;
$g['url']=$MAP[$gid];
// $g['url']=$MAP[$gid];
$g['order']=$MAP[$gid];
$len=$source=='m'?40:60;
if(mb_strlen($g['introduction'])>$len){
$g['introduction'] = msubstr($g['introduction'],0,$len,'utf-8').'...';
......@@ -41,6 +43,8 @@ class NiuModel extends Model{
$g["gotoTrade"]=json_encode($gotoTrade);
}
$order = array_column($gList,'order');
array_multisort($order,SORT_ASC,$gList);
return $gList;
}
......
......@@ -9,8 +9,10 @@
<div class="item-block">
<div class="ds-img"><img src="{$vo.cover}" alt=""></div>
<div class="ds-right-info">
<a href="{$vo.url}" class="info-title" target="_blank"><img class="gf-icon" src="__PUBLIC__/Home/images/g2020/gf-icon.png" alt="">{$vo.name}
<img class="jiang" src="__PUBLIC__/Home/images/g2020/jiang-icon.png" alt=""></a>
<a href="{:M_URL}{:U('/Match/detail',['id'=>$vo['group_id']])}" class="info-title" >
<img class="gf-icon" src="__PUBLIC__/Home/images/g2020/gf-icon.png" alt="">{$vo.name}
<img class="jiang" src="__PUBLIC__/Home/images/g2020/jiang-icon.png" alt="">
</a>
<div class="ds-des">{$vo.introduction}</div>
</div>
</div>
......@@ -20,7 +22,7 @@
<a href="javascript:;" class="join-btn gotoTrade" gotoTrade="{$vo.gotoTrade}">
<img src="__PUBLIC__/Home/images/g2020/cs-left.png" alt=""><span>进入交易</span>
</a>
<else/>
<else/>
<if condition="$gid__ eq $vo['group_id']">
<a href="javascript:;" class="join-btn baoming"><img src="__PUBLIC__/Home/images/g2020/cs-left.png" alt=""><span>报名参赛</span></a>
<else/>
......
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