Files
fdesk/app/crm/model/Follow.php
T

57 lines
1.1 KiB
PHP
Raw Normal View History

2025-07-09 15:10:14 +08:00
<?php
namespace app\crm\model;
use app\service\OssService;
use app\crm\utils\Util;
use config\constants\Constants;
use support\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Follow extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
2025-07-10 14:27:56 +08:00
protected $table = 'crm_follow';
2025-07-09 15:10:14 +08:00
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
//设置黑名单
protected $guarded = ['id','created_at','updated_at'];
// 指定日期字段存储格式为时间戳
protected $dateFormat = 'U';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
2025-08-22 14:31:33 +08:00
public $timestamps = false;
2025-07-09 15:10:14 +08:00
2025-08-22 14:31:33 +08:00
/**
* 在保存时手动设置时间戳
*/
protected static function boot()
{
parent::boot();
static::creating(function ($model) {
$model->created_at = time();
$model->updated_at = time();
});
static::updating(function ($model) {
$model->updated_at = time();
});
}
2025-07-09 15:10:14 +08:00
}