<?php
 namespace Module\Question\Util; use ModStart\Core\Dao\ModelUtil; class QuestionMemberVipQuotaUtil { public static function questionViewCountToday($memberUserId) { return ModelUtil::count('member_vip_quota_question_view', [ 'memberUserId' => $memberUserId, 'day' => date('Y-m-d'), ]); } public static function questionViewPut($memberUserId, $questionId) { $where = [ 'memberUserId' => $memberUserId, 'day' => date('Y-m-d'), 'questionId' => $questionId, ]; if (ModelUtil::exists('member_vip_quota_question_view', $where)) { return; } ModelUtil::insert('member_vip_quota_question_view', $where); } public static function questionViewed($memberUserId, $questionId) { $where = [ 'memberUserId' => $memberUserId, 'day' => date('Y-m-d'), 'questionId' => $questionId, ]; return ModelUtil::exists('member_vip_quota_question_view', $where); } }