迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
小程序中,如何加入个性日期?
var http_url = app.globalData.http_api + "s=news&c=search&pagesize=2"; http_url += '&api_call_function=module_search_news_list';
这个方法是在哪里改输出字段的?
我想在小程序首页中,加入个性日期,比如{{news.inputtime.y}} 或者{{news.inputtime.y-m-d}},请问要如何做
module_search_news_list
public function module_search_news_list($data) { $rt = []; if ($data['list']) { foreach ($data['list'] as $t) { $t['thumb'] = dr_thumb($t['thumb'], 200, 200); $t['inputtime_y'] = dr_date($t['_inputtime'] ? $t['_inputtime'] : $t['inputtime'], "Y"); $t['inputtime_ymd'] = dr_date($t['_inputtime'] ? $t['_inputtime'] : $t['inputtime'], "Y-m-d"); $rt[] = $t; } } return $rt; }