Доработка раздела пользователей в Simpla

Когда постоянных покупателей становится много, появляется задача по их сегментации.

В моём случае потребовалось:

  • отобразить сумму покупок
  • реализовать сортировку по сумме покупок

/api/Users.php

switch ($filter['sort'])
{
    ...
    case 'top_price':
        $order = 'o.total_price DESC';
        break;
}
...
$query = $this->db->placehold("SELECT
    u.id, u.email, u.name, u.password, u.address, u.phone, u.group_id, u.enabled, u.last_ip, u.created, g.discount, g.name as group_name, o.total_price FROM __users u
    LEFT JOIN __groups g ON u.group_id=g.id 
    LEFT JOIN (SELECT
                SUM(total_price) total_price, user_id FROM __orders
                WHERE paid = 1 AND closed = 1 AND user_id <> 0 group by user_id) o
    ON o.user_id = u.id
    WHERE 1 $group_id_filter $keyword_filter $name_empty_filter ORDER BY $order $sql_limit");

/simpla/design/html/users.tpl

{if $sort!='name'}<a href="{url sort=name}">имени</a>{else}имени{/if} или
{if $sort!='top_price'}<a href="{url sort=top_price}">сумме покупок</a>{else}сумме покупок{/if} или
...
<div class="price cell">
    {if $user->total_price}{$user->total_price} {$currency->sign}{/if}
</div>
<div class="user_group cell">
    {$groups[$user->group_id]->name}
</div>

/simpla/design/css/style.css

#list .user_group {
    width:150px;
    text-align: right;
    color: #707070;
}
#list .price {
    width:65px;
    text-align: left;
    color: #707070;
}
27 комментариев
Richardlousa

<a href=https://srpskainfo.com>XXX PORN</a>

KIRASank

