drag-create-api/app/resources/view/admin/model.tpl
2023-06-25 08:51:24 +08:00

71 lines
1.5 KiB
Smarty

<?php
namespace app\common\model\{$moduleName};
use app\common\arw\adjfut\src\Validate;
use app\BaseModel;
use think\model\concern\SoftDelete;
use app\common\arw\adjfut\src\Excel;
use app\Request;
use app\common\exception\Tool;
use think\facade\Db;
class {$className} extends BaseModel
{
use SoftDelete;
//
protected $deleteTime = '{$businessName}_delete_time';
//
protected $pk = '{$businessName}_guid';
//
protected $disuse = [];
//
protected $schema = [
{$fields}
];
// json类型字段
protected $json = [''];
//
protected $autoWriteTimestamp = 'datetime';
//
protected $createTime = '{$businessName}_create_time';
//
protected $updateTime = '{$businessName}_update_time';
{$importExcelField}
/**
*
*/
public static function onBeforeInsert(self $model): void
{
// self::checkRepeatData($model);
$model->completeCreateField();
}
/**
*
*/
public static function onBeforeUpdate(self $model): void
{
// self::checkRepeatData($model);
$model->completeUpdateField();
}
/**
*
*/
public static function onBeforeDelete(self $model): void
{
$model->completeDeleteField();
}
{$exportExcelContent}
{$importExcelContent}
{$importExcelInitContent}
}