阶段性更新

This commit is contained in:
2020-10-13 08:49:57 +08:00
parent 7cfd45bf99
commit d8cd8ae9a6
21 changed files with 420 additions and 423 deletions

View 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();
}
}