init
This commit is contained in:
29
app/admin/model/Question.php
Executable file
29
app/admin/model/Question.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
use think\Request;
|
||||
use think\Config;
|
||||
|
||||
class Question extends Model {
|
||||
|
||||
use \app\common\traits\AdminModel;
|
||||
|
||||
protected $insert = ['createtime'];
|
||||
|
||||
// 属性修改器 创建时间
|
||||
protected function setCreatetimeAttr($value, $data) {
|
||||
return time();
|
||||
}
|
||||
|
||||
protected function setContentAttr($content, $data) {
|
||||
if (!empty($content)) {
|
||||
$config = \HTMLPurifier_Config::createDefault();
|
||||
$purifier = new \HTMLPurifier($config);
|
||||
$content = $purifier->purify($content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user