where('delete_time', 0)->where('user_name', $userName)->find(); if ($info) return show(true, '获取成功', $info->toArray()); return show(false, '暂无查询到的数据'); } /** * User: 高军 * Date: 2024/5/8 * QQ: 2926804347 * @param array $param * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * Notes: */ public function getList(array $param):array { $offset = ($param['page'] - 1) * $param['pageSize']; $data = $this->limit($offset, $param['pageSize'])->select()->toArray(); $count = $this->count(); if ($data) return show(true, '获取成功', ['rows' => $data, 'total' => $count]); return show(false, '暂无数据'); } }