GroupLogic.php
1.9 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace App\Http\Logic\Bside\User;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\User\ProjectGroup;
class GroupLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new ProjectGroup();
$this->param = $this->requestAll;
}
/**
* @name :添加
* @return void
* @author :liyuhang
* @method
*/
public function group_add(){
$this->param['project_id'] = $this->user['project_id'];
$this->param['admin_id'] = $this->user['admin_id'];
$this->param['create_id'] = $this->user['create_id'];
$this->param['operator_id'] = $this->user['operator_id'];
$this->param['user_list'] = ','.trim($this->param['user_list'],',').',';
$rs = $this->model->add($this->param);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @name :编辑
* @return void
* @author :liyuhang
* @method
*/
public function group_edit(){
$this->param['user_list'] = ','.trim($this->param['user_list'],',').',';
$rs = $this->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @name :详情
* @return void
* @author :liyuhang
* @method
*/
public function group_info(){
$info = $this->info($this->param);
return $this->success($info);
}
/**
* @name :删除
* @return void
* @author :liyuhang
* @method
*/
public function group_del(){
$ids = $this->param['id'];
$this->param['id'] = ['in',$this->param['id']];
$rs = $this->del($this->param,$ids);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
}