發(fā)表日期:2019-04 文章編輯:小燈 瀏覽次數(shù):5080
因?yàn)橛泻枚嗾鹃L反映不知如何調(diào)取數(shù)據(jù),本篇只講前端調(diào)取數(shù)據(jù)時(shí)常見的函數(shù),在YzmCMS 3.0中將會(huì)有標(biāo)簽功能,更加方便調(diào)用數(shù)據(jù)。
前端常用的函數(shù)也就是這幾種:
$result?=?$article->field('title,nickname')->where(array('display'=>'1'))->order('id?DESC')->limit('5')->select(); 1.field() //表示查詢哪些字段,可以不寫,不寫時(shí)候默認(rèn)為查詢?nèi)孔侄危础?*?”; 2.where() //表示查詢條件,可以為數(shù)組也可以為字符串,建議為數(shù)組; 3.order() //表示按照什么排序; 4.limit() //表示查詢的條數(shù); 5.find() //表示查詢一條數(shù)據(jù),相當(dāng)于LIMIT?1,返回為一維數(shù)組; 6.select() //表示查詢多條數(shù)據(jù),返回為二維數(shù)組; 7.total() //表示所查詢的條數(shù),返回的是數(shù)量;
日期:2019-04 瀏覽次數(shù):4008
日期:2019-04 瀏覽次數(shù):3756
日期:2019-04 瀏覽次數(shù):3831
日期:2019-04 瀏覽次數(shù):5079
日期:2019-04 瀏覽次數(shù):4029
日期:2019-04 瀏覽次數(shù):3884
日期:2019-04 瀏覽次數(shù):3850
日期:2019-04 瀏覽次數(shù):4148
日期:2019-04 瀏覽次數(shù):3878
日期:2019-04 瀏覽次數(shù):3969
日期:2019-04 瀏覽次數(shù):3013
日期:2019-04 瀏覽次數(shù):3251
日期:2019-04 瀏覽次數(shù):4178
日期:2019-04 瀏覽次數(shù):3061
日期:2019-04 瀏覽次數(shù):3217
日期:2019-04 瀏覽次數(shù):3067
日期:2019-04 瀏覽次數(shù):3276
日期:2019-04 瀏覽次數(shù):3198
日期:2019-04 瀏覽次數(shù):3027
日期:2019-04 瀏覽次數(shù):3469
日期:2019-04 瀏覽次數(shù):3005
日期:2019-04 瀏覽次數(shù):3286
日期:2019-04 瀏覽次數(shù):4435
日期:2019-04 瀏覽次數(shù):2879
日期:2019-04 瀏覽次數(shù):3102
日期:2019-04 瀏覽次數(shù):2919
日期:2019-04 瀏覽次數(shù):4213
日期:2019-04 瀏覽次數(shù):3008
日期:2019-04 瀏覽次數(shù):3815
日期:2019-04 瀏覽次數(shù):3712
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.