<?php
 namespace App\Util; use TechOnline\Laravel\Dao\ModelUtil; class MemberVipQuotaUtil { 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); } }