<?php
/*
@author waychar
@技术支持 150572314@qq.com
@copyright 2018 waychar.cn 声明：本代码可以用于学习交流使用及要商业化用途
*/
class home extends db
{


    public function reg_list()
    {
        $sql = "select race_title,race.start_time,id from race where id in (select race_id from race_reg where is_del=0 and user_id = ".$_COOKIE['id'].") order by id desc";
    //echo $sql;
        $result=$this->get_data($sql);
        
        return $result;
    }

    public function reg_msg($race_id)
    {
        $sql = "select * from race_reg where user_id = ".$_COOKIE['id']." and race_id = $race_id";
        //echo $sql ;
        $result = $this->get_data($sql);
        return $result;
    }

    public function getimg($id)
    {
        $sql = "select images_url from race_images where race_id = $id and is_index = 1";
        $result = $this->get_One($sql);
        return $result;
    }
}
