SQL refactor

This commit is contained in:
Juan Ferrer 2019-05-21 16:16:27 +02:00
parent 0882952dcf
commit 4f3b7efcb3
16 changed files with 347 additions and 450 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.406.46) stable; urgency=low
hedera-web (1.406.47) stable; urgency=low
* Initial Release.

View File

@ -1,35 +1,28 @@
Hedera.Catalog = new Class
({
Hedera.Catalog = new Class({
Extends: Hedera.Form
,_menuShown: false
,open: function ()
{
,open: function() {
this.close();
this.isOpen = true;
if (!localStorage.getItem ('hederaGuest'))
{
if (!localStorage.getItem('hederaGuest')) {
Hedera.BasketChecker.check(this.conn,
this.onBasketCheck.bind(this));
}
else
{
var query = 'CALL basketConfigureForGuest';
} else {
var query = 'CALL mybasket_configureForGuest';
this.conn.execQuery(query, this.loadUi.bind(this));
}
}
,onBasketCheck: function (isOk)
{
,onBasketCheck: function(isOk) {
if (isOk)
this.loadUi();
}
,activate: function ()
{
,activate: function() {
document.body.appendChild(this.$('right-panel'));
this.$('items-model').setInfo('i', 'item', 'vn', ['id']);
@ -40,26 +33,21 @@ Hedera.Catalog = new Class
this.setView(Hedera.Catalog.View.GRID);
}
,deactivate: function ()
{
,deactivate: function() {
this.hideMenu();
this.gui.$('top-bar').style.backgroundColor = '';
Vn.Node.remove(this.$('right-panel'));
}
,setView: function (view)
{
if (view === Hedera.Catalog.View.GRID)
{
,setView: function(view) {
if (view === Hedera.Catalog.View.GRID) {
this.$('view-button').setProperties({
icon: 'view-list',
tip: _('List view')
});
this.view = Hedera.Catalog.View.GRID;
var className = 'grid-view';
}
else
{
} else {
this.$('view-button').setProperties({
icon: 'view-grid',
tip: _('Grid view')
@ -73,30 +61,26 @@ Hedera.Catalog = new Class
localStorage.setItem('hederaView', this.view);
}
,onSwitchViewClick: function ()
{
,onSwitchViewClick: function() {
this.setView(this.view === Hedera.Catalog.View.LIST ?
Hedera.Catalog.View.GRID : Hedera.Catalog.View.LIST);
}
,onBasketReady: function (form)
{
,onBasketReady: function(form) {
if (form.get('method') != 'PICKUP')
Vn.Node.setText(this.$('method'), _('Agency'));
else
Vn.Node.setText(this.$('method'), _('Warehouse'));
}
,onItemsChange: function (model, status)
{
,onItemsChange: function(model, status) {
if (status !== Db.Model.Status.CLEAN)
this.$('order').style.display = 'block';
else
this.$('order').style.display = 'none';
}
,onOrderChange: function (e)
{
,onOrderChange: function(e) {
var value = e.target.value;
var sortField = value.substr(2);
var sortWay = value.charAt(0) === 'A' ?
@ -108,14 +92,12 @@ Hedera.Catalog = new Class
this.hideMenu();
}
,onFilterChange: function (param, newValue)
{
,onFilterChange: function(param, newValue) {
if (newValue)
this.hideMenu();
}
,realmRenderer: function (builder, form)
{
,realmRenderer: function(builder, form) {
var link = builder.$('link');
link.href = this.hash.make({
'form': this.hash.get('form'),
@ -128,15 +110,11 @@ Hedera.Catalog = new Class
img.alt = img.title;
}
,onRealmChange: function (param, newValue)
{
if (newValue)
{
,onRealmChange: function(param, newValue) {
if (newValue) {
this.$('filters').style.display = 'block';
this.$('realm-msg').style.display = 'none';
}
else
{
} else {
this.$('filters').style.display = 'none';
this.$('realm-msg').style.display = 'block';
}
@ -145,15 +123,13 @@ Hedera.Catalog = new Class
this.refreshFilter(newValue, undefined);
}
,onTypeChange: function (param, newValue)
{
,onTypeChange: function(param, newValue) {
this.onFilterChange(param, newValue);
this.refreshTitle();
this.refreshFilter(undefined, newValue);
}
,refreshFilter: function (realm, type)
{
,refreshFilter: function(realm, type) {
var batch = this.$('filter-batch');
batch.block();
this.$('realm-value').value = realm;
@ -167,8 +143,7 @@ Hedera.Catalog = new Class
batch.changed();
}
,refreshTitleColor: function ()
{
,refreshTitleColor: function() {
var realms = this.$('realms-model');
if (!realms.ready)
@ -177,8 +152,7 @@ Hedera.Catalog = new Class
var color = null;
var realm = this.$('realm').value;
if (realm)
{
if (realm) {
var row = realms.search('id', realm);
if (row != -1)
@ -188,8 +162,7 @@ Hedera.Catalog = new Class
this.gui.$('top-bar').style.backgroundColor = color;
}
,refreshTitle: function ()
{
,refreshTitle: function() {
var types = this.$('types-model');
if (!types.ready)
@ -198,8 +171,7 @@ Hedera.Catalog = new Class
var title = _('Catalog');
var type = this.$('type').value;
if (type)
{
if (type) {
var row = types.search('id', type);
if (row != -1)
@ -209,13 +181,11 @@ Hedera.Catalog = new Class
Vn.Node.setText(this.$('title-text'), title);
}
,onRightPanelClick: function (event)
{
,onRightPanelClick: function(event) {
event.stopPropagation();
}
,onShowMenuClick: function (event)
{
,onShowMenuClick: function(event) {
this._menuShown = true;
event.stopPropagation();
this.gui.showBackground();
@ -224,8 +194,7 @@ Hedera.Catalog = new Class
document.addEventListener('click', this.hideMenuCallback);
}
,hideMenu: function ()
{
,hideMenu: function() {
if (!this._menuShown)
return;
@ -235,10 +204,8 @@ Hedera.Catalog = new Class
this.hideMenuCallback = null;
}
,isGuest: function ()
{
if (localStorage.getItem ('hederaGuest'))
{
,isGuest: function() {
if (localStorage.getItem('hederaGuest')) {
Htk.Toast.showError(_('YouMustBeLoggedIn'));
return true;
}
@ -246,24 +213,21 @@ Hedera.Catalog = new Class
return false;
}
,onBasketClick: function ()
{
,onBasketClick: function() {
if (this.isGuest())
return;
this.hash.set({'form': 'ecomerce/basket'});
}
,onConfigureClick: function ()
{
,onConfigureClick: function() {
if (this.isGuest())
return;
this.hash.set({'form': 'ecomerce/checkout'});
}
,onAddItemClick: function (button, form)
{
,onAddItemClick: function(button, form) {
if (this.isGuest())
return;
@ -273,8 +237,7 @@ Hedera.Catalog = new Class
this.$('card-popup').show(button.node);
}
,onAddLotClick: function (column, value, row)
{
,onAddLotClick: function(column, value, row) {
var model = this.$('item-lots');
var grouping = model.get(row, 'grouping');
var warehouse = model.get(row, 'warehouseFk');
@ -285,8 +248,7 @@ Hedera.Catalog = new Class
if (lotAmount === undefined)
lotAmount = 0;
if (lotAmount < available)
{
if (lotAmount < available) {
var newAmount = lotAmount + grouping;
if (newAmount > available)
@ -294,20 +256,17 @@ Hedera.Catalog = new Class
this.items[warehouse] = newAmount;
this.$('amount').value += newAmount - lotAmount;
}
else
} else
Htk.Toast.showError(_('NoMoreAmountAvailable'));
}
,onConfirmClick: function ()
{
,onConfirmClick: function() {
var sql = '';
var batch = new Sql.Batch();
var query = new Sql.String ({query: 'CALL basketAddItem (#warehouse, #item, #amount);'});
var query = new Sql.String({query: 'CALL myBasket_addItem(#warehouse, #item, #amount);'});
var amountSum = 0;
for (var warehouse in this.items)
{
for (var warehouse in this.items) {
var amount = this.items[warehouse];
amountSum += amount;
@ -317,8 +276,7 @@ Hedera.Catalog = new Class
sql += query.render(batch);
}
if (amountSum > 0)
{
if (amountSum > 0) {
this.conn.execQuery(sql);
var itemName = this.$('card').get('item');
@ -329,35 +287,30 @@ Hedera.Catalog = new Class
this.$('card-popup').hide();
}
,onEraseClick: function ()
{
,onEraseClick: function() {
this.$('amount').value = 0;
this.items = {};
}
,onPopupClose: function ()
{
,onPopupClose: function() {
this.onEraseClick();
this.$('card').row = -1;
this.$('card-item').value = undefined;
}
,onCardLoad: function ()
{
,onCardLoad: function() {
this.$('card-popup').reset();
}
});
Hedera.Catalog.extend
({
Hedera.Catalog.extend({
View: {
LIST: 0,
GRID: 1
}
});
Vn.Filter = new Class
({
Vn.Filter = new Class({
Extends: Htk.Field
,Tag: 'vn-filter'
,Child: 'model'
@ -366,40 +319,34 @@ Vn.Filter = new Class
model:
{
type: Db.Model
,set: function (x)
{
,set: function(x) {
x.batch = this._batch;
this._model = x;
this._select.model = x;
}
,get: function ()
{
,get: function() {
return this._model;
}
},
placeholder:
{
type: String
,set: function (x)
{
,set: function(x) {
this._select.placeholder = x;
this._placeholder = x;
}
,get: function ()
{
,get: function() {
return this._placeholder;
}
},
filter:
{
type: Sql.Filter
,set: function (x)
{
,set: function(x) {
this._filter = x;
this._batch.addObject('filter', x);
}
,get: function ()
{
,get: function() {
return this._filter;
}
},
@ -408,8 +355,7 @@ Vn.Filter = new Class
,_valueColumnIndex: 0
,_showColumnIndex: 1
,initialize: function (props)
{
,initialize: function(props) {
var node = this.createRoot('div');
node.className = 'vn-filter';
@ -426,30 +372,25 @@ Vn.Filter = new Class
this.parent(props);
}
,_onMouseDown: function ()
{
,_onMouseDown: function() {
if (this._model && this._model.status === Db.Model.Status.CLEAN)
this._model.refresh();
}
,_onCloseClick: function ()
{
,_onCloseClick: function() {
this._removeSelectionNode();
this._changeValue(undefined);
}
,_removeSelectionNode: function ()
{
if (this._lastLi)
{
,_removeSelectionNode: function() {
if (this._lastLi) {
Vn.Node.remove(this._lastLi);
this._lastLi = null;
this._label = null;
}
}
,_onChange: function ()
{
,_onChange: function() {
if (this._select.value === null
|| this._select.value === undefined)
return;
@ -457,32 +398,27 @@ Vn.Filter = new Class
this._realSetValue(this._select.value);
}
,_onReady: function ()
{
,_onReady: function() {
if (this._emptyLabel)
this._refreshLabel();
}
,_changeValue: function (newValue)
{
,_changeValue: function(newValue) {
this._batch.block();
this.value = newValue;
this._batch.unblock();
}
,_onTimeout: function ()
{
,_onTimeout: function() {
this._select.value = null;
}
,putValue: function (value)
{
,putValue: function(value) {
this._onMouseDown();
this._realSetValue(value);
}
,_realSetValue: function (value)
{
,_realSetValue: function(value) {
this._removeSelectionNode();
if (value === null || value === undefined)
@ -511,8 +447,7 @@ Vn.Filter = new Class
this._refreshLabel();
}
,_refreshLabel: function ()
{
,_refreshLabel: function() {
if (!this._label)
return;
@ -521,14 +456,11 @@ Vn.Filter = new Class
if (this._model.ready)
row = this._model.searchByIndex(this._valueColumnIndex, this._value);
if (row != -1)
{
if (row != -1) {
var label = this._model.getByIndex(row, this._showColumnIndex);
this._label.nodeValue = label;
this._emptyLabel = false;
}
else
{
} else {
this._emptyLabel = true;
this._label.nodeValue = _('Loading...');
}

View File

@ -59,7 +59,7 @@ Hedera.Checkout = new Class ({
onConfirmClick: function() {
this.disableButtons(true);
var query = 'CALL basketConfigure(#date, #method, #agency, #address)';
var query = 'CALL myBasket_configure(#date, #method, #agency, #address)';
var batch = new Sql.Batch();
batch.addParam('method', this.$('method'));

View File

@ -2,7 +2,7 @@
<vn-group>
<db-form id="order-form" on-ready="onOrderReady">
<db-model property="model" result-index="1">
CALL basketGetTax;
CALL myBasket_getTax;
SELECT o.id, o.sent, o.notes, o.companyFk,
ag.description agency, v.code method,
ad.nickname, ad.postalCode, ad.city, ad.street,
@ -23,7 +23,7 @@
</db-model>
</db-form>
<db-query id="confirm-query" on-ready="onConfirm">
CALL basketConfirm
CALL myBasket_confirm
</db-query>
</vn-group>
<div id="title">

View File

@ -44,7 +44,7 @@
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model property="model" id="tickets">
<custom>
CALL myTicketList (NULL, NULL);
CALL myTicket_list (NULL, NULL);
</custom>
</db-model>
<custom>

View File

@ -8,7 +8,7 @@ Hedera.Ticket = new Class({
var batch = new Sql.Batch();
batch.addValue('ticket', ticket.value);
this.conn.execQuery('CALL myTicketLogAccess(#ticket)', null, batch);
this.conn.execQuery('CALL myTicket_logAccess(#ticket)', null, batch);
},
onTicketReady: function(form) {

View File

@ -9,7 +9,7 @@
</sql-batch>
<db-form id="ticket" on-ready="onTicketReady">
<db-model id="ticket-data" property="model" batch="batch">
CALL myTicketGet (#ticket)
CALL myTicket_get (#ticket)
</db-model>
</db-form>
</vn-group>
@ -68,7 +68,7 @@
property="model"
id="movements"
batch="batch">
CALL myTicketGetRows (#ticket)
CALL myTicket_getRows (#ticket)
</db-model>
<custom>
<div class="line">
@ -112,7 +112,7 @@
property="model"
on-status-changed="onPackagesChanged"
batch="batch">
CALL myTicketGetPackages (#ticket)
CALL myTicket_getPackages (#ticket)
</db-model>
<custom>
<div class="line">

View File

@ -1,14 +1,11 @@
module.exports =
{
check: function (conn, callback)
{
conn.execQuery ('CALL basketCheck',
module.exports = {
check: function(conn, callback) {
conn.execQuery('CALL myBasket_check',
this._onBasketCheck.bind(this, callback));
}
},
,_onBasketCheck: function (callback, resultSet)
{
_onBasketCheck: function(callback, resultSet) {
var status = resultSet.fetchValue();
if (!status)
@ -21,7 +18,7 @@ module.exports =
if (callback)
callback(isOk);
if (!isOk)
Vn.Hash.set ({'form': 'ecomerce/checkout'});
Vn.Hash.set({form: 'ecomerce/checkout'});
}
};

View File

@ -15,7 +15,7 @@ module.exports = new Class
batch.addValue('transaction', this.tpvOrder);
batch.addValue('status', this.tpvStatus);
var query = 'CALL tpvTransactionEnd (#transaction, #status)';
var query = 'CALL myTpvTransaction_end(#transaction, #status)';
this.conn.execQuery(query, null, batch);
}

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.406.46",
"version": "1.406.47",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -2,7 +2,7 @@
<vn-group>
<db-form id="ticket" on-ready="onTicketReady">
<db-model property="model" id="ticket-data" conn="conn" batch="batch">
CALL myTicketGet (#ticket)
CALL myTicket_get (#ticket)
</db-model>
</db-form>
</vn-group>
@ -38,7 +38,7 @@
</div>
<htk-grid>
<db-model property="model" id="movements" conn="conn" batch="batch">
CALL myTicketGetRows (#ticket)
CALL myTicket_getRows (#ticket)
</db-model>
<htk-column-spin title="_Ref" column="itemFk"/>
<htk-column-spin title="_Amount" column="quantity"/>
@ -64,7 +64,7 @@
conn="conn"
batch="batch"
on-status-changed="onPackagesChanged">
CALL myTicketGetPackages (#ticket)
CALL myTicket_getPackages (#ticket)
</db-model>
<htk-column-spin title="_Ref" column="id"/>
<htk-column-spin title="_Amount" column="quantity"/>

View File

@ -9,7 +9,7 @@
batch="batch"
conn="conn">
<custom>
CALL itemGetList(#warehouse, CURDATE(), #realm, #rate)
CALL item_getList(#warehouse, CURDATE(), #realm, #rate)
</custom>
</db-model>
<htk-column-image

View File

@ -1,6 +1,5 @@
Hedera.ShelvesReport = new Class
({
Hedera.ShelvesReport = new Class({
Extends: Hedera.Report
,nItem: -1
@ -8,8 +7,7 @@ Hedera.ShelvesReport = new Class
,trayThickness: 2
,trayMargin: 5
,open: function (batch)
{
,open: function(batch) {
this.batch = batch;
this.title = batch.getValue('reportTitle');
this.maxAmount = batch.getValue('maxAmount');
@ -20,13 +18,12 @@ Hedera.ShelvesReport = new Class
var query =
'SELECT id, name, nTrays, topTrayHeight, trayHeight, width, depth '+
'FROM shelf WHERE id = #shelf; '+
'CALL itemAllocator (#warehouse, #date, #family, #namePrefix, #useIds)';
'CALL item_listAllocation(#warehouse, #date, #family, #namePrefix, #useIds)';
this.conn.execQuery(query, this.onQueryExec.bind(this), this.batch);
}
,onQueryExec: function (resultSet)
{
,onQueryExec: function(resultSet) {
// Fetch query data
var res = resultSet.fetchResult();
@ -62,8 +59,7 @@ Hedera.ShelvesReport = new Class
var remainings = this.remainings = [];
var res = resultSet.fetchResult();
if (res.data.length == 0)
{
if (res.data.length == 0) {
Htk.Toast.showError(_('No items found, check that all fields are correct'));
return;
}
@ -71,8 +67,7 @@ Hedera.ShelvesReport = new Class
var boxScale = scale * 10;
while (res.next())
if (!this.maxAmount || res.get ('etiquetas') <= this.maxAmount)
{
if (!this.maxAmount || res.get('etiquetas') <= this.maxAmount) {
items.push({
id: res.get('Id_Article')
,name: res.get('Article')
@ -82,9 +77,7 @@ Hedera.ShelvesReport = new Class
,boxWidth: res.get('x') * boxScale
,boxDepth: res.get('y') * boxScale
});
}
else
{
} else {
remainings.push({
id: res.get('Id_Article')
,name: res.get('Article')
@ -111,14 +104,12 @@ Hedera.ShelvesReport = new Class
this.createWindow();
}
,onWindowCreate: function ()
{
,onWindowCreate: function() {
// Remaining amount
var remainings = this.remainings;
if (remainings.length > 0)
{
if (remainings.length > 0) {
var sheet = this.doc.createElement('div');
sheet.className = 'sheet';
this.doc.body.appendChild(sheet);
@ -136,8 +127,7 @@ Hedera.ShelvesReport = new Class
var ul = this.doc.createElement('ul');
sheet.appendChild(ul);
for (var i = 0; i < remainings.length; i++)
{
for (var i = 0; i < remainings.length; i++) {
var li = this.doc.createElement('li');
ul.appendChild(li);
@ -167,8 +157,7 @@ Hedera.ShelvesReport = new Class
this.drawShelfRange(this.lastItem, false);
}
,drawShelf: function (allocator, item)
{
,drawShelf: function(allocator, item) {
var shelf = this.shelf;
var sheet = this.doc.createElement('div');
@ -210,8 +199,7 @@ Hedera.ShelvesReport = new Class
// Draws trays
for (var i = 0; i < shelf.nTrays; i++)
{
for (var i = 0; i < shelf.nTrays; i++) {
var tray = this.doc.createElement('div');
tray.className = 'tray';
tray.style.bottom = this.mm((shelf.trayHeight + this.trayThickness + this.trayMargin) * i);
@ -221,8 +209,7 @@ Hedera.ShelvesReport = new Class
}
}
,drawShelfRange: function (item, isFirst)
{
,drawShelfRange: function(item, isFirst) {
var labelText = isFirst ? _('Start') : _('End');
var label = this.doc.createElement('label');
@ -236,24 +223,19 @@ Hedera.ShelvesReport = new Class
this.subtitles.appendChild(subtitle);
}
,getItemLabel: function (item)
{
if (!this.useIds)
{
,getItemLabel: function(item) {
if (!this.useIds) {
var packing = this.showPacking ? (' x'+ item.packing) : '';
return item.name + packing;
}
else
} else
return item.id.toLocaleString();
}
,mm: function (size)
{
,mm: function(size) {
return size.toFixed(2) +'mm';
}
,drawBox: function (allocator, item, amount)
{
,drawBox: function(allocator, item, amount) {
if (item.boxWidth == 0 || item.boxHeight == 0)
return;
@ -279,12 +261,10 @@ Hedera.ShelvesReport = new Class
var nColor = this.nItem % this.nColors;
Vn.Node.addClass(box, 'color'+ nColor);
if (amount == 0 || allocator.firstShelfBox)
{
if (amount == 0 || allocator.firstShelfBox) {
var boxLabel = this.doc.createElement('div');
if (this.useIds)
{
if (this.useIds) {
var fontSize = item.boxWidth / 5.2;
if (fontSize > item.boxHeight - 1)
@ -293,8 +273,7 @@ Hedera.ShelvesReport = new Class
boxLabel.style.fontSize = this.mm(fontSize);
var cssClass = 'id';
}
else
} else
var cssClass = 'name';
boxLabel.className = 'box-label '+ cssClass;
@ -309,10 +288,8 @@ Hedera.ShelvesReport = new Class
}
});
Vn.Allocator = new Class
({
addShelf: function (item)
{
Vn.Allocator = new Class({
addShelf: function(item) {
this.currentShelf++;
this.firstShelfBox = true;
@ -320,21 +297,17 @@ Vn.Allocator = new Class
this.shelfFunc(this, item);
}
,addTray: function (item)
{
if (this.currentTray <= 0)
{
,addTray: function(item) {
if (this.currentTray <= 0) {
this.addShelf(item);
this.currentTray = this.nTrays - 1;
}
else
} else
this.currentTray--;
this.trayX = 0;
}
,addColumn: function (item)
{
,addColumn: function(item) {
if (this.trayX + this.columnWidth + item.boxWidth > this.width
|| this.currentTray == -1)
this.addTray(item);
@ -346,8 +319,7 @@ Vn.Allocator = new Class
this.lastBoxWidth = item.boxWidth;
}
,addBox: function (item, amount)
{
,addBox: function(item, amount) {
var trayHeight = this.trayHeight;
if (this.currentTray == this.nTrays - 1)
@ -367,8 +339,7 @@ Vn.Allocator = new Class
this.lastBoxWidth = item.boxWidth;
}
,run: function ()
{
,run: function() {
this.firstShelfBox = false;
this.currentShelf = -1;
this.currentTray = -1;
@ -378,16 +349,14 @@ Vn.Allocator = new Class
this.trayY = 0;
this.remaining = false;
for (var i = 0; i < this.items.length; i++)
{
for (var i = 0; i < this.items.length; i++) {
var item = this.items[i];
var boxIncrement = Math.floor(this.depth / item.boxDepth);
if (boxIncrement < 1)
boxIncrement = 1;
for (var amount = 0; amount < item.amount; amount += boxIncrement)
{
for (var amount = 0; amount < item.amount; amount += boxIncrement) {
this.addBox(item, amount);
this.firstShelfBox = false;
}
@ -395,5 +364,4 @@ Vn.Allocator = new Class
return this.currentShelf + 1;
}
});

View File

@ -18,7 +18,7 @@ class Tpv {
$error = NULL;
return $db->query(
'CALL tpvTransactionConfirm(#, #, #, #, #, #)',
'CALL tpvTransaction_confirm(#, #, #, #, #, #)',
[
$params['Ds_Amount']
,$params['Ds_Order']

View File

@ -10,7 +10,7 @@ class Transaction extends Vn\Web\JsonRequest {
$amount =(int) $_REQUEST['amount'];
$companyId = empty($_REQUEST['company']) ? NULL : $_REQUEST['company'];
$row = $db->getObject('CALL tpvTransactionStart(#, #)',
$row = $db->getObject('CALL myTpvTransaction_start(#, #)',
[$amount, $companyId]);
if (!isset($row))

View File

@ -97,7 +97,7 @@ abstract class Service {
$ip = ip2long($_SERVER['REMOTE_ADDR']);
$row = $db->getRow(
'CALL visitRegister(#, #, #, #, #, #, #, #, #)',
'CALL visit_register(#, #, #, #, #, #, #, #, #)',
[
nullIf($_COOKIE, 'vnVisit')
,nullIf($browser, 'platform')
@ -191,7 +191,7 @@ abstract class Service {
if (isset($_SESSION['access']) && $userChanged)
$db->query(
'CALL visitUserNew(#, #)',
'CALL visitUser_new(#, #)',
[$_SESSION['access'], session_id()]
);
}