My.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. namespace app\home\controller;
  3. use app\common\model\RecruitAppointBasicModel;
  4. use app\home\HomeBaseController;
  5. class My extends HomeBaseController
  6. {
  7. protected function init()
  8. {
  9. $this->checkLogin();
  10. }
  11. public function index()
  12. {
  13. return view();
  14. }
  15. public function info()
  16. {
  17. $info = RecruitAppointBasicModel::where('user_id', $this->user['id'])->find();
  18. if (empty($info)) {
  19. $info = [
  20. 'realname' => '',
  21. 'sex' => 1,
  22. 'birthday' => '',
  23. 'avatar' => '',
  24. 'nation' => '',
  25. 'native_place' => '',
  26. 'political_affiliation' => '',
  27. 'titles' => '',
  28. 'work' => '',
  29. 'house_register' => '',
  30. 'join_time' => '',
  31. 'edu_type' => '',
  32. 'education' => '',
  33. 'school' => '',
  34. 'degree' => '',
  35. 'pro' => '',
  36. 'province' => '',
  37. 'city' => '',
  38. 'area' => '',
  39. 'address' => '',
  40. 'card' => '',
  41. 'mobile' => '',
  42. 'email' => '',
  43. 'concat_name' => '',
  44. 'concat_mobile' => '',
  45. 'resume' => '',
  46. 'family' => [
  47. [
  48. 'relation' => '',
  49. 'realname' => '',
  50. 'birthday' => '',
  51. 'political_affiliation' => '',
  52. 'work' => '',
  53. ],
  54. ],
  55. 'is_push' => 1,
  56. ];
  57. }
  58. return view('', ['info' => json_encode($info)]);
  59. }
  60. public function infoPost()
  61. {
  62. $basic = RecruitAppointBasicModel::where('user_id',$this->user['id'])->find();
  63. $data = input('post.');
  64. if ($basic) {
  65. //更新基础信息
  66. unset($data['create_time'],$data['update_time']);
  67. RecruitAppointBasicModel::where('user_id', $this->user['id'])->update($data);
  68. } else {
  69. //新增基础信息
  70. $data['user_id'] = $this->user['id'];
  71. RecruitAppointBasicModel::create($data);
  72. }
  73. ajax_return(0,'个人基础信息保存成功,快去报名吧!');
  74. }
  75. public function account()
  76. {
  77. return view();
  78. }
  79. public function tip()
  80. {
  81. return view();
  82. }
  83. public function feedback()
  84. {
  85. return view();
  86. }
  87. }