liuyu 4 năm trước cách đây
mục cha
commit
73be550dd3
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 8 2
      app/service/room.js

+ 8 - 2
app/service/room.js

@@ -177,14 +177,20 @@ class RoomService extends CrudService {
     return resmodel;
   }
 
-  async switchzb({ id }) {
+  async switchzb({ id, uid }) {
     const resmodel = await this.model.findById(id);
     if (resmodel) {
       const switchzjr = resmodel.switchzjr;
       resmodel.switchzjr = '';
       const result = await resmodel.save();
       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;
         if (mq) {
           const exchange = 'switch_zb_' + id;