|
@@ -177,14 +177,20 @@ class RoomService extends CrudService {
|
|
return resmodel;
|
|
return resmodel;
|
|
}
|
|
}
|
|
|
|
|
|
- async switchzb({ id }) {
|
|
|
|
|
|
+ async switchzb({ id, uid }) {
|
|
const resmodel = await this.model.findById(id);
|
|
const resmodel = await this.model.findById(id);
|
|
if (resmodel) {
|
|
if (resmodel) {
|
|
const switchzjr = resmodel.switchzjr;
|
|
const switchzjr = resmodel.switchzjr;
|
|
resmodel.switchzjr = '';
|
|
resmodel.switchzjr = '';
|
|
const result = await resmodel.save();
|
|
const result = await resmodel.save();
|
|
if (result) {
|
|
if (result) {
|
|
- const newdata = { id: result.id, switchzjr };
|
|
|
|
|
|
+ let iszc = '0';
|
|
|
|
+ if (uid === resmodel.anchorid) {
|
|
|
|
+ iszc = '0';
|
|
|
|
+ } else {
|
|
|
|
+ iszc = '1';
|
|
|
|
+ }
|
|
|
|
+ const newdata = { id: result.id, switchzjr, uid, iszc };
|
|
const { mq } = this.ctx;
|
|
const { mq } = this.ctx;
|
|
if (mq) {
|
|
if (mq) {
|
|
const exchange = 'switch_zb_' + id;
|
|
const exchange = 'switch_zb_' + id;
|