mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge branch 'master' into issue345_internal_thirdparty_contact
This commit is contained in:
@@ -180,6 +180,8 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @var string
|
||||
* @ORM\Column(name="name", type="string", length=255)
|
||||
* @Assert\Length(min="2")
|
||||
* @Assert\NotNull
|
||||
* @Assert\NotBlank
|
||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||
*/
|
||||
private ?string $name = '';
|
||||
|
@@ -118,7 +118,7 @@
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="phonenumber"><i class="fa fa-fw fa-phone"></i></span>
|
||||
<input class="form-control form-control-lg"
|
||||
v-model="thirdparty.phonenumber"
|
||||
v-model="thirdparty.telephone"
|
||||
v-bind:placeholder="$t('thirdparty.phonenumber')"
|
||||
v-bind:aria-label="$t('thirdparty.phonenumber')"
|
||||
aria-describedby="phonenumber" />
|
||||
@@ -155,7 +155,11 @@ export default {
|
||||
return {
|
||||
//context: {}, <--
|
||||
thirdparty: {
|
||||
type: 'thirdparty'
|
||||
type: 'thirdparty',
|
||||
address: null,
|
||||
kind: 'company',
|
||||
name: '',
|
||||
telephone: '',
|
||||
},
|
||||
professions: [],
|
||||
civilities: [],
|
||||
|
@@ -87,14 +87,24 @@ class ThirdPartyApiSearch implements SearchApiInterface
|
||||
foreach ($strs as $str) {
|
||||
if (!empty($str)) {
|
||||
$wheres[] = "(LOWER(UNACCENT(?)) <<% tparty.canonicalized OR
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')";
|
||||
$whereArgs[] = [$str, $str];
|
||||
$pertinence[] = 'STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized) + ' .
|
||||
"(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int + " .
|
||||
tparty.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
||||
OR
|
||||
(LOWER(UNACCENT(?)) <<% parent.canonicalized OR
|
||||
parent.canonicalized LIKE '%' || LOWER(UNACCENT(?)) || '%')
|
||||
";
|
||||
$whereArgs[] = [$str, $str, $str, $str];
|
||||
$pertinence[] = 'GREATEST(
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), tparty.canonicalized),
|
||||
STRICT_WORD_SIMILARITY(LOWER(UNACCENT(?)), parent.canonicalized)
|
||||
) + ' .
|
||||
"GREATEST(
|
||||
(tparty.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int,
|
||||
(parent.canonicalized LIKE '%s' || LOWER(UNACCENT(?)) || '%')::int
|
||||
) + " .
|
||||
// take postcode label into account, but lower than the canonicalized field
|
||||
"COALESCE((LOWER(UNACCENT(cmpc.label)) LIKE '%' || LOWER(UNACCENT(?)) || '%')::int * 0.3, 0) + " .
|
||||
"COALESCE((LOWER(UNACCENT(cmpc_p.label)) LIKE '%' || LOWER(UNACCENT(?)) || '%')::int * 0.3, 0)";
|
||||
$pertinenceArgs[] = [$str, $str, $str, $str];
|
||||
$pertinenceArgs[] = [$str, $str, $str, $str, $str, $str];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user