阶段性更新
This commit is contained in:
23
app/Admin/Renderable/User/Rule.php
Normal file
23
app/Admin/Renderable/User/Rule.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Renderable\User;
|
||||
|
||||
use App\Models\User;
|
||||
use Encore\Admin\Widgets\Table;
|
||||
use Illuminate\Contracts\Support\Renderable;
|
||||
|
||||
class Rule implements Renderable
|
||||
{
|
||||
|
||||
public function render($key = null)
|
||||
{
|
||||
$user = User::find($key);
|
||||
$codes = $user->code->map(function ($code) {
|
||||
return $code->only(['name', 'code', 'profit']);
|
||||
});
|
||||
$table = new Table(['名称', '规则项', '分润金额(元)'], $codes->toArray());
|
||||
|
||||
return $table->render();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user