新增功能
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
class FanVisitRecord extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $name = 'fan_visit_record';
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $createTime = 'create_time';
|
||||
protected $updateTime = 'update_time';
|
||||
protected $deleteTime = 'delete_time';
|
||||
protected $dateFormat = false;
|
||||
|
||||
public function getVisitTypeDescAttr($value, $data)
|
||||
{
|
||||
$types = [1 => '电话', 2 => '微信', 3 => '短信', 4 => '上门', 5 => '其他'];
|
||||
return $types[$data['visit_type']] ?? '未知';
|
||||
}
|
||||
|
||||
public function fan()
|
||||
{
|
||||
return $this->belongsTo(Fan::class, 'fan_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user