作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -92,4 +92,20 @@ class HrController extends BaseController @@ -92,4 +92,20 @@ class HrController extends BaseController
92 return $this->response('success',Code::SUCCESS, $result); 92 return $this->response('success',Code::SUCCESS, $result);
93 } 93 }
94 94
  95 + /**
  96 + * @remark :修改排序
  97 + * @name :sort
  98 + * @author :lyh
  99 + * @method :post
  100 + * @time :2023/12/7 9:12
  101 + */
  102 + public function sort(HrLogic $hrLogic){
  103 + $this->request->validate([
  104 + 'id'=>'required'
  105 + ],[
  106 + 'id.required' => 'ID不能为空'
  107 + ]);
  108 + $hrLogic->setSort();
  109 + return $this->response('success');
  110 + }
95 } 111 }
@@ -144,7 +144,7 @@ class OnlineController extends BaseController @@ -144,7 +144,7 @@ class OnlineController extends BaseController
144 } 144 }
145 if(isset($this->map['all_status'])){ 145 if(isset($this->map['all_status'])){
146 // 搜索状态 146 // 搜索状态
147 - $query->where('gl_project_online_check.qa_status',$this->map['qa_status']); 147 + $query->where('gl_project_online_check.qa_status',$this->map['all_status']);
148 } 148 }
149 if(isset($this->map['optimist_status'])){ 149 if(isset($this->map['optimist_status'])){
150 // 搜索状态 150 // 搜索状态
@@ -540,24 +540,10 @@ class ProjectController extends BaseController @@ -540,24 +540,10 @@ class ProjectController extends BaseController
540 public function getManagerList(){ 540 public function getManagerList(){
541 $hrManagerModel = new ManageHr(); 541 $hrManagerModel = new ManageHr();
542 $this->map['status'] = $hrManagerModel::STATUS_ONE; 542 $this->map['status'] = $hrManagerModel::STATUS_ONE;
543 - if(isset($this->map['entry_position']) && is_array($this->map['entry_position'])){ 543 + if(isset($this->map['entry_position']) && !empty($this->map['entry_position'])){
544 $this->map['entry_position'] = ['in',$this->map['entry_position']]; 544 $this->map['entry_position'] = ['in',$this->map['entry_position']];
545 } 545 }
546 $lists = $hrManagerModel->list($this->map,'id',['id','manage_id','name','entry_position','is_leader']); 546 $lists = $hrManagerModel->list($this->map,'id',['id','manage_id','name','entry_position','is_leader']);
547 -  
548 - //zgj 售后技术排序调整 start  
549 - if(isset($this->map['entry_position'][1]) && in_array(45,$this->map['entry_position'][1])){  
550 - $ar_sort = ['王娇'=>1,'银蝶'=>2,'胡哲'=>3,'郭婷婷'=>4,'徐庆'=>5,'邓锦康'=>6,'兰波'=>7];  
551 - foreach ($lists as $k=>$v){  
552 - $lists[$k]['sort'] = 0;  
553 - if(in_array($v['name'],array_keys($ar_sort))){  
554 - $lists[$k]['sort'] = $ar_sort[$v['name']];  
555 - }  
556 - }  
557 - $sort_arr = array_column($lists, 'sort');  
558 - array_multisort($sort_arr,SORT_DESC,$lists);  
559 - }  
560 - //售后技术排序调整 end  
561 $this->response('success',Code::SUCCESS,$lists); 547 $this->response('success',Code::SUCCESS,$lists);
562 } 548 }
563 549
@@ -311,4 +311,16 @@ class HrLogic extends BaseLogic @@ -311,4 +311,16 @@ class HrLogic extends BaseLogic
311 $list = $this->model->with('dept')->with('position')->select(['name', 'id_card', 'mobile', 'dept_id', 'entry_position', 'status'])->orderBy('id', 'desc')->paginate($page_size); 311 $list = $this->model->with('dept')->with('position')->select(['name', 'id_card', 'mobile', 'dept_id', 'entry_position', 'status'])->orderBy('id', 'desc')->paginate($page_size);
312 return $list; 312 return $list;
313 } 313 }
  314 +
  315 + /**
  316 + * @remark :设置排序
  317 + * @name :setSort
  318 + * @author :lyh
  319 + * @method :post
  320 + * @time :2023/12/7 9:13
  321 + */
  322 + public function setSort(){
  323 + $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]);
  324 + return $this->success();
  325 + }
314 } 326 }
@@ -134,6 +134,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -134,6 +134,7 @@ Route::middleware(['aloginauth'])->group(function () {
134 Route::get('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr'); 134 Route::get('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr');
135 Route::get('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info'); 135 Route::get('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info');
136 Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save'); 136 Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save');
  137 + Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort');
137 Route::get('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList'); 138 Route::get('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList');
138 }); 139 });
139 140