fix:首页统计
This commit is contained in:
@@ -136,11 +136,13 @@ class AuthController extends Controller
|
||||
$user = $request->user('api');
|
||||
if ($user->type === UserType::MEMBER) {
|
||||
$user->load('vipPackage:id,name,config');
|
||||
$user->link_amount = $user->yuanma_amount = $user->dy_card_amount = 0;
|
||||
$user->link_amount = $user->link_total = $user->link_created = 0;
|
||||
$config = $user->vipPackage['config'] ?? null;
|
||||
if ($config) {
|
||||
$link_count = Link::query()->where('user_id', $user->id)->count();
|
||||
$user->link_amount = bcsub($config['count_limit'], $link_count);
|
||||
$user->link_total = (int) $config['count_limit'];
|
||||
$user->link_created = $link_count;
|
||||
$user->link_amount = (int) bcsub($config['count_limit'], $link_count);
|
||||
}
|
||||
}
|
||||
$user->login_time = $user->currentAccessToken()->created_at;
|
||||
|
||||
@@ -24,7 +24,8 @@ class IndexController extends Controller
|
||||
if (DB::table('sys_configs')->count() > 0) {
|
||||
return redirect('/');
|
||||
}
|
||||
} catch (\Exception $e) {}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
|
||||
$is_goon = true;
|
||||
$data = [
|
||||
|
||||
@@ -25,8 +25,8 @@ class UserInfoResource extends JsonResource
|
||||
$this->mergeWhen($this->type === UserType::MEMBER, [
|
||||
'vip_package' => $this->vipPackage,
|
||||
'link_amount' => $this->link_amount,
|
||||
'yuanma_amount' => $this->yuanma_amount,
|
||||
'dy_card_amount' => $this->dy_card_amount,
|
||||
'link_total' => $this->link_total,
|
||||
'link_created' => $this->link_created,
|
||||
'referral_code' => $this->referral_code,
|
||||
'commission' => $this->commission, // 未提现佣金
|
||||
'accumulate_commission' => $this->accumulate_commission, // 累计佣金
|
||||
|
||||
Reference in New Issue
Block a user