You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
733 B
34 lines
733 B
<?php
|
|
|
|
namespace addons\qingdong\model;
|
|
|
|
use think\Model;
|
|
|
|
/**
|
|
*跟进阅读记录
|
|
*/
|
|
class RecordRead Extends Model {
|
|
// 表名,不含前缀
|
|
protected $name = 'qingdong_record_read';
|
|
// 开启自动写入时间戳字段
|
|
protected $autoWriteTimestamp = 'int';
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = 'updatetime';
|
|
|
|
|
|
//添加阅读记录
|
|
public static function addRead($record_id, $staff_id) {
|
|
return self::create([ 'record_id' => $record_id, 'staff_id' => $staff_id]);
|
|
}
|
|
|
|
|
|
//是否阅读
|
|
public static function isRead($record_id, $staff_id) {
|
|
if (self::where(['record_id' => $record_id, 'staff_id' => $staff_id])->find()) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
|