<?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 $enw1u) { $enw1u->init('member_credit_log')->field(function ($enw1u) { $enw1u->id('id', 'ID'); $enw1u->display('memberUserId', '用户')->hookRendering(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return MemberCmsUtil::showFromId($FSL7c->memberUserId); }); $enw1u->display('change', '积分')->hookRendering(function (AbstractField $Wvq57, $FSL7c, $xZl3o) { return AutoRenderedFieldValue::make($FSL7c->change > 0 ? '<span class="ub-text-success">+' . $FSL7c->change . '</span>' : '<span class="ub-text-danger">' . $FSL7c->change . '</span>'); }); $enw1u->text('remark', '备注'); $enw1u->display('created_at', L('Created At')); })->gridFilter(function (GridFilter $zBPGV) { $zBPGV->eq('memberUserId', '用户ID'); })->title('用户积分流水')->canAdd(false)->canEdit(false)->canDelete(false); } }