diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index fb5be474..56d922a5 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1300,4 +1300,13 @@ class Auth extends BaseController $list = $queryBuilder->setOption('field', [])->field(['mer_id', 'category_id', 'type_id', 'mer_name', 'area_id', 'street_id', 'village_id', 'mer_address', 'long', 'lat', 'create_time'])->order('mer_id', 'desc')->page($page, $limit)->fetchSql(false)->select(); return app('json')->success(compact('count', 'list')); } + + //获取app版本更新信息 + public function appVersion() + { + $version = $this->request->param('version', ''); + $type = $this->request->param('type', '1'); + $appInfo = (Db::name('AppUpdate')->where('type', $type)->where('version', '>', $version)->order('id', 'desc')->find()) ?? (object)[]; + return app('json')->success(compact('appInfo')); + } } diff --git a/route/api.php b/route/api.php index 67af7fcb..c8996560 100644 --- a/route/api.php +++ b/route/api.php @@ -22,6 +22,7 @@ use think\facade\Route; Route::group('api/', function () { Route::any('test', 'api.Auth/test'); Route::any('dotest', 'api.Auth/dotest'); + Route::any('app/version', 'api.Auth/appVersion'); Route::post('goods/take/:id', 'api.Auth/deliveryGoods'); Route::get('merchant/cate', 'api.Auth/merchantCate'); Route::get('order/statistics', 'api.Auth/orderStatistics');