houde_web_api/app/common/model/AboutUs/AboutUs.php
2023-04-16 23:05:17 +08:00

106 lines
2.3 KiB
PHP

<?php
namespace app\common\model\AboutUs;
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 AboutUs extends BaseModel
{
use SoftDelete;
// 删除字段
protected $deleteTime = 'about_us_delete_time';
// 设置主键名
protected $pk = 'about_us_guid';
// 设置废弃字段
protected $disuse = [];
// 设置字段信息
protected $schema = [
"about_us_id" => "int",
"about_us_guid" => "string",
"about_us_img" => "string",
"about_us_text" => "string",
"about_us_why_img" => "string",
"about_us_why_text" => "string",
"about_us_company_idea_text" => "string",
"about_us_company_idea_img" => "string",
"about_us_why_create_time" => "",
"about_us_product_type_num" => "string",
"about_us_company_staff" => "string",
"about_us_create_time" => "datetime",
"about_us_create_user_guid" => "string",
"about_us_update_time" => "datetime",
"about_us_update_user_guid" => "string",
"about_us_delete_time" => "datetime",
"about_us_delete_user_guid" => "string",
];
// 设置json类型字段
protected $json = [''];
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = 'datetime';
// 创建时间
protected $createTime = 'about_us_create_time';
// 修改时间
protected $updateTime = 'about_us_update_time';
/**
* 新增前
*/
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();
}
}