Commit 15e7e49c by 肖康
parents a04d0eff cc27fb0a
......@@ -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);
}
......
......@@ -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