2db47680
hexiaodong
chore: 初始提交 php 遗...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?php
namespace addons\antis\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;
}
}
|