处理签到

This commit is contained in:
evoxwht 2023-06-01 09:28:50 +08:00
parent b6fb32e85c
commit 463382a641
2 changed files with 9 additions and 13 deletions

View File

@ -139,21 +139,17 @@ class UserSignServices extends BaseServices
if (!$user) {
throw new ApiException(410032);
}
if ($this->getIsSign($uid, 'today')) {
throw new ApiException(410293);
}
// if ($this->getIsSign($uid, 'today')) {
// throw new ApiException(410293);
// }
$sign_num = 0;
$user_sign_num = $user['sign_num'];
//检测昨天是否签到
if ($this->getIsSign($uid, 'yesterday')) {
if ($user->sign_num > (count($sign_list) - 1)) {
$user->sign_num = 0;
}
} else {
$user->sign_num = 0;
}
// if (!$this->getIsSign($uid, 'yesterday')) {
// $user->sign_num = 0;
// }
foreach ($sign_list as $key => $item) {
if ($key == $user->sign_num) {
if ($key == $user->sign_num || ($user->sign_num > 6 && $key == 6)) {
$sign_num = $item['sign_num'];
break;
}

View File

@ -27,7 +27,7 @@
{{(item.day==$t(`第七天`) || item.day==$t(`第7天`))?$t(`奖励`):$t(item.day)}}
</view>
<view class='venus'
:class="(index + 1 === signSystemList.length ? 'reward' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')">
:class="(index + 1 === signSystemList.length ? 'venusSelect' : '') + ' ' +(sign_index >= index + 1 ? 'venusSelect' : '')">
</view>
<view class='num' :class="sign_index >= index + 1 ? 'on' : ''">+{{item.sign_num}}</view>
</view>