<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Field\AbstractField; use ModStart\Field\AutoRenderedFieldValue; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Member\Util\MemberCmsUtil; class MemberCreditLogController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $P2vse) { $P2vse->init('member_credit_log')->field(function ($P2vse) { $P2vse->id('id', 'ID'); $P2vse->display('memberUserId', '用户')->hookRendering(function (AbstractField $jJyrp, $YaV4m, $DbHm9) { return MemberCmsUtil::showFromId($YaV4m->memberUserId); }); $P2vse->display('change', '积分')->hookRendering(function (AbstractField $jJyrp, $YaV4m, $DbHm9) { return AutoRenderedFieldValue::make($YaV4m->change > 0 ? '<span class="ub-text-success">+' . $YaV4m->change . '</span>' : '<span class="ub-text-danger">' . $YaV4m->change . '</span>'); }); $P2vse->text('remark', '备注'); $P2vse->display('created_at', L('Created At')); })->gridFilter(function (GridFilter $mHisM) { $mHisM->eq('memberUserId', '用户ID'); })->title('用户积分流水')->canAdd(false)->canEdit(false)->canDelete(false); } }