|
<?php
namespace app\admin\model;
class Article extends \think\Model
{
public function createTimeArchive()
{
$create_times = $this->order('create_time desc')->column('create_time');
$timeList = [];
foreach($create_times as $value) {
$yearAndMonth = date("Y-m", $value);
$timeList[] = $yearAndMonth;
}
$timeList = array_unique($timeList);
return $timeList;
}
}
|