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; } public static function sort($data) { $article = self::find($data['id']); $article->sort = $data['sort']; return $article->save(); } }