|
|
|
|
@ -125,7 +125,7 @@ class User extends Model
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$code->code = $temp_code;
|
|
|
|
|
$code->user = $uid;
|
|
|
|
|
$code->user_id = $uid;
|
|
|
|
|
$code->save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -133,13 +133,6 @@ class User extends Model
|
|
|
|
|
return Uuid::uuid3(Uuid::NAMESPACE_DNS, $this->attributes['id']. '|' .$this->attributes['passwd'])->toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function addManyInviteCodes($num)
|
|
|
|
|
{
|
|
|
|
|
for ($i = 0; $i < $num; $i++) {
|
|
|
|
|
$this->addInviteCode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function trafficUsagePercent()
|
|
|
|
|
{
|
|
|
|
|
$total = $this->attributes['u'] + $this->attributes['d'];
|
|
|
|
|
|