Files
webman-buildadmin/app/admin/controller/admin/AdminWalletRecord.php
zhenhui f6197a9af5 1.优化渠道管理中直属投注额度和总投注额度
2.管理员管理中三个菜单数据显示限制
2026-05-30 15:53:36 +08:00

81 lines
2.3 KiB
PHP

<?php
namespace app\admin\controller\admin;
use app\common\controller\Backend;
use support\Response;
use Webman\Http\Request as WebmanRequest;
/**
* 管理员钱包流水(只读)
*/
class AdminWalletRecord extends Backend
{
protected ?object $model = null;
protected bool $modelValidate = false;
protected string|array $quickSearchField = ['id', 'biz_type', 'ref_type', 'idempotency_key', 'remark'];
protected string|array $defaultSortField = ['id' => 'desc'];
protected string|array $orderGuarantee = ['id' => 'desc'];
protected array $withJoinTable = ['admin', 'channel', 'operatorAdmin'];
protected function initController(WebmanRequest $request): ?Response
{
$this->model = new \app\common\model\AdminWalletRecord();
return null;
}
protected function _index(): Response
{
if ($this->request && $this->request->get('select')) {
return $this->select($this->request);
}
list($where, $alias, $limit, $order) = $this->queryBuilder();
$table = strtolower($this->model->getTable());
$mainShort = $alias[$table] ?? '';
$scopedAdminIds = $this->getManageableScopeAdminIds();
if ($mainShort !== '' && $scopedAdminIds !== []) {
$where[] = [$mainShort . '.admin_id', 'in', $scopedAdminIds];
}
$res = $this->model
->withJoin($this->withJoinTable, $this->withJoinType)
->with($this->withJoinTable)
->visible([
'admin' => ['username'],
'channel' => ['name'],
'operatorAdmin' => ['username'],
])
->alias($alias)
->where($where)
->order($order)
->paginate($limit);
return $this->success('', [
'list' => $res->items(),
'total' => $res->total(),
'remark' => get_route_remark(),
]);
}
protected function _add(): Response
{
return $this->error(__('Admin wallet records do not allow manual creation'));
}
protected function _edit(): Response
{
return $this->error(__('Admin wallet records do not allow manual editing'));
}
protected function _del(): Response
{
return $this->error(__('Admin wallet records do not allow deletion'));
}
}