1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace addons\qingdongams\model;
- use think\Model;
- /**
- *签到阅读记录
- */
- class StaffSignInRead Extends Model {
- protected $name = 'qingdongams_staff_sign_in_read';
- // 开启自动写入时间戳字段
- protected $autoWriteTimestamp = 'int';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- //添加阅读记录
- public static function addRead($record_id, $staff_id) {
- return self::create([ 'sign_in_id' => $record_id, 'staff_id' => $staff_id]);
- }
- //是否阅读
- public static function isRead($record_id, $staff_id) {
- if (self::where(['sign_in_id' => $record_id, 'staff_id' => $staff_id])->find()) {
- return 1;
- }
- return 0;
- }
- }
|