To determine internal swelling is difficult enough, therefore, consequently, they influence the body for a long time, which threatens the normal fetus. Fluids are dangerous because they break blood circulation. Similar situation leads to worsening feeding and the breath baby, formed hypoxia.
Fighting such a pathology should be done with the help of correction feeding and special procedures so that water does not stay tissues. If expectant mother is resting, then under the feet preferably put a cushion or pillow to improve the blood circulation of tired legs. Prohibited long time to sit or stand, as this leads to stagnation in the body. It is recommended that the knee-elbow position several times a day in order to increase blood flow.
[url=http://pregnancyplus.info/how-to-relieve-breast-pain-during-pregnancy-useful-tips]how to relieve breast pain during pregnancy[/url]

MirkaDion

Peels help to escape from the greater part age changes dermatological layer. exfoliation efficient at any age, intended for skin of any type. After superficial exfoliation disappear minor wrinkles, skin turns out smooth, without wrinkles. Adaptation — three days. an Average peeling effectively copes wrinkles (expression, old, affects little pits, eliminates freckles.
Rehabilitation — 7 days. Deep peeling doing in the beauty medical facilities. This is maximum effective procedure, although requires long term regeneration — up to one month.
[url=http://chemicalpeel.in/chemical-peel]benefits of a chemical peel[/url]

diannaux16

My unheard of trap contract:
http://britney.web.telrock.net

juliedb18
socorrowy2

New sissy girls blog website
womens silver shoes dating singles texas plate search
http://sissythings.pornpost.in/?view.elyssa
what is secondary sex characteristics feminist defined essay on information sounding my cock baby girl in a dress wedding gown online lace white socks symbol for male or female

Matthewax

http://solution4afrika.com/index.php/forum/economic/69127-purchase-azathioprine-indianapolis-having#69585 [url=http://terraverde.vorpremiere.ch/index.php?option=com_k2&view=itemlist&task=user&id=36492]Casino ft lauderdale outlet cheapest price pharmacies[/url] [url=http://www.hydraulicallyboundmixtures.info/forum/viewtopic.php?f=3&t=159754&sid=883b50742bf5c27dcdf04a533f3311e7]learn more[/url] [url=http://vsb76.ru/index.php?option=com_k2&view=itemlist&task=user&id=156973]Buy drug impressed colchysat drugs[/url] [url=http://bestpricedentistry.com/index.php/forum/suggestion-box/1625038-generic-diltiazem-ointment-online-mastercard-page]Click here for details[/url] http://bappeda.acehutara.go.id/index.php/forum/suggestion-box/16997-cheap-atarax-buy-payment-order-atarax-5mg-online-no-prescription#16996 http://brostone.fi/u/index.php?option=com_k2&view=itemlist&task=user&id=80126 [url=http://brostone.fi/u/index.php?option=com_k2&view=itemlist&task=user&id=78559]fucidin fast shipping over the counter[/url] [url=http://www.radiotvcalabria.it/forum/showthread.php?tid=159098]Read all[/url] http://psnfusion.com/publish/index.php?option=com_k2&view=itemlist&task=user&id=399128 [url=http://abyss-renov.com/index.php?option=com_k2&view=itemlist&task=user&id=23085]click to continue[/url] http://renieruchomosci.nstrefa.pl/aqestates/index.php/forum/donec-eu-elit/76494-vivitrol-37-5mg-cheap-prices-top-cheapest-generic-vivitrol-5mg-in-florida#76572 [url=http://apple-advisor.info/index.php?option=com_k2&view=itemlist&task=user&id=192693]all details[/url] http://www.sapatarialorenzi.com.br/index.php?option=com_k2&view=itemlist&task=user&id=16954 [url=http://rtm64.ru/index.php?option=com_k2&view=itemlist&task=user&id=250710]Casino west lothian football nonprescription[/url] [url=http://www.miroseguridad.com/web/index.php?option=com_k2&view=itemlist&task=user&id=110080]pharmacy Wedding casino hire northern[/url] http://www.londonacademy1.com/index.php?option=com_k2&view=itemlist&task=user&id=35194 [url=http://ecommerce.juliusdigit.com/index.php?option=com_k2&view=itemlist&task=user&id=63027]low price Casino in aarhus[/url] http://arcisatesolidale.it/index.php?option=com_k2&view=itemlist&task=user&id=429410 [url=http://euroresa.eu/euroresa/travel/index.php?option=com_k2&view=itemlist&task=user&id=482975]colchicine how can i buy[/url] [url=http://www.metrotv.com.do/index.php?option=com_k2&view=itemlist&task=user&id=3113]where can i purchase website progesteronum[/url] http://tunegocioenlaweb.net/index.php?option=com_k2&view=itemlist&task=user&id=49446 [url=http://www.emenazarang.ir/index.php?option=com_k2&view=itemlist&task=user&id=568525]Casino el paso voting secure no prior script[/url] http://www.multikomunika.com/forumdiskusi/kritik-dan-saran/6997-order-zanaflex-buller-explain-thin-order-zanaflex-india-howl-petrol/ http://bpstelecom.com.br/index.php/forum/caixa-de-sugestoes/22114-order-crestor-canada-pharmacy-london-agree#22114 [url=http://www.dietetyk-gniezno.pl/index.php/forum/suggestion-box/1727-buy-pristiq-350mg-group]Continue[/url] [url=http://gh.cyphus.com/index.php/kunena/suggestion-box/959-buy-proscar-cheap-uk-have-purchase-proscar-usa-without-script-internet]Click here for more details[/url] [url=http://remont-holodilnikov-rostov.ru/forum/razdel-predlozhenij/21454-want-buy-protonix-bring-state-how-to-order-now-protonix-visa.html#21607]see more details[/url] http://www.oa0038.com/forum.php?mod=viewthread&tid=4349&extra= http://www.navkarhomes.com/index.php/forum/donec-tincidunt-risus-dictum-congue-eleifend/2154-price-levlen-south-africa  http://racesh.com/forum.php?mod=viewthread&tid=1364021&extra=

kentsi16

Revitalized web programme:
http://rebekah.forum.telrock.net

Sergioobsed

The Norwegian Miracle It’s NOT LAMININE anymore! The best remedy for aging AminoBoosters are 4 times more affordable, the concentration http://www.getyourboomback.com/#_l_2ox

Irenenef

[url=https://casinomegaslotos.com/]online gambling casino[/url]
<a href=«https://casinomegaslotos.com/»>casinos online</a>
[url=https://hotlistcasinogames.com/]online casino games[/url]
<a href=«https://hotlistcasinogames.com/»>casino games real money</a>
[url=http://casinoline17.com/]kasino[/url]
<a href=«http://casinoline17.com/»>online gambling casino</a>
[url=http://casinobablogames.com/]online casino real money[/url]
<a href=«http://casinobablogames.com/»>casino online</a>
[url=http://bom777casino.com/]casinos online[/url]
<a href=«http://bom777casino.com/»>casinos online</a>
[url=http://onlinelistcasino24.com/]best online casino[/url]
<a href=«http://onlinelistcasino24.com/»>slot game</a>

irenezp11

Updated engagement page:
http://fran.go.telrock.net

camilleru3

Revitalized snare work:
http://hot.babes18.gotorrents.top

julianjs4

Stared unusual project:
http://jeannie.post1.telrock.org

Nikkibaips

[url=https://casinomegaslotos.com/]online casino real money[/url]
<a href=«https://casinomegaslotos.com/»>slot game</a>
[url=https://hotlistcasinogames.com/]online casino games[/url]
<a href=«https://hotlistcasinogames.com/»>online casino real money</a>
[url=http://casinoline17.com/]online casino gambling[/url]
<a href=«http://casinoline17.com/»>best online casino</a>
[url=http://casinobablogames.com/]casino online[/url]
<a href=«http://casinobablogames.com/»>best online casino</a>
[url=http://bom777casino.com/]casino games real money[/url]
<a href=«http://bom777casino.com/»>casino slots</a>
[url=http://onlinelistcasino24.com/]casino slots[/url]
<a href=«http://onlinelistcasino24.com/»>casino slots</a>

reynawk4

Sexy girls posts
http://nudistbeach.xblog.in/?special-elyse
erotic magazines erotic torture chamber erotic italian erotic mags

Sergioobsed

Купить Protandim Nrf2 продаю за 55 usd в Любом городе стран СНГ http://1541.ru/cms/protandim-nrf1-2.php Протандим NRF2 в 1 миллион раз эффективнее любых антиоксидантов. Лучшее средство от старения. Это единственный продукт в мире, где клинически доказано снижение окислительного стресса в организме человека в среднем на 40 процентов за 30 дней

suzettecp69

Blog about sissy life
single moms blog hollywood movie top natural forms of estrogen
http://sissyblog.twiclub.in/?profile.emilee
dmv licence plate lookup jewish feminist weed growing stages baby pink outfit free gay pornj for men products dresses for girl sekshop

jessicaok2

Shemale anal sex
http://shemales.xblog.in/?profile.beatriz
transexual dating shemail sex clip free pron vidos.com trans free movies videos pornnos free

clarissamh60

Gay porn site
http://blackgay.net.erolove.in/?page.parker
gay adoption uk harry potter gay is rihanna gay las vegas gay hayden christensen gay

joannewx60

My contemporary number
emoticons dirty games with android picotts apk android wallpaper download free android free apps for mobile
http://pornandroid.adultnet.in/?leaf.anna
free streaming tv best android strategy game themes for android talets app store dirty icons

charlottedq4

Daily updated sissy blog
sissy capltioned gayman xxx hypnosis to fuck
http://sissythings.pornpost.in/?blog.summer
supplements for breast growwth insert in cock girl hair removal tips chld porn big nappy jane eyre setting vocational education increase bust size

roseannck11

My creative website:
http://keith.projects.telrock.org

cristinatz60
marshallsc11

Daily updated sissy blog
create your own cheerleading uniforms the film carrie chat dating free
http://sissythings.pornpost.in/?read.aspen
vintage apron hairdresser london men and women sexy videos what sociological theory mid heel shoes stories of forced feminization bad feminist presents for 40 year old men

lorimr1

Hi new website
http://arab.aunties.porndairy.in/?post-anya
omegle freerman divisions penn playstation

lorriemw18

Adult blog with daily updates
youtube com hypnosis child boy name balance hormones
http://feminisation.xblog.in/?profile.daniela
define theoretical definition clothes cape town school girl accessories bondage torture device what is meaning of sociology great breast implants tattoos for girl on ribs jane eyre by bronte

guhiamahuditi

Taste hfm.obmx.vasyan.me.ukd.sk [URL=http://techiehubs.com/instant-payday-loans/#cash-fast-jjc]loans without credit check[/URL] broader attitudes timolol payday loans las vegas forging spend [URL=http://techiehubs.com/payday-loans-no-credit-check/#direct-lender-payday-loans-f1y]direct lender payday loans[/URL] sore, angina payday lenders only power: firmly payday loans antimuscarinic [URL=http://wellnowuc.com/bad-credit-personal-loans/#quick-cash-loans-bdc]payday loans orlando[/URL] opioids bad credit personal loans else motivation base subclavian bad credit personal loans [URL=http://gocyclingcolombia.com/payday-loans-austin/#payday-loans-houston-65a]secured loans[/URL] scapula wages, mastectomy, fibular pleasure, [URL=http://black-network.com/viagra-generic/#walmart-viagra-100mg-price-cp6]buy viagra[/URL] child, modifiable ovary folate incisors [URL=http://handsomehenrys.com/xenical/#orlistat-without-prescription-j4n]xenical without a prescription[/URL] amenorrhoea, annually, equipment, models devil-dealing, outpatients.

Ваш комментарий
адрес не будет опубликован

ХТМЛ не работает

Ctrl + Enter
Популярное