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
15e7e49c
authored
May 12, 2020
by
肖康
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://119.23.72.7/sunlong_v5/note-library
parents
a04d0eff
cc27fb0a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
app/Http/Controllers/AjaxController.php
app/Model/TemplateListModel.php
app/Http/Controllers/AjaxController.php
View file @
15e7e49c
...
@@ -229,7 +229,19 @@ Class AjaxController extends Controller
...
@@ -229,7 +229,19 @@ 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
))
->
select
(
"id"
,
"template_name"
,
"status"
)
->
first
();
if
(
$templateInfo
->
status
<=
0
){
return
$this
->
ajaxReturn
(
-
1
,
"改模板已经被主人禁用了"
);
}
$templateInfo
->
template_extend
=
$templateInfo
->
template_extend
;
return
$this
->
ajaxReturn
(
0
,
"ok"
,
$templateInfo
);
}
}
...
...
app/Model/TemplateListModel.php
View file @
15e7e49c
...
@@ -70,6 +70,13 @@ class TemplateListModel extends Model{
...
@@ -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