value('parent_id') ?? 0,intval($v) ]; $result[] = [Region::where('id',$v)->value('pid') ?? 0,intval($v) ]; } }else{ $result['city_id'] = []; } return $result; } public function setCityIdAttr($value) { return '/'.implode('/',$value).'/'; } }