TODO:EmlogAndroidAPP:Emlog发布文章并非按文章id排序

2015年11月08日 APP 11条评论 阅读8106次

今天在检查EmlogAndroid客户端APP时,发现了一个bug。


EmlogAndroid客户端APP呈现的bug现象:

我今天最新发布的一篇文章没有被第一的位置显示,而是跑到了第四五左右的位置显示着。


bug是由我写文章的习惯而引起的。一般我要写神马东西时,会在后台管理中直接点开写文章,之后保存为草稿,等到写作完成并且感觉可以发布的时候在到后台管理中,点击发布按钮发布出去让大家看到。


bug发生的根本原因下面做详细的解释。


Emlog后台保存数据的处理

Emlog的写文章时的草稿功能,也是保存到了后台数据库的emlog_blog表中,只要是一保存文章草稿,该表中就会插入一条新的记录,该条记录和正式发布的文章一样,也被分配了文章id,也就是gid属性。唯一用来区分是草稿还是正式发布文章的字段就是一个叫做hide的字段,该属性为n则标示为草稿。

等到正式发布改草稿为正式文章时,之前分配gid并不会被更新,只有文章发布时间可以在画面上选择为当前时间从而更新掉。

也就是说,我们从web的Emlog博客中看到的文章列表的排列顺序并不是按照文章id gid降序排列的,而是按照文章发布时间date来排序的。


Emlog客户端APP取数据的处理

EmlogAndroid客户端中,用户点击了“看博客”之后,通过webservice,取得emlog_blog表中非隐藏的最大gid,以此作为第一篇文章,同时从emlog_blog表得到10篇文章,作为本次请求的结果。在上拉加载更多文章时,会用上次取得的最大gid在减去10,作为本次请求的gid,这样就有了加载更多10篇文章的条件。


比较Emlog后台数据保存和Emlog客户端APP取数据的不同之处

通过上面的描述,可以看到其实是Emlog客户端在取得博客文章列表时并没有考虑到文章发布时间date这个字段的值。

也是这一点颠覆了我的思维模式。


解释到这里,大家应该都清楚怎么回事了。以后遇到从Emlog后台数据库中取数据的清空,一定记得文章列表是要按照发布时间排序,而不是按照gid。

因为暂时还有别的工作要忙,所以暂时先加到TODO中吧。后续有时间时会在以后的版本升级中改进这个问题。

分享本文至:

WRITTEN BY

avatar
本文标签:emlog排序
看了本文是不是觉得很赞,那就赶紧点击下面按钮分享给身边的朋友吧!

11 条评论

  1. avatar meetingxs

    <a href="http://www.projetocidade.com/north-face-gore-tex-hiking-boots-northfacer">north face gore tex hiking boots</a> <a href="http://www.alquranschool.com/under-armour-curry-2.0-skos">under armour curry 2.0</a> <a href="http://www.betascgx.com/nike-air-huarache-matte-plata-paint-kurpese">nike air huarache matte plata paint</a> <a href="http://www.runninbunions.com/nike-limited-duane-brown-jersey-76-nfl-seattle-seahawks-therma-long-sleeve-youth-navy-blue-nfls">nike limited duane brown jersey 76 nfl seattle seahawks therma long sleeve youth navy blue</a> <a href="http://www.hobbyfreaks.com/hermes-kelly-28-togo-hermesg">hermes kelly 28 togo</a> <a href="http://www.nishuran.com/air-jordan-jumpman-team-naranja-marr%C3%B3n-chaussuresd">air jordan jumpman team naranja marr贸n</a>
    meetingxs http://www.meetingxs.com/

  2. avatar zendounagota

    <a href="http://www.goseecreate.com/nike-basketballe-gr%C3%A5-chaussuresb">nike basketballe gr氓</a> <a href="http://www.klarinettino.com/navy-blue-and-grey-nike-air-max-sneakerf">navy blue and grey nike air max</a> <a href="http://www.loydartist.com/asics-gel-kayano-20-black-instructions-runninga">asics gel kayano 20 black instructions</a> <a href="http://www.musicbreeds.com/nike-kobe-10-vert-hills-chaussuresc">nike kobe 10 vert hills</a> <a href="http://www.plakglas.com/white-leather-converse-shoesz">white leather converse</a> <a href="http://www.samuelzide.com/nike-ash-womens-daniel-kilgore-backer-nfl-67-miami-dolphins-pullover-hoodie-nflt">nike ash womens daniel kilgore backer nfl 67 miami dolphins pullover hoodie</a>
    zendounagota http://www.zendounagota.com/

  3. avatar wsphotel

    <a href="http://www.kellyalberto.com/hermes-zodiac-scarf-price-book-scarfb">hermes zodiac scarf price book</a> <a href="http://www.magaview.com/air-jordan-5-retro-gs-pink-sneakerf">air jordan 5 retro gs pink</a> <a href="http://www.wtcrosario.com/coach-mens-camo-backpack-coachr">coach mens camo backpack</a> <a href="http://www.artoccsr.com/nike-air-max-lunar1-iron-gr%C3%B8n-ohio-chaussuresb">nike air max lunar1 iron gr酶n ohio</a> <a href="http://www.littlehaleh.com/mens-moncler-maya-jacket-monclerr">mens moncler maya jacket</a> <a href="http://www.lubimochka.com/north-face-gore-tex-xcr-mountain-jacket-tour-northfacec">north face gore tex xcr mountain jacket tour</a>
    wsphotel http://www.wsphotel.com/

  4. avatar judygeitzen

    <a href="http://www.sinfoniamktg.com/new-balance-750v3-chaussuresb">new balance 750v3</a> <a href="http://www.mrshoover.com/nike-air-max-thea-kvinders-outfit-zapatosj">nike air max thea kvinders outfit</a> <a href="http://www.valomak.com/nike-classic-cortez-nylon-glowing-star-dark-blu-rosso-obuvf">nike classic cortez nylon glowing star dark blu rosso</a> <a href="http://www.inklinktatoo.com/pandora-crystal-charm-addict-pandoraj">pandora crystal charm addict</a> <a href="http://www.adracingworld.com/barn-adidas-light-up-sko-oransje-gr%C3%B8nn-trainersd">barn adidas light up sko oransje gr酶nn</a> <a href="http://www.tentoledo.com/nike-air-jordan-6-schwarz-friday-chaussuresm">nike air jordan 6 schwarz friday</a>
    judygeitzen http://www.judygeitzen.com/

  5. avatar duranerdogan

    <a href="http://www.brickolino.com/ralph-lauren-long-sleeve-polo-charcoal-face-polob">ralph lauren long sleeve polo charcoal face</a> <a href="http://www.charlomagno.com/le-coq-sportif-schuhe-gelb-wei%C3%9F-scarped">le coq sportif schuhe gelb wei脽</a> <a href="http://www.joannapage.com/parajumpers-long-bear-leather-black-cat-parajumpersa">parajumpers long bear leather black cat</a> <a href="http://www.michellestill.com/billig-nike-lunar-kvinners-svart-sportsc">billig nike lunar kvinners svart</a> <a href="http://www.scottdepot.com/canada-goose-hybridge-redwood-deck-canadagoosec">canada goose hybridge redwood deck</a> <a href="http://www.edotokyolabo.com/printed-dresses-cheap-dressh">printed dresses cheap</a>
    duranerdogan http://www.duranerdogan.com/

  6. avatar epicharis

    <a href="http://www.pruspokane.net/adidas-superstar-bl%C3%A5-blomst-obuva">adidas superstar bl氓 blomst</a> <a href="http://www.quatangkyniem.net/nike-tiempo-legend-v-ag-orange-gris-noir-obuve">nike tiempo legend v ag orange gris noir</a> <a href="http://www.radnorshire.net/mujeres-nike-shox-2016-naranja-oro-obuvf">mujeres nike shox 2016 naranja oro</a> <a href="http://www.rainawater.net/lebron-14-sko-nike-schuhef">lebron 14 sko nike</a> <a href="http://www.rainycitymedia.net/nike-air-force-1-201907-trainers-in-svart-kurpesd">nike air force 1 201907 trainers in svart</a> <a href="http://www.rcdcorp.net/nike-lebron-soldier-9-s%C3%B8lv-gr%C3%B8n-butyf">nike lebron soldier 9 s酶lv gr酶n</a>
    epicharis http://www.epicharis.net/

  7. avatar xjdscnuh

    <a href="http://www.soextfence.com/nike-tiempo-legend-v-fg-negro-zapatosl">nike tiempo legend v fg negro</a> <a href="http://www.amemedgroup.com/ray-ban-aviator-large-metal-ii-sunglassesh">ray ban aviator large metal ii</a> <a href="http://www.shawkreizer.com/st-louis-cardinals-mesh-hat-hatj">st louis cardinals mesh hat</a> <a href="http://www.powerwomanbc.com/adidas-ultra-boost-uncaged-nero-boost-scarpej">adidas ultra boost uncaged nero boost</a> <a href="http://www.kilaswacana.com/nike-huarache-schwarz-wei%C3%9F-lila-schuhei">nike huarache schwarz wei脽 lila</a> <a href="http://www.hobartcomfest.com/adidas-nmd-runner-triple-hvid-out-skoh">adidas nmd runner triple hvid out</a>
    xjdscnuh http://www.xjdscnuh.com/

  8. avatar varisofttech

    <a href="http://www.hkyahao.com/nike-roshe-run-triangle-rose-violet-trainersb">nike roshe run triangle rose violet</a> <a href="http://www.innordicau.com/air-jordan-13-retro-girls-sort-hyper-lyser%C3%B8d-hvid-kurpesd">air jordan 13 retro girls sort hyper lyser酶d hvid</a> <a href="http://www.rahdanesh.com/air-max-zero-fake-zero-schwarz-schuhel">air max zero fake zero schwarz</a> <a href="http://www.myprontocard.com/nike-free-run-5.0-rosa-femminile-skoe">nike free run 5.0 rosa femminile</a> <a href="http://www.eldiadeitalia.com/nike-free-3.0-v5-mennns-bl%C3%A5-quartz-footg">nike free 3.0 v5 mennns bl氓 quartz</a> <a href="http://www.lapakhoki.com/jordan-13-hot-rosa-and-svart-sneakerd">jordan 13 hot rosa and svart</a>
    varisofttech http://www.varisofttech.com/

  9. avatar notbore

    <a href="http://www.issnederland.com/mackage-jerry-leather-jacket-mackager">mackage jerry leather jacket</a> <a href="http://www.opelbeyinleri.com/nike-zoom-pegasus-33-blue-brown-sneakere">nike zoom pegasus 33 blue brown</a> <a href="http://www.zemservise.com/nike-shox-avenue-herre-gr%C3%A5-footc">nike shox avenue herre gr氓</a> <a href="http://www.theuntoldlost.com/white-out-new-balance-skox">white out new balance</a> <a href="http://www.bonairecliffs.com/air-max-tavas-olx-sportsd">air max tavas olx</a> <a href="http://www.cmetechnology.com/coach-bleecker-legacy-coachr">coach bleecker legacy</a>
    notbore http://www.notbore.com/

  10. avatar truthtapes

    <a href="http://www.laketreepress.com/dam%C3%A4nner-air-jordan-retro-13-wei%C3%9F-orangen-schuhel">dam盲nner air jordan retro 13 wei脽 orangen</a> <a href="http://www.prohaarklinik.com/nike-air-pegasus-92-oranger-bleu-chaussuresq">nike air pegasus 92 oranger bleu</a> <a href="http://www.bonfanticare.com/mujeres-nike-blazer-blanco-amarillo-zapatosl">mujeres nike blazer blanco amarillo</a> <a href="http://www.antoniopagni.com/air-jordan-cp3-mintgr%C3%B8n-lilla-skoj">air jordan cp3 mintgr酶n lilla</a> <a href="http://www.wcshosting.com/kvinners-nike-air-max-zero-r%C3%B8d-gr%C3%A5-obuvi">kvinners nike air max zero r酶d gr氓</a> <a href="http://www.biddingstream.com/mujeres-nike-roshe-run-slip-p%C3%BArpura-oro-zapatosp">mujeres nike roshe run slip p煤rpura oro</a>
    [url=http://www.truthtapes.com/]truthtapes[/url]

  11. avatar paineesq

    <a href="http://www.snifferwalk.com/nike-flyknit-roshe-run-black-orange-shoesi">nike flyknit roshe run black orange</a> <a href="http://www.fishmackerel.com/womens-nike-roshe-run-slip-black-pink-shoesp">womens nike roshe run slip black pink</a> <a href="http://www.lauraenergy.com/nike-lebron-ambassador-9-bl%C3%A5-svart-obuvl">nike lebron ambassador 9 bl氓 svart</a> <a href="http://www.magellantt.com/kvinders-air-yeezy-ii-2-sp-max-90-alle-r%C3%B8d-skoj">kvinders air yeezy ii 2 sp max 90 alle r酶d</a> <a href="http://www.sportablecrew.com/femminile-nike-air-max-tailwind-7-blu-rosa-scarpel">femminile nike air max tailwind 7 blu rosa</a> <a href="http://www.digisolnc.com/nike-kobe-9-low-womens-purple-silver-shoesj">nike kobe 9 low womens purple silver</a>
    paineesq http://www.paineesq.com/

欢迎留言




用户登录

sitemap