cityNames.stub 348 B

1234567
  1. public function get{%field%}Attr($value, $row): string
  2. {
  3. if ($row['{%originalFieldName%}'] === '' || $row['{%originalFieldName%}'] === null) return '';
  4. $cityNames = \think\facade\Db::name('area')->whereIn('id', $row['{%originalFieldName%}'])->column('name');
  5. return $cityNames ? implode(',', $cityNames) : '';
  6. }