39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
namespace Admin\Controller;
|
|
use Think\Controller;
|
|
class TemplateHistoryController extends AdminController{
|
|
public function __construct(){
|
|
parent::__construct();
|
|
$this->table=D("TemplateHistory");
|
|
}
|
|
//历吏记录
|
|
public function index($template_id){
|
|
$this->pagetitle="历吏记录";
|
|
$data=$this->table->where(array("template_id"=>$template_id))->order("addtime desc")->select();
|
|
$this->data=$data;
|
|
$this->display();
|
|
}
|
|
//比差异
|
|
public function differ($template_id,$history_id){
|
|
$this->pagetitle="差异对比";
|
|
|
|
//历吏模板
|
|
$this->history=M("template_history")->where(array("id"=>$history_id))->find();
|
|
//
|
|
$this->display();
|
|
}
|
|
//
|
|
public function get_now_content($template_id,$history_id){
|
|
//当前模板
|
|
$now_content=M("template")->where(array("template_id"=>$template_id))->getField("content");
|
|
//历吏模板
|
|
$history_content=M("template_history")->where(array("id"=>$history_id))->getField("content");
|
|
//代码转换
|
|
$now_content=htmlspecialchars_decode($now_content);
|
|
$history_content=htmlspecialchars_decode($history_content);
|
|
$data["now_content"]=$now_content;
|
|
$data["history_content"]=$history_content;
|
|
$this->success($data);
|
|
}
|
|
|
|
} |