正在显示
1 个修改的文件
包含
69 行增加
和
2 行删除
| @@ -8,6 +8,9 @@ use App\Helper\FormGlobalsoApi; | @@ -8,6 +8,9 @@ use App\Helper\FormGlobalsoApi; | ||
| 8 | use App\Helper\Translate; | 8 | use App\Helper\Translate; |
| 9 | use App\Http\Logic\Bside\User\UserLogic; | 9 | use App\Http\Logic\Bside\User\UserLogic; |
| 10 | use App\Http\Logic\Bside\User\UserLoginLogic; | 10 | use App\Http\Logic\Bside\User\UserLoginLogic; |
| 11 | +use App\Models\Manage\EntryPosition; | ||
| 12 | +use App\Models\Manage\JobLevel; | ||
| 13 | +use App\Models\Manage\Manage; | ||
| 11 | use App\Models\Project\Project; | 14 | use App\Models\Project\Project; |
| 12 | use App\Models\Project\Project as ProjectModel; | 15 | use App\Models\Project\Project as ProjectModel; |
| 13 | use App\Models\Service\Service; | 16 | use App\Models\Service\Service; |
| @@ -192,8 +195,72 @@ class ComController extends BaseController | @@ -192,8 +195,72 @@ class ComController extends BaseController | ||
| 192 | $model = new Service(); | 195 | $model = new Service(); |
| 193 | $info = $model->read(['type'=>5]); | 196 | $info = $model->read(['type'=>5]); |
| 194 | $values = json_decode($info['values']); | 197 | $values = json_decode($info['values']); |
| 195 | - var_dump($values); | ||
| 196 | - die(); | 198 | + $data = []; |
| 199 | + foreach ($values as $k => $v){ | ||
| 200 | + $v = (array)$v; | ||
| 201 | + $data = [ | ||
| 202 | + 'name'=>$v['name'], | ||
| 203 | + 'mobile'=>$v['mobile'], | ||
| 204 | + 'password'=>'$2y$10$ZNHxlIddWiQzQbIIzFgYJOsPlQ4n0cwWl8Sea53qvQvDXtu3WeYMC', | ||
| 205 | + ]; | ||
| 206 | + $manager_id = DB::table('gl_manage')->insertGetId($data); | ||
| 207 | + if($v['sex'] == '女'){ | ||
| 208 | + $v['sex'] = 2; | ||
| 209 | + }else{ | ||
| 210 | + $v['sex'] = 1; | ||
| 211 | + } | ||
| 212 | + $education = [ | ||
| 213 | + '专科' => 1, | ||
| 214 | + '大专' => 1, | ||
| 215 | + '中专' => 0, | ||
| 216 | + '本科' => 2, | ||
| 217 | + '自考本科'=>0, | ||
| 218 | + '全日制本科'=>2, | ||
| 219 | + '本科在读'=>2, | ||
| 220 | + '大学本科'=>2, | ||
| 221 | + '硕士研究生' => 3, | ||
| 222 | + '硕士'=>3, | ||
| 223 | + '其他' => 0, | ||
| 224 | + ]; | ||
| 225 | + //获取入职岗位 | ||
| 226 | + $entryPositionModel = new EntryPosition(); | ||
| 227 | + $entry_position = $entryPositionModel->read(['name'=>$v['entry_position']]); | ||
| 228 | + if($entry_position !== false){ | ||
| 229 | + $entry_position = $entry_position['id']; | ||
| 230 | + }else{ | ||
| 231 | + $entry_position = ''; | ||
| 232 | + } | ||
| 233 | + //获取级别 | ||
| 234 | + $jobLevelModel = new JobLevel(); | ||
| 235 | + $p_level = $jobLevelModel->read(['name'=>$v['p_level']]); | ||
| 236 | + if($entry_position !== false){ | ||
| 237 | + $p_level = $p_level['id']; | ||
| 238 | + }else{ | ||
| 239 | + $p_level = ''; | ||
| 240 | + } | ||
| 241 | + var_dump($v['career_history']); | ||
| 242 | + $manager_data = [ | ||
| 243 | + 'manage_id'=>$manager_id, | ||
| 244 | + 'name'=>$v['name'], | ||
| 245 | + 'id_card'=>$v['id_card'], | ||
| 246 | + 'mobile'=>$v['mobile'], | ||
| 247 | + 'birthday'=>$v['birthday'], | ||
| 248 | + 'address'=>$v['address'], | ||
| 249 | + 'sex'=>$v['sex'], | ||
| 250 | + 'nationality'=>$v['nationality'], | ||
| 251 | + 'education'=>isset($education[$v['education']]) ?? 0, | ||
| 252 | + 'major'=>$v['major'], | ||
| 253 | + 'graduate_school'=>$v['graduate_school'], | ||
| 254 | + 'english_level'=>$v['english_level'], | ||
| 255 | + 'entry_position'=>$entry_position, | ||
| 256 | + 'p_level'=>$p_level, | ||
| 257 | + 'residential_address'=>$v['residential_address'], | ||
| 258 | + 'emergency_contact'=>$v['emergency_contact'], | ||
| 259 | + 'career_history'=>json_encode((array)$v['career_history']), | ||
| 260 | + 'learning_history'=>json_encode((array)$v['learning_history']), | ||
| 261 | + '' | ||
| 262 | + ]; | ||
| 263 | + } | ||
| 197 | $data = json_decode(); | 264 | $data = json_decode(); |
| 198 | } | 265 | } |
| 199 | 266 |
-
请 注册 或 登录 后发表评论