rymc = $jwtAuth->getRymc(); //setRybh是在middleware/jwtAuth中完成的 } public function selectTestUnit($data) { //判断where条件 //任务名称:模糊查询 $where=[ ['groupname','=', $data['group_type'],] ]; if ($data['name'] != '' ) array_push($where, ['name', 'LIKE', '%'.$data['name'].'%']); //获取数据 $result = (new Jcdw())->getInfoList($where,$data['pageNum'], $data['pageSize'])->toArray(); //过滤字段 $data=(new Arr())->Arr_columns($result, 'id,name,groupname,ssqy'); //获取总数 $count=(new Jcdw())->getInfoListCount($where); return ['rows'=>$data, 'total'=>$count,]; } }