HrLogic.php
2.8 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
namespace App\Http\Logic\Aside\Manage;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\BelongingGroup;
use App\Models\Manage\EntryPosition;
use App\Models\Manage\ManageHr;
/**
* Class ManageHrLogic
* @package App\Http\Logic\Aside\Manage
* @author zgj
* @date 2023/5/30
*/
class HrLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new ManageHr();
}
public function save($param){
foreach ($this->model::specielField() as $v){
$param = $this->setJson($v,$param);
}
return parent::save($param);
}
public function getInfo($id){
$data = parent::getInfo($id);
foreach ($this->model::specielField() as $v){
$data[$v] = json_decode($data[$v],true);
}
return $data;
}
//数组转json存储
public function setJson($str,$param){
if(isset($param[$str]) && is_array($param[$str])){
$param[$str] = json_encode($param[$str]);
}else{
$param[$str] = '';
}
return $param;
}
public function parms(){
$data['belong_group'] = $this->model::belongGroup();
$data['education'] = $this->model::education();
$data['entry_position'] = $this->model::entryPosition();
$data['p_level'] = $this->model::pLevel();
$data['dangyuan'] = $this->model::dangyuan();
$data['dangzhibu'] = $this->model::dangzhibu();
return $data;
}
/**
* @remark :获取归属小组
* @name :belongGroupList
* @author :lyh
* @method :post
* @time :2023/7/22 17:35
*/
public function belongGroupList($map){
$belongingGroupModel = new BelongingGroup();
$lists = $belongingGroupModel->list($map);
return $this->success($lists);
}
/**
* @remark :获取学历
* @name :educationList
* @author :lyh
* @method :post
* @time :2023/7/22 17:49
*/
public function educationList(){
$data = [
1 => '专科',
2 => '本科',
3 => '研究生及以上',
0 => '其他',
];
return $this->success($data);
}
/**
* @remark :入职岗位
* @name :entryPositionList
* @author :lyh
* @method :post
* @time :2023/7/22 17:51
*/
public function entryPositionList($map){
$entryPositionModel = new EntryPosition();
$lists = $entryPositionModel->list($map);
return $this->success($lists);
}
/**
* @remark :职务级别
* @name :pLevel
* @author :lyh
* @method :post
* @time :2023/7/22 18:10
*/
public function pLevel(){
$lists = [];
return $this->success($lists);
}
}