$points=M(‘points_log‘); /*查询今天是否签到*/ $begintime=date("Y-m-d H:i:s",mktime(0,0,0,date(‘m‘),date(‘d‘),date(‘Y‘))); $endtime=date("Y-m-d H:i:s",mktime(0,0,0,date(‘m‘),date(‘d‘)+1,date(‘Y‘))-1); $where=array( ‘points‘=>‘5‘, ‘user_id‘=>$userid, ‘checkin‘=>‘up‘, ‘createtime‘ => array(array(‘gt‘,$begintime),array(‘lt‘,$endtime)), ); $res=$points->where($where)->count(); //查新今天签到的条数 $status=0; if($res >= 1){ //如果签到条数大于等于1 $status=1; }else{ //否则没有签到 if($points->add($dataList)){ }
时间: 2024-10-14 03:13:24