Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Satini_pvduc
/
ocrpdf
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
tien_nemo
2025-08-18 14:32:02 +0700
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
e5209c085694b6f6137e60b9f72b2714eb88c0e6
e5209c08
1 parent
03917d9a
update data tpl
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
app/Http/Controllers/OcrController.php
app/Http/Controllers/OcrController.php
View file @
e5209c0
...
...
@@ -135,52 +135,4 @@ class OcrController extends Controller
],
500
);
}
}
/**
* Lấy danh sách template
*/
public
function
getTemplateList
()
{
try
{
$templates
=
MstTemplate
::
select
(
'id'
,
'tpl_name'
,
'tpl_text'
,
'in_date'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
get
();
return
response
()
->
json
([
'success'
=>
true
,
'templates'
=>
$templates
]);
}
catch
(
\Exception
$e
)
{
return
response
()
->
json
([
'success'
=>
false
,
'error'
=>
'Lỗi khi lấy danh sách template: '
.
$e
->
getMessage
()
],
500
);
}
}
/**
* Xóa template
*/
public
function
deleteTemplate
(
$id
)
{
try
{
$template
=
MstTemplate
::
findOrFail
(
$id
);
// Xóa các field detail trước
DtTemplate
::
where
(
'tpl_id'
,
$id
)
->
delete
();
// Xóa template chính
$template
->
delete
();
return
response
()
->
json
([
'success'
=>
true
,
'message'
=>
'Xóa template thành công'
]);
}
catch
(
\Exception
$e
)
{
return
response
()
->
json
([
'success'
=>
false
,
'error'
=>
'Lỗi khi xóa template: '
.
$e
->
getMessage
()
],
500
);
}
}
}
...
...
Please
register
or
sign in
to post a comment