olap/olap_config.php

124 lines
3.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
function v2tags_get_tags()
{
return mysql_select('tags', 'id, name', array('type' => 0));
}
OLAP::$sources = array(
'v2tags' => array(
'id' => 'v2tags',
'name' => 'VitaphotoV2, статистика по тегам',
'tables' => array('t' => 'stats_tag_all'),
'fields' => 't.ts, t.tag',
'where' => array(),
'fielddescs' => array(
'ts' => array(
'name' => 'Время',
'le_ge' => true,
'is_time' => true,
'format' => TS_UNIX,
),
'tag' => array(
'name' => 'Тег',
'options' => 'v2tags_get_tags',
),
),
),
'real_august2' => array(
'db' => array('chk', 'localhost', 'chk', 'chk'),
'name' => 'РЕАЛ Август 2',
'tables' => array('t' => 'real_august2'),
'where' => array(),
'fielddescs' => array(
'Page No' => array(
'sql' => '`Page No`',
'name' => 'Номер страницы',
'le_ge' => true,
),
'Frame No' => array(
'sql' => '`Frame No`',
'name' => 'Frame No',
'le_ge' => true,
),
'FNF' => array(
'name' => 'Food / Non-Food',
'options' => array(
array('id' => 'F', 'name' => 'Food'),
array('id' => 'N', 'name' => 'Non-Food'),
),
),
'CMA' => array(
'name' => 'Category Manager',
'le_ge' => true,
),
'CMA Description' => array(
'sql' => '`CMA Description`',
'name' => 'Категория',
'autofilter' => true,
),
'Leading Article' => array(
'sql' => '`Leading Article`',
'name' => 'Артикул',
),
'Article Description' => array(
'sql' => '`Article Description`',
'name' => 'Описание артикула',
),
'Price' => array(
'name' => 'Цена',
'le_ge' => true,
),
'Sales' => array(
'name' => 'Продажи',
'le_ge' => true,
),
'Qty' => array(
'name' => 'Количество',
'le_ge' => true,
),
'Margin' => array(
'name' => 'Маржа',
'le_ge' => true,
),
'Profit' => array(
'name' => 'Доход',
'le_ge' => true,
),
),
),
'chk' => array(
'id' => 'chk',
'db' => array('chk', 'localhost', 'chk', 'chk'),
'name' => 'Чеки', // date, price, seller, comment, count, each
'tables' => array('t' => 'chk'),
'fields' => 't.date, t.price, t.seller, t.comment, t.count, t.each',
'where' => array(),
'fielddescs' => array(
'date' => array(
'name' => 'Дата',
'le_ge' => true,
'is_time' => true,
'format' => TS_DB,
),
'price' => array(
'name' => 'Цена',
'le_ge' => true,
),
'seller' => array(
'name' => 'Где',
),
'comment' => array(
'name' => 'Комментарий',
),
'count' => array(
'name' => 'Количество',
),
'each' => array(
'name' => 'Цена за каждый',
'sql' => '`each`',
),
),
),
);