改进 推介系统
This commit is contained in:
parent
16cec5c737
commit
381fcf3938
@ -16,9 +16,9 @@ class AffiliateController extends Controller
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(): View|RedirectResponse
|
||||
public function index(Request $request): View|RedirectResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
$user = $request->user('web');
|
||||
$user->load('affiliate');
|
||||
|
||||
$affiliate = $user->affiliate;
|
||||
@ -36,9 +36,9 @@ public function index(): View|RedirectResponse
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create(): View|RedirectResponse
|
||||
public function create(Request $request): View|RedirectResponse
|
||||
{
|
||||
$user = auth('web')->user();
|
||||
$user = $request->user('web');
|
||||
$user->load('affiliate', 'affiliateUser.affiliate.user');
|
||||
|
||||
if ($user->affiliate) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
'billing' => [
|
||||
'commission' => '0.1',
|
||||
// 推介佣金比例
|
||||
'commission_referral' => '0.05',
|
||||
'commission_referral' => '0.8',
|
||||
],
|
||||
'wecom' => [
|
||||
'robot_hook' => [
|
||||
|
@ -6,9 +6,14 @@
|
||||
|
||||
<h3>加入推介计划</h3>
|
||||
<p>
|
||||
让更多人用上我们的产品,您将从他们实名认证成功之后的每笔充值中获取 {{ config('settings.billing.commission_referral') * 100 . '%' }}
|
||||
让更多人用上我们的产品,您将从他们实人认证成功之后的每笔充值中获取 {{ config('settings.billing.commission_referral') * 100 . '%' }}
|
||||
的佣金。</p>
|
||||
|
||||
{{-- @php($amount = 1)--}}
|
||||
|
||||
{{-- <p>比如,下属用户在实人认证成功后充值了 {{$amount}}--}}
|
||||
{{-- 元,您将获得 {{ $amount / (config('settings.billing.commission_referral') * 100) }} 元的佣金。</p>--}}
|
||||
|
||||
@if ($user->affiliate_id)
|
||||
<span>您被 {{ $user->affiliateUser->affiliate->user->name }}#{{ $user->affiliateUser->affiliate->user_id }} 引荐。</span>
|
||||
@if ($user->affiliateUser->affiliate->revenue > 5)
|
||||
@ -18,7 +23,7 @@
|
||||
|
||||
<form class="mt-3" method="post" action="{{ route('affiliates.store') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-primary">加入推介计划</button>
|
||||
<button type="submit" class="btn btn-sm btn-primary">加入推介计划</button>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
@ -3,6 +3,7 @@
|
||||
@section('title', '推介计划')
|
||||
|
||||
@section('content')
|
||||
@php($url = \Illuminate\Support\Facades\URL::route('affiliates.show', $affiliate->uuid))
|
||||
|
||||
<h3>推介计划</h3>
|
||||
|
||||
@ -13,16 +14,17 @@
|
||||
盈利:{{ $affiliate->revenue }} 元
|
||||
</p>
|
||||
|
||||
<p>推介 URL: {{ \Illuminate\Support\Facades\URL::route('affiliates.show', $affiliate->uuid) }}</p>
|
||||
<p>推介 URL: {{ $url }}</p>
|
||||
|
||||
<h3>用户列表</h3>
|
||||
@php($count = $affiliateUsers->count())
|
||||
@if ($count)
|
||||
<h4>用户列表</h4>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">用户名</th>
|
||||
<th scope="col">盈利</th>
|
||||
<th scope="col">实人状态</th>
|
||||
<th scope="col">注册时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -31,22 +33,40 @@
|
||||
<tr>
|
||||
<td>{{ $user->user->name }}</td>
|
||||
<td>{{ $user->revenue }} 元</td>
|
||||
|
||||
<td>
|
||||
@if ($user->real_name_verified_at)
|
||||
完成
|
||||
@else
|
||||
<span class="text-danger">未完成</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>{{ $user->created_at }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $affiliateUsers->links() }}
|
||||
@else
|
||||
<p>您还没有推介用户。</p>
|
||||
@endif
|
||||
|
||||
<h4>广告词</h4>
|
||||
<p>您可以定义一个广告词来收获更多的用户。让新用户访问您的推介 URL 并完成注册,您就会获得一个下属用户。</p>
|
||||
|
||||
<h4>金额到账时间</h4>
|
||||
<p>
|
||||
当您的下属用户完成实人认证后并充值,之后的充值所获得的佣金将会立即到您的余额。
|
||||
</p>
|
||||
|
||||
<h4>佣金计算方式</h4>
|
||||
<p>佣金 = 下属用户充值总额 / ({{config('settings.billing.commission_referral')}} * 100)</p>
|
||||
|
||||
<h4>离开推介计划</h4>
|
||||
<form method="post" action="{{ route('affiliates.destroy', $affiliate->id) }}"
|
||||
onclick="return confirm('删除后将不会获得收益,推介数据也会被删除。')">
|
||||
onclick="return confirm('离开除后将不会获得收益,关联的推介数据也会被删除。')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-danger">删除推介计划</button>
|
||||
<button type="submit" class="btn btn-sm btn-danger">离开</button>
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
Loading…
Reference in New Issue
Block a user