Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
note-library
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
42c88eac
authored
May 12, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
30e1e1d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
app/Http/Controllers/AjaxController.php
app/Model/TemplateListModel.php
app/Http/Controllers/AjaxController.php
View file @
42c88eac
...
...
@@ -229,7 +229,18 @@ Class AjaxController extends Controller
/**
* 编辑模板 获取模板详情
*/
public
function
getTemplateDetail
(){
public
function
getTemplateDetail
(
$request
){
$id
=
$request
->
input
(
"t_id"
,
0
);
$count
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
where
(
"create_userid"
,
$request
->
user
->
userId
)
->
count
(
"id"
);
if
(
$count
<=
0
){
return
$this
->
ajaxReturn
(
-
1
,
"没找到属于您的模板信息"
);
}
$templateInfo
=
TemplateListModel
::
where
(
"id"
,
intval
(
$id
))
->
first
();
$templateInfo
->
html
=
$templateInfo
->
template_extend
->
html
;
$templateInfo
->
attribute
=
$templateInfo
->
template_extend
->
attribute
;
return
$this
->
ajaxReturn
(
0
,
"ok"
,
$templateInfo
);
}
...
...
app/Model/TemplateListModel.php
View file @
42c88eac
...
...
@@ -70,6 +70,13 @@ class TemplateListModel extends Model{
}
/**
* 获取关联到用户的手机
*/
public
function
template_extend
()
{
return
$this
->
hasOne
(
\App\Model\TemplateExtendModel
::
class
,
"template_id"
,
"id"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment