优化日期显示

This commit is contained in:
兔姬桑
2020-08-03 10:18:27 +08:00
parent 9e124738f0
commit 148c72c093
3 changed files with 14 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ class DailyJob extends Command {
// 重置用户流量
private function resetUserTraffic(): void {
$userList = User::query()
->where('status', '>=', 0)
->where('status', '<>', -1)
->where('expire_time', '>', date('Y-m-d'))
->where('reset_time', '<=', date('Y-m-d'))
->get();

View File

@@ -146,6 +146,18 @@ class User extends Authenticatable {
return $this->attributes['credit'] = $value * 100;
}
public function getEnableTimeAttribute() {
return $this->attributes['enable_time'];
}
public function getExpireTimeAttribute() {
return $this->attributes['expire_time'];
}
public function getResetTimeAttribute() {
return $this->attributes['reset_time'];
}
// User查询查那些用户有传入Node的权限
public function scopeGroupUserPermit($query, $node_id = 0) {
$groups = [0];

View File

@@ -90,7 +90,7 @@
</div>
<input type="text" class="form-control" name="reset_time" id="reset_time"/>
</div>
<span class="text-help"> 账号流量重置日期 </span>
<span class="text-help"> 账号流量下一个重置日期 </span>
</div>
</div>
<div class="form-group row">