|
@@ -74,9 +74,12 @@ class UserInfo extends BaseController
|
|
|
->select()
|
|
|
->toArray();
|
|
|
})
|
|
|
- ->where($condition)->page($page, $size)->order("a.id desc")
|
|
|
+ ->where($condition)
|
|
|
+ ->page($page, $size)
|
|
|
+ ->order("a.id desc")
|
|
|
->field("a.id,a.username,a.mobile,a.source,a.status,b.nickname,b.sex,b.email,a.addtime,a.updatetime,a.level")
|
|
|
- ->select()->toArray();
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
|
|
|
return json_show(0, "获取成功", ["list" => $list, "count" => $count]);
|
|
|
}
|
|
@@ -319,15 +322,15 @@ class UserInfo extends BaseController
|
|
|
//根据业务公司获取用户数据
|
|
|
public function UserListByCompany()
|
|
|
{
|
|
|
- $post = $this->request->only(["nickname" => "", "username" => "", "status" => "", "uid" => [], "nuid" => [], "companyNo" => "", "page" => 1, "size" => 10, 'level' => ''], "post");
|
|
|
+ $post = $this->request->only(["nickname" => "", "username" => "", "status" => "", "uid" => [], "nuid" => [], "companyNo" => "", "page" => 1, "size" => 10,'level' => ''], "post");
|
|
|
$condition = [["a.is_del", "=", 0]];
|
|
|
- $whereor = [];
|
|
|
+// $whereor = [];
|
|
|
isset($post['nickname']) && $post['nickname'] != "" ? $condition[] = ["nickname", "like", "%{$post['nickname']}%"] : "";
|
|
|
isset($post['username']) && $post['username'] != "" ? $condition[] = ["username", "like", "%{$post['username']}%"] : "";
|
|
|
isset($post['status']) && $post['status'] !== "" ? $condition[] = ["a.status", "=", $post['status']] : "";
|
|
|
isset($post['uid']) && !empty($post['uid']) && !empty($post['uid']) ? $condition[] = ["a.id", "in", $post['uid']] : "";
|
|
|
isset($post['nuid']) && !empty($post['nuid']) && !empty($post['nuid']) ? $condition[] = ["a.id", "not in", $post['nuid']] : "";
|
|
|
- isset($post['companyNo']) && $post['companyNo'] !== "" ? $condition[] = ["c.companyCode", "=", $post['companyNo']] : $whereor[] = ["c.companyCode", "=", null];
|
|
|
+ isset($post['companyNo']) && $post['companyNo'] !== "" ? $condition[] = ["c.companyCode", "=", $post['companyNo']] : '';//$whereor[] = ["c.companyCode", "=", null];
|
|
|
if ($post['level'] !== '') $condition[] = ['a.level', '=', $post['level']];
|
|
|
|
|
|
$page = isset($post['page']) && $post['page'] !== "" ? intval($post['page']) : 1;
|
|
@@ -337,8 +340,9 @@ class UserInfo extends BaseController
|
|
|
->leftJoin("user b", "a.id=b.account_id and b.status=1")
|
|
|
->leftJoin("account_company c", "a.id=c.account_id and c.status=1 and c.is_del=0")
|
|
|
->where($condition)
|
|
|
- ->whereOr($whereor)
|
|
|
+// ->whereOr($whereor)
|
|
|
->count();
|
|
|
+
|
|
|
$total = intval(ceil($count / $size));
|
|
|
$page = $total >= $page ? $page : $total;
|
|
|
$list = Db::name("account")
|
|
@@ -347,7 +351,7 @@ class UserInfo extends BaseController
|
|
|
->leftJoin("user b", "a.id=b.account_id and b.status=1")
|
|
|
->leftJoin("account_company c", "a.id=c.account_id and c.is_del=0")
|
|
|
->where($condition)
|
|
|
- ->whereOr($whereor)
|
|
|
+// ->whereOr($whereor)
|
|
|
->page($page, $size)
|
|
|
->append(['plat', 'company_relaton'])
|
|
|
// ->withAttr('plat', function ($val, $da) {
|
|
@@ -736,4 +740,31 @@ class UserInfo extends BaseController
|
|
|
return json_show(0, '获取用户所绑定的公司列表成功', ['count' => $count, 'list' => $list]);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //所有账号
|
|
|
+ public function userAll()
|
|
|
+ {
|
|
|
+ $post = $this->request->filter('trim')->post();
|
|
|
+ $condition = [["a.is_del", "=", 0]];
|
|
|
+ isset($post['nickname']) && $post['nickname'] != "" ? $condition[] = ["nickname", "like", "%{$post['nickname']}%"] : "";
|
|
|
+ isset($post['username']) && $post['username'] != "" ? $condition[] = ["username", "like", "%{$post['username']}%"] : "";
|
|
|
+// isset($post['status']) && $post['status'] !== "" ? $condition[] = ["a.status", "=", $post['status']] : "";
|
|
|
+// isset($post['uid']) && !empty($post['uid']) ? $condition[] = ["a.id", "in", $post['uid']] : "";
|
|
|
+// isset($post['nuid']) && !empty($post['nuid']) ? $condition[] = ["a.id", "not in", $post['nuid']] : "";
|
|
|
+ isset($post['level']) && !empty($post['level']) ? $condition[] = ["a.level", '=', $post['level']] : "";
|
|
|
+
|
|
|
+ $list = Db::name("account")
|
|
|
+ ->field("a.id,a.username,a.mobile,a.status,b.nickname,a.level")
|
|
|
+ ->alias("a")
|
|
|
+ ->leftJoin("user b", "a.id=b.account_id and b.status=1")
|
|
|
+ ->where($condition)
|
|
|
+ ->order(['a.id' => 'desc'])
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+
|
|
|
+ return json_show(0, "获取成功", $list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|