作者 何书鹏

显示提现单号

... ... @@ -57,7 +57,7 @@ class UserCommissionApply extends Backend
public function index()
{
//当前是否为关联查询
$this->relationSearch = false;
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
... ... @@ -68,14 +68,16 @@ class UserCommissionApply extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with('user')
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','user_id','money','status','status_msg','createtime','updatetime']);
$row->visible(['id','user_id','money','status','status_msg','partner_trade_no','createtime','updatetime','user']);
if($row->getRelation('user')){
$row->getRelation('user')->visible(['nickname','avatar']);
}
}
$result = array("total" => $list->total(), "rows" => $list->items());
... ...
... ... @@ -10,5 +10,8 @@ return [
'Status_msg' => '驳回理由',
'Createtime' => '申请时间',
'Updatetime' => '操作时间',
'Deletetime' => '删除时间'
'Deletetime' => '删除时间',
'Partner_trade_no' => '提现单号',
'User.nickname' => '用户昵称',
'User.avatar' => '用户头像'
];
... ...
... ... @@ -43,7 +43,10 @@ class UserCommissionApply extends Model
return isset($list[$value]) ? $list[$value] : '';
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
... ... @@ -27,9 +27,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'user_id', title: __('User_id')},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'money', title: __('Money'), operate:'BETWEEN'},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
{field: 'status_msg', title: __('Status_msg'), operate: 'LIKE'},
{field: 'partner_trade_no', title: __('Partner_trade_no'), operate: 'LIKE'},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{
field: 'buttons',
... ...