'array', ];*/ public function getCredentialImagesAttr($value) { return empty($value)?'':json_decode($value,true); } public function getCredentialNameAttr($value) { return empty($value)?[]:explode(',',$value); } public function getCityTextAttr($value,$data):string{ $postageRegion = array_column(getPostageRegion([$data['city']]), null, 'id'); return $postageRegion[$data['city']]['name']??''; } public function getMaintainExpTypeTextAttr($value,$data):string{ $default = Cache::get('WORKER_EXP_TYPE'); if (!$default) { $status = DictData::where('type_value', 'worker_exp_type')->column('name','value'); Cache::set('WORKER_EXP_TYPE', json_encode($status,true),5); } else { $status = json_decode($default,true); } return $status[$data['maintain_exp_type']] ?? ''; } public function getOtherExpTypeTextAttr($value,$data):string{ $default = Cache::get('WORKER_OTHER_EXP_TYPE'); if (!$default) { $status = DictData::where('type_value', 'worker_other_exp_type')->column('name','value'); Cache::set('WORKER_OTHER_EXP_TYPE', json_encode($status,true),5); } else { $status = json_decode($default,true); } return $status[$data['other_exp_type']] ?? ''; } public function getVehicleTypeTextAttr($value,$data):string{ $default = Cache::get('WORKER_VEHICLE_TYPE'); if (!$default) { $status = DictData::where('type_value', 'worker_vehicle_type')->column('name','value'); Cache::set('WORKER_VEHICLE_TYPE', json_encode($status,true),5); } else { $status = json_decode($default,true); } return $status[$data['vehicle_type']] ?? ''; } }