This commit is contained in:
weiz 2024-06-05 11:08:40 +08:00
parent 46f7202402
commit 2a6e85fea5

View File

@ -43,7 +43,7 @@ class OaSelfExamineLists extends BaseAdminDataLists implements ListsSearchInterf
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['examine_type','user_id'], '=' => ['examine_type'],
]; ];
} }
@ -63,7 +63,12 @@ class OaSelfExamineLists extends BaseAdminDataLists implements ListsSearchInterf
if(!empty($params['examine_month'])){ if(!empty($params['examine_month'])){
$this->where[] = ['examine_month','=',strtotime($params['examine_month'])]; $this->where[] = ['examine_month','=',strtotime($params['examine_month'])];
} }
return OaSelfExamine::withoutField('update_time,delete_time')->where('user_id',$this->adminId)->where($this->searchWhere)->where($this->where) if(!empty($params['user_id'])){
$this->where[] = ['user_id','=',$params['user_id']];
}else{
$this->where[] = ['user_id','=',$this->adminId];
}
return OaSelfExamine::withoutField('update_time,delete_time')->where($this->searchWhere)->where($this->where)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function($data){ ->select()->each(function($data){
@ -85,7 +90,7 @@ class OaSelfExamineLists extends BaseAdminDataLists implements ListsSearchInterf
*/ */
public function count(): int public function count(): int
{ {
return OaSelfExamine::where('user_id',$this->adminId)->where($this->searchWhere)->where($this->where)->count(); return OaSelfExamine::where($this->searchWhere)->where($this->where)->count();
} }
} }