public function isAbleToCheckin()
    {
        $last = $this->attributes['last_check_in_time'];
    
        $now = time(); 
        if(date("Ymd", $now)!= date("Ymd", $last) ){
            return true;
        }
        return false;
    }这个模板是网上找的,一个签到的判定语句。我想在加一个判断,比如MySQL里有个user的用户表,怎么能让表里class >=6的用户禁止签到
[img=https://img-bbs.csdn.net/upload/201702/27/1488203089_918900.jpg][/img谢谢大佬了!!

解决方案 »

  1.   

    select* from table_name where case>6;
    通过查询出来,然后返回false,还有你这个说得需求一点都不清楚
      

  2.   

    在时间不等的后面加上与条件class<=6同时成立返回true
      

  3.   

    大佬@underdogs        
     if(date("Ymd", $now)!= date("Ymd", $last) class<="6" ){
                return true;
            }是这样的吗?
      

  4.   

    echo $this->attributes['class'];
    看看是什么