diff --git a/application/api/controller/Apk.php b/application/api/controller/Apk.php index d8f7f8e..2b572e0 100644 --- a/application/api/controller/Apk.php +++ b/application/api/controller/Apk.php @@ -104,6 +104,22 @@ class Apk extends Api $response = [ 'url' => $this->request->domain() . $attachment->url, 'filename' => $attachment->filename, + 'version' => $attachment->extparam, + ]; + + $this->success('获取成功', $response); + } + + public function latest_version(){ + $attachment = Attachment::where('category', 'apk') + ->order('createtime', 'desc') + ->find(); + + if (!$attachment) { + $this->error('暂无安装包'); + } + $response = [ + 'version' => $attachment->extparam, ]; $this->success('获取成功', $response);