12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- *
- *User:Administrator
- *Date:2021/10/10
- */
- namespace app\api\business;
- use app\api\model\Jcdw;
- use app\common\lib\Arr;
- use app\common\lib\auth\JwtAuth;
- //检测单位
- class TestUnitBus
- {
- private $rymc;
- public function __construct()
- {
- $jwtAuth=JwtAuth::getInstance(); //实例化jwtAuth
- $this->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,];
- }
- }
|