refs #5066 sorted without CONCAT, order=false

This commit is contained in:
Carlos Satorres 2023-05-31 10:04:34 +02:00
parent eaffd61579
commit dfebb3b307
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ module.exports = Self => {
Self.sorted = async warehouseFk => { Self.sorted = async warehouseFk => {
return Self.rawSql(` return Self.rawSql(`
SELECT v.id, v.warehouseFk, CONCAT(v.numberPlate, ' - ', w.name) as description SELECT v.id, v.warehouseFk, v.numberPlate, w.name
FROM vehicle v FROM vehicle v
JOIN warehouse w ON w.id = v.warehouseFk JOIN warehouse w ON w.id = v.warehouseFk
ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC; ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC;

View File

@ -22,14 +22,14 @@
<div class="text-secondary text-caption">{{::name}}</div> <div class="text-secondary text-caption">{{::name}}</div>
</tpl-item> </tpl-item>
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete vn-one class="dense"
label="Vehicle"
ng-model="$ctrl.route.vehicleFk" ng-model="$ctrl.route.vehicleFk"
data="$ctrl.vehicles" data="$ctrl.vehicles"
show-field="description" show-field="numberPlate"
order="order"
value-field="id" value-field="id"
label="Vehicle" order="false">
vn-name="vehicle"> <tpl-item>{{::numberPlate}} - {{::name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>