作者 lishaoshuai
1 个管道 的构建 通过 耗费 0 秒

业务员留言红点需求,准备测试

... ... @@ -88,6 +88,8 @@ class LeaveController extends RestBaseController
} elseif ($this->userId && $this->userType == 3) {//信贷员
$condition['l.to_uid|l.from_uid'] = $this->userId;
$field = 'l.id,l.to_uid,from.avatar,from.user_nickname name,content,l.create_time';
//将该业务员的 留言都改为已读状态
Db::name('leave')->where(['to_uid|from_uid' => $this->userId])->update(['is_read' => 1]);
}
$result = Db::name('leave')
->alias('l')
... ... @@ -108,6 +110,31 @@ class LeaveController extends RestBaseController
$result[$k]['create_time'] = date('Y-m-d',strtotime($v['create_time']));
}
}
$this->success('获取成功',$result);
}
/**
* @title 留言板(是否有红点)
* @description 位置:名片详情
* @url /wxapp/leave/getUnread
* @method POST
*
* @header name:XX-Token type:string require:1 default:abc other: desc:登录标识
* @header name:XX-Device-Type type:string require:0 default:wxapp other: desc:设备类型
*
* @return is_unread:1未读 0已读
*/
public function getUnread() {
$condition['parent_id'] = 0;
$condition['is_read'] = 0;
$condition['to_uid|from_uid'] = $this->userId;
$result = Db::name('leave')->where($condition)->field('is_read')->find();
if($result) {
$is_unread = 1;
} else {
$is_unread = 0;
}
$this->success('获取成功',['is_unread',$is_unread]);
}
}
\ No newline at end of file
... ...