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