更新app版本管理

This commit is contained in:
yaooo 2023-09-11 15:27:11 +08:00
parent 0e9a22bbc5
commit 00c5aad51b
4 changed files with 24 additions and 0 deletions

View File

@ -48,5 +48,9 @@ class AppUpdateDao extends BaseDao
$query->where('type',$where['type']);
});
}
public function delete(int $id)
{
return ($this->getModel()::getDB())->where('id', $id)->delete();
}
}

View File

@ -55,4 +55,10 @@ class LhappRepository extends BaseRepository
return $find;
}
public function delete($id)
{
$res = $this->dao->delete($id);
return $res;
}
}

View File

@ -53,12 +53,23 @@ class Lhapp extends BaseController
$this->repository->update($id, $this->getValidParams());
return app('json')->success('修改成功');
}
public function detail($id)
{
$data = $this->repository->detail($id);
return app('json')->success($data);
}
public function delete($id)
{
$res = $this->repository->delete($id);
if ($res) {
return app('json')->success('删除成功');
} else {
return app('json')->fail('删除失败');
}
}
protected function getValidParams()
{
$data = $this->request->params(['title', 'content', 'type', 'phone_brand', 'version', 'dow_url', 'force', 'quiet']);

View File

@ -183,6 +183,9 @@ Route::group(function () {
Route::post('edit/:id', '/update')->name('appVersionEdit')->option([
'_alias' => '编辑APP版本',
]);
Route::post('delete/:id', '/delete')->name('appVersionEdit')->option([
'_alias' => '删除APP版本',
]);
})->prefix('admin.system.Lhapp')->option([
'_path' => '/app/version',
'_auth' => true,