Эх сурвалжийг харах

增加招聘岗位填写人数字段

sandm 3 жил өмнө
parent
commit
1dee047192

+ 7 - 0
app/Admin/Controllers/Recruit/RecruitController.php

@@ -336,12 +336,16 @@ class RecruitController extends Controller
             //添加招聘岗位
             //添加招聘岗位
             $postcode_array = $request->postcode;
             $postcode_array = $request->postcode;
             $postname_array = $request->postname;
             $postname_array = $request->postname;
+            $postnumber_array = $request->postnumber;
+            $limit_array = $request->postlimit;
             $countnum = count($postcode_array);
             $countnum = count($postcode_array);
             for ($i = 0; $i < $countnum; $i++) {
             for ($i = 0; $i < $countnum; $i++) {
                 $data = array();
                 $data = array();
                 if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') {
                 if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') {
                     $data['code'] = $postcode_array[$i];
                     $data['code'] = $postcode_array[$i];
                     $data['name'] = $postname_array[$i];
                     $data['name'] = $postname_array[$i];
+                    $data['number'] = $postnumber_array[$i];
+                    $data['limit'] = $limit_array[$i];
                     $data['status'] = 1;
                     $data['status'] = 1;
                     $data['recruit_id'] = $recruit_id;
                     $data['recruit_id'] = $recruit_id;
                     RecruitPost::create($data);
                     RecruitPost::create($data);
@@ -452,6 +456,7 @@ class RecruitController extends Controller
             Recruit::where('id', $recruit_id)->update($data);
             Recruit::where('id', $recruit_id)->update($data);
             $postcode_array = $request->postcode;
             $postcode_array = $request->postcode;
             $postname_array = $request->postname;
             $postname_array = $request->postname;
+            $postnumber_array = $request->postnumber;
             $limit_array = $request->postlimit;
             $limit_array = $request->postlimit;
             $postid_arr = $request->postid_arr;
             $postid_arr = $request->postid_arr;
             $countnum = count($postcode_array);
             $countnum = count($postcode_array);
@@ -477,12 +482,14 @@ class RecruitController extends Controller
                             $post_id = $postid_arr[$i];
                             $post_id = $postid_arr[$i];
                             $data['code'] = $postcode_array[$i];
                             $data['code'] = $postcode_array[$i];
                             $data['name'] = $postname_array[$i];
                             $data['name'] = $postname_array[$i];
+                            $data['number'] = $postnumber_array[$i];
                             $data['limit'] = $limit_array[$i];
                             $data['limit'] = $limit_array[$i];
                             $data['recruit_id'] = $recruit_id;
                             $data['recruit_id'] = $recruit_id;
                             RecruitPost::where('id', $post_id)->update($data);
                             RecruitPost::where('id', $post_id)->update($data);
                         } else {
                         } else {
                             $data['code'] = $postcode_array[$i];
                             $data['code'] = $postcode_array[$i];
                             $data['name'] = $postname_array[$i];
                             $data['name'] = $postname_array[$i];
+                            $data['number'] = $postnumber_array[$i];
                             $data['limit'] = $limit_array[$i];
                             $data['limit'] = $limit_array[$i];
                             $data['recruit_id'] = $recruit_id;
                             $data['recruit_id'] = $recruit_id;
                             RecruitPost::create($data);
                             RecruitPost::create($data);

+ 4 - 0
resources/views/admin/recruit/index.blade.php

@@ -45,12 +45,14 @@
             ' <tr >' +
             ' <tr >' +
             '              <th  style="text-align: center;">岗位编号<\/th>' +
             '              <th  style="text-align: center;">岗位编号<\/th>' +
             '              <th  style="text-align: center;">岗位名称<\/th>' +
             '              <th  style="text-align: center;">岗位名称<\/th>' +
+            '              <th  style="text-align: center;">招聘人数<\/th>' +
             '              <th  style="text-align: center;">岗位限制条件(JSON格式)<\/th>' +
             '              <th  style="text-align: center;">岗位限制条件(JSON格式)<\/th>' +
             '              <th  style="text-align: center;"><\/th>' +
             '              <th  style="text-align: center;"><\/th>' +
             '         <\/tr>' +
             '         <\/tr>' +
             '<tr>' +
             '<tr>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="" class="form-control postname"   style="width:400px;" maxlength="80" ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="" class="form-control postname"   style="width:400px;" maxlength="80" ><\/td>' +
+            '              <td  style="padding:8px 15px;"><input type="text"  name="postnumber[]" value="1" class="form-control postname"   style="width:100px;" maxlength="80" ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>'
             '              <td  style="padding:8px 15px;"><input type="text"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>'
         ;
         ;
 
 
@@ -77,6 +79,7 @@
             job_base += '<tr>' +
             job_base += '<tr>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="' + post[c].code + '" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="' + post[c].code + '" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="' + post[c].name + '" class="form-control postname"   style="width:400px;"  maxlength="80" ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="' + post[c].name + '" class="form-control postname"   style="width:400px;"  maxlength="80" ><\/td>' +
+                '              <td  style="padding:8px 15px;"><input type="text"  name="postnumber[]" value="' + post[c].number + '" class="form-control postnumber"   style="width:100px;"  maxlength="80" ><\/td>' +
                 '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>'
                 '              <td  style="padding:8px 15px;"><input type="text" id="post_' + post[c].id + '"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;" ><\/td>'
             ;
             ;
             job_base += '                    <\/select>' +
             job_base += '                    <\/select>' +
@@ -98,6 +101,7 @@
         var trtd = '<tr>' +
         var trtd = '<tr>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postcode[]" value="" class="form-control postcode"  style="width:100px; " onkeyup="value=value.replace(/[^\\d.]/g,\'\')"  ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="" class="form-control postname"   style="width:400px;"  maxlength="80" ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postname[]" value="" class="form-control postname"   style="width:400px;"  maxlength="80" ><\/td>' +
+            '              <td  style="padding:8px 15px;"><input type="text"  name="postnumber[]" value="1" class="form-control postnumber"  style="width:100px; "  ><\/td>' +
             '              <td  style="padding:8px 15px;"><input type="text"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;"  ><\/td>'
             '              <td  style="padding:8px 15px;"><input type="text"  name="postlimit[]" value="" class="form-control limit"   style="width:400px;"  ><\/td>'
         ;
         ;