<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\CmsJob\Util; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\ArrayUtil; class CmsJobUtil { public static function buildRecord($Lu5WV) { goto GWyej; Ag3H6: $qgfZ7['day'] = date('Y-m-d', strtotime($Lu5WV['created_at'])); goto XFzcs; GWyej: $qgfZ7 = ArrayUtil::keepKeys($Lu5WV, array('id', 'title', 'updated_at')); goto Ag3H6; XFzcs: return $qgfZ7; goto hIJm7; hIJm7: } public static function buildRecords($vKRZ2) { foreach ($vKRZ2 as $l0ek5 => $Lu5WV) { $vKRZ2[$l0ek5] = self::buildRecord($Lu5WV); } return $vKRZ2; } public static function listLatest($BMu21 = 5) { $vKRZ2 = ModelUtil::model('cms_job')->orderBy('id', 'desc')->limit($BMu21)->get()->toArray(); return self::buildRecords($vKRZ2); } public static function get($WXJys) { return ModelUtil::get('cms_job', array('id' => $WXJys)); } }