'integer', 'city_id' => 'integer', 'status' => 'integer']; const CREATED_AT = 'create_time'; const UPDATED_AT = 'update_time'; /** * @param int $id * @return \Hyperf\Database\Model\Model|Builder|null */ public function getInfoById(int $id): \Hyperf\Database\Model\Model|Builder|null { return $this->where('id',$id)->first(['id','pid','name','status','remark']); } /** * @param int $pid * @return Builder[]|Collection */ public function getInfoByPid(int $pid): Collection|array { return $this->where('pid',$pid)->get(); } /** * 获取所有 * @return array */ public function getList(): array { return $this ->where('status', AuthCode::SECTION_STATUS_ENABLE) ->get([['id','pid','name','status','remark']]) ->toArray(); } }