|
@@ -51,7 +51,7 @@ class User extends Backend
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
|
|
|
|
|
|
|
$list = $this->model->with('parent')
|
|
$list = $this->model->with('parent')
|
|
|
- ->where($where)
|
|
|
|
|
|
|
+ ->where($where)->where('users.is_delete', 0)
|
|
|
->order($sort, $order)
|
|
->order($sort, $order)
|
|
|
->paginate($limit);
|
|
->paginate($limit);
|
|
|
|
|
|
|
@@ -60,15 +60,13 @@ class User extends Backend
|
|
|
$path= model('UsersPath');
|
|
$path= model('UsersPath');
|
|
|
foreach ($list as &$item) {
|
|
foreach ($list as &$item) {
|
|
|
$item->agent = $this->model
|
|
$item->agent = $this->model
|
|
|
- ->where('id', '=',
|
|
|
|
|
- $path->where('user_id', $item->id)->where('is_agent', 1)->order('distance', 'desc')->value('parent_id')
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ ->where('id', '=', $path->where('user_id', $item->id)->where('is_agent', 1)->order('distance', 'desc')->value('parent_id'))
|
|
|
->value('mobile');
|
|
->value('mobile');
|
|
|
$item->recharge = $in::where('status', 200)->where('user_id', $item->id)->sum('amount');
|
|
$item->recharge = $in::where('status', 200)->where('user_id', $item->id)->sum('amount');
|
|
|
$item->withdraw = $out::where('status', 200)->where('user_id', $item->id)->sum('amount');
|
|
$item->withdraw = $out::where('status', 200)->where('user_id', $item->id)->sum('amount');
|
|
|
- }
|
|
|
|
|
- $result = array("total" => $list->total(), "rows" => $list->items());
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ $result = array("total" => $list->total(), "rows" => $list->items());
|
|
|
return json($result);
|
|
return json($result);
|
|
|
}
|
|
}
|
|
|
return $this->view->fetch();
|
|
return $this->view->fetch();
|