1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-26 20:52:44 +08:00
koogua 2f119c65e8 !4 v1.1.0版本develop->demo
* 完善后台今日统计,增加权限白名单,增加后台首页菜单,调整后台登录页样式
* Merge branch 'koogua/I1XFCF' of https://gitee.com/koogua/course-tencen…
* 前台学习资料部分完成
* !2 后台运营统计合并
* 后台学习资料部分完成
2020-10-08 17:20:43 +08:00

30 lines
632 B
PHP

<?php
namespace App\Repos;
use App\Models\Online as OnlineModel;
use Phalcon\Mvc\Model;
class Online extends Repository
{
/**
* @param int $userId
* @param string $activeDate
* @return OnlineModel|Model|bool
*/
public function findByUserDate($userId, $activeDate)
{
$activeTime = strtotime($activeDate);
return OnlineModel::findFirst([
'conditions' => 'user_id = ?1 AND active_time BETWEEN ?2 AND ?3',
'bind' => [
1 => $userId,
2 => $activeTime,
3 => $activeTime + 86400,
],
]);
}
}