Commit 42c88eac by 孙龙

up

parent 30e1e1d6
......@@ -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);
}
......
......@@ -70,6 +70,13 @@ class TemplateListModel extends Model{
}
/**
* 获取关联到用户的手机
*/
public function template_extend()
{
return $this->hasOne(\App\Model\TemplateExtendModel::class,"template_id","id");
}
......
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