|
@@ -4,7 +4,7 @@ class Location extends Model {
|
|
|
|
|
|
|
|
protected static $table = "location";
|
|
protected static $table = "location";
|
|
|
protected static $id_field = "id";
|
|
protected static $id_field = "id";
|
|
|
- protected static $fillable_fields = ["customer_id", "name", "legal_entity_name", "address_1", "address_2", "city", "county", "postal_code", "state", "country", "shop_left", "shop_right", "region", "internal_id", "area_manager", "latitude", "longitude", "dts_verified"];
|
|
|
|
|
|
|
+ protected static $fillable_fields = ["customer_id", "name", "legal_entity_name", "address_1", "address_2", "city", "county", "postal_code", "state", "country", "email", "phone", "shop_left", "shop_right", "region", "internal_id", "area_manager", "latitude", "longitude", "dts_verified"];
|
|
|
|
|
|
|
|
protected static $field_map = [
|
|
protected static $field_map = [
|
|
|
];
|
|
];
|
|
@@ -20,14 +20,14 @@ class Location extends Model {
|
|
|
return $directory;
|
|
return $directory;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getDisplayAddress($fields = ["address_1", "address_2", "city", "county", "postal_code", "state", "country"]) {
|
|
|
|
|
|
|
+ public function getDisplayAddress($fields = ["address_1", "address_2", "city", "county", "postal_code", "state", "country"], $glue = ", ") {
|
|
|
$parts = [];
|
|
$parts = [];
|
|
|
|
|
|
|
|
foreach($fields as $field) {
|
|
foreach($fields as $field) {
|
|
|
$parts[] = $this->$field;
|
|
$parts[] = $this->$field;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return implode(", ", array_filter($parts));
|
|
|
|
|
|
|
+ return implode($glue, array_filter($parts));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getGeolocation() {
|
|
public function getGeolocation() {
|