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