/** * 当天、月、总签到的用户 */ public function query($date = '') { if ($date == '') { $datas = UserSignModel::where('created_at', '>', strtotime($this->fromtime))->where('created_at', '<', strtotime($this->totime))->orderBy('id', 'desc')->paginate($this->limit); } elseif ($date == 'month') { $datas = UserSignModel::where('created_at', '>', strtotime($this->fromMonth))->where('created_at', '<', strtotime($this->toMonth))->orderBy('id', 'desc')->paginate($this->limit); } elseif ($date == 'all') { $datas = UserSignModel::orderBy('id', 'desc')->paginate($this->limit); } $datas->hasDay = $this->getDaySign() ? 1 : 0; $datas->limit = $this->limit; return $datas; }
public function getSigns() { $datas = UserSignModel::orderBy('id', 'desc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }