DeptUserLogic.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace App\Http\Logic\Bside\User;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\User\DeptUser;
use App\Models\User\User;
class DeptUserLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new DeptUser();
$this->param = $this->requestAll;
}
/**
* @name :(添加用户时获取成员列表)user_list
* @author :lyh
* @method :post
* @time :2023/5/17 17:40
*/
public function get_user_list(){
$param = [
'project_id'=>$this->user['project_id'],
'dept_id'=>$this->param['dept_id'],
];
$dept_list = $this->model->list($param,'id');
if(!empty($dept_list)){
$arr = [];
foreach ($dept_list as $k => $v){
$arr[] = $v['user_id'];
}
}
$userModel = new User();
$param = [
'project_id'=>$this->user['project_id'],
'id'=>['not in',$arr],
];
$list = $userModel->list($param,'id',['id','name','email','mobile','created_at']);
return $this->success($list);
}
}