App.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: pcl
* Date: 2023/8/14
* Time: 11:14
*/
namespace app\api\controller;
use app\common\controller\Api;
use think\Db;
use think\Exception;
use think\exception\PDOException;
/**
* APP下载接口
*/
class App extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
/**
* 监管APP
*/
public function jgApp()
{
$info = Db::name('appversion')
->where(['app_type' => 'jianguan', 'status' => '1'])
->field('version_code,apk_url,upgrade_point,images,content,updatetime')
->order('id desc')
->find();
if ($info) {
if (!empty($info['images'])) {
$imgArr = explode(',', $info['images']);
$info['images'] = full_image($imgArr);
} else {
$info['images'] = [];
}
$info['updatetime'] = date('Y-m-d', $info['updatetime']);
$this->success('获取成功', $info);
} else {
$this->error('暂无下载信息');
}
}
}