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谢谢大佬了!!
{
$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谢谢大佬了!!
通过查询出来,然后返回false,还有你这个说得需求一点都不清楚
if(date("Ymd", $now)!= date("Ymd", $last) class<="6" ){
return true;
}是这样的吗?
看看是什么