| xqd
@@ -8,9 +8,11 @@ use App\Http\Params\ProblemParam;
|
|
|
use App\Models\PaymentLogModel;
|
|
|
use App\Models\User;
|
|
|
use App\Models\UserBlacklistModel;
|
|
|
+use App\Models\UserInviteLog;
|
|
|
use App\Models\UserLookModel;
|
|
|
use App\Models\UserProblemModel;
|
|
|
use App\Models\VipModel;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
use PHPUnit\Util\Exception;
|
|
|
use function Symfony\Component\Translation\t;
|
|
|
|
| xqd
@@ -126,11 +128,16 @@ class UserService
|
|
|
*/
|
|
|
public function invite_info(){
|
|
|
$user = auth('api')->user();
|
|
|
- //总邀请用户
|
|
|
- $total_user = User::query()->where(['pid'=>$user->id])->count();
|
|
|
-
|
|
|
- $res['total_user'] = $total_user;
|
|
|
$res['ycode'] = $user->ycode;
|
|
|
+ //总邀请用户
|
|
|
+ $res['total_user'] =User::query()->where(['pid'=>$user->id])->count();
|
|
|
+ //待领取天数
|
|
|
+ $res['unclaimed'] = UserInviteLog::query()->where(['user_id'=>$user->id,'status'=>0])->sum('day');
|
|
|
+ //累计领取天数
|
|
|
+ $res['total_day'] = UserInviteLog::query()->where(['user_id'=>$user->id,'status'=>1])->sum('day');
|
|
|
+ //奖励规则
|
|
|
+ $res['rule'] = DB::table("document")->where(['id'=>4])->value('content');
|
|
|
+ return $res;
|
|
|
}
|
|
|
}
|
|
|
|