作者 何书鹏

显示提现单号

@@ -57,7 +57,7 @@ class UserCommissionApply extends Backend @@ -57,7 +57,7 @@ class UserCommissionApply extends Backend
57 public function index() 57 public function index()
58 { 58 {
59 //当前是否为关联查询 59 //当前是否为关联查询
60 - $this->relationSearch = false; 60 + $this->relationSearch = true;
61 //设置过滤方法 61 //设置过滤方法
62 $this->request->filter(['strip_tags', 'trim']); 62 $this->request->filter(['strip_tags', 'trim']);
63 if ($this->request->isAjax()) { 63 if ($this->request->isAjax()) {
@@ -68,14 +68,16 @@ class UserCommissionApply extends Backend @@ -68,14 +68,16 @@ class UserCommissionApply extends Backend
68 list($where, $sort, $order, $offset, $limit) = $this->buildparams(); 68 list($where, $sort, $order, $offset, $limit) = $this->buildparams();
69 69
70 $list = $this->model 70 $list = $this->model
71 - 71 + ->with('user')
72 ->where($where) 72 ->where($where)
73 ->order($sort, $order) 73 ->order($sort, $order)
74 ->paginate($limit); 74 ->paginate($limit);
75 75
76 foreach ($list as $row) { 76 foreach ($list as $row) {
77 - $row->visible(['id','user_id','money','status','status_msg','createtime','updatetime']);  
78 - 77 + $row->visible(['id','user_id','money','status','status_msg','partner_trade_no','createtime','updatetime','user']);
  78 + if($row->getRelation('user')){
  79 + $row->getRelation('user')->visible(['nickname','avatar']);
  80 + }
79 } 81 }
80 82
81 $result = array("total" => $list->total(), "rows" => $list->items()); 83 $result = array("total" => $list->total(), "rows" => $list->items());
@@ -10,5 +10,8 @@ return [ @@ -10,5 +10,8 @@ return [
10 'Status_msg' => '驳回理由', 10 'Status_msg' => '驳回理由',
11 'Createtime' => '申请时间', 11 'Createtime' => '申请时间',
12 'Updatetime' => '操作时间', 12 'Updatetime' => '操作时间',
13 - 'Deletetime' => '删除时间' 13 + 'Deletetime' => '删除时间',
  14 + 'Partner_trade_no' => '提现单号',
  15 + 'User.nickname' => '用户昵称',
  16 + 'User.avatar' => '用户头像'
14 ]; 17 ];
@@ -43,7 +43,10 @@ class UserCommissionApply extends Model @@ -43,7 +43,10 @@ class UserCommissionApply extends Model
43 return isset($list[$value]) ? $list[$value] : ''; 43 return isset($list[$value]) ? $list[$value] : '';
44 } 44 }
45 45
46 - 46 + public function user()
  47 + {
  48 + return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
  49 + }
47 50
48 51
49 } 52 }
@@ -27,9 +27,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -27,9 +27,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
27 {checkbox: true}, 27 {checkbox: true},
28 {field: 'id', title: __('Id')}, 28 {field: 'id', title: __('Id')},
29 {field: 'user_id', title: __('User_id')}, 29 {field: 'user_id', title: __('User_id')},
  30 + {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  31 + {field: 'user.avatar', title: __('User.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
30 {field: 'money', title: __('Money'), operate:'BETWEEN'}, 32 {field: 'money', title: __('Money'), operate:'BETWEEN'},
31 {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1')}, formatter: Table.api.formatter.status}, 33 {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
32 {field: 'status_msg', title: __('Status_msg'), operate: 'LIKE'}, 34 {field: 'status_msg', title: __('Status_msg'), operate: 'LIKE'},
  35 + {field: 'partner_trade_no', title: __('Partner_trade_no'), operate: 'LIKE'},
33 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, 36 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
34 { 37 {
35 field: 'buttons', 38 field: 'buttons',