Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

孙龙 / note-library

  • This project
    • Loading...
  • Sign in
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 5 years ago by 肖康's avatar 肖康
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 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);
} }
......
This diff is collapsed. Click to expand it.
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");
}
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment