'integer', 'pid' => 'integer', 'deep' => 'integer']; private array $selectFiled = ['id','pid','title']; /** * @return array */ public function getAll(): array { return $this->get($this->selectFiled)->toArray(); } /** * @param int $deep * @return array */ public function getListByDeep(int $deep): array { return $this->where('deep',$deep)->get($this->selectFiled)->toArray(); } /** * @param int $id * @return Builder|\Hyperf\Database\Model\Model|null */ public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null { return $this->where('id',$id)->first(); } /** * @param int $id * @param int $pid * @return \Hyperf\Database\Model\Model|Builder|null */ public function getAddressByIdAndPid(int $id, int $pid): \Hyperf\Database\Model\Model|Builder|null { return $this->where('id',$id)->where('pid',$pid)->first(); } }