public function actionIndex() { $model = Post::find()->orderBy('id desc')->all(); foreach ($model as $k => $v) { $model[$k]['created_at'] = date("Y-m-d h:i:s", $v['created_at']); $model[$k]['updated_at'] = date("Y-m-d h:i:s", $v['updated_at']); $model[$k]['status'] = Post::get_record_status($v['status']); } return $model; }