'integer', 'status' => 'integer', 'city_id' => 'integer', 'province_id' => 'integer', 'is_del' => 'integer']; const CREATED_AT = 'create_time'; const UPDATED_AT = 'update_time'; /** * @param int $cityId * @return Builder|\Hyperf\Database\Model\Model|null */ public function getInfoByCityId(int $cityId): \Hyperf\Database\Model\Model|Builder|null { return $this->where('city_id', $cityId)->where('is_del',CityCode::IS_NOT_DELETE)->first(); } /** * @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)->where('is_del',CityCode::IS_NOT_DELETE)->first(); } /** * @param $ids * @return array */ public function getCityNameByIds($ids): array { return $this->whereIn('id',$ids)->pluck('title','id')->toArray(); } }