6
0
Fork 0
jiqu-library-server/tests/Feature/ExampleTest.php

36 lines
800 B
PHP

<?php
namespace Tests\Feature;
use App\Enums\PayWay;
use App\Models\Agent;
use App\Models\User;
use App\Services\DistributeService;
use App\Services\Payment\WxpayService;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
use App\Models\Order;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function test_example()
{
$share = 'Y';
$user = User::find(4);
$agentIds = User::whereIn('id', $user->userInfo->parent_ids)->pluck('agent_id');
dump($user->userInfo->parent_ids);
$ratio = Agent::whereIn('id', $agentIds)->sum('ratio');
// 没有提成
if ($ratio == 0) {
$share = 'N';
}
dump($share);
$this->assertTrue(true);
}
}