wupengfei 2 年之前
父节点
当前提交
1c273c896d

+ 3 - 1
.idea/workspace.xml

@@ -3,7 +3,9 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/General.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/General.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Video.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Video.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common/model/PlatformSwitch.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/PlatformSwitch.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -230,7 +232,7 @@
       <workItem from="1675904734949" duration="20832000" />
       <workItem from="1675990026788" duration="13260000" />
       <workItem from="1676077132290" duration="20234000" />
-      <workItem from="1676250114476" duration="5102000" />
+      <workItem from="1676250114476" duration="5538000" />
     </task>
     <servers />
   </component>

+ 1 - 1
application/api/controller/General.php

@@ -83,7 +83,7 @@ class General extends Base
      * @url /api/General/switchSet
      * @header name:Authorization require:1 desc:Token
      * @param name:id type:int require:1 default:-- desc:记录id
-     * @param name:type type:int require:1 default:-- desc:类型【1=>'问答通知开关',2=>'视频追更',3=>'图文追更',4=>'资料追更',5=>'供应商追更',6=>'招聘追更'】
+     * @param name:type type:int require:1 default:-- desc:类型【1=>'问答通知开关',2=>'视频追更',3=>'图文追更',4=>'资料追更',5=>'供应商追更',6=>'招聘追更',7=>'视频通知开关',8=>图文通知开关
      */
     public function switchSet()
     {

+ 3 - 1
application/api/controller/Video.php

@@ -387,6 +387,7 @@ class Video extends Base
      * @return name:is_top type:int default:-- desc:是否置顶(0否,1是)
      * @return name:read_num type:int default:-- desc:播放量
      * @return name:follow_switch type:int default:-- desc:追番开关状态【0关闭1开启】
+     * @return name:switch_open type:int default:-- desc:通知开关【0关闭1开启】
      * @return name:total_sequel type:int default:-- desc:共多少期【期数】(默认1)
      * @return name:video_arr type:array default:-- desc:视频地址[选集列表]
      * @return name:video_arr.id type:int default:-- desc:ID[请求视频模块其他接口参数:url_id]
@@ -416,6 +417,7 @@ class Video extends Base
         $detail = VideoIntro::with(['videoArr'])->where($sel_where)->find()->toArray();
         if($detail['is_deleted'] == 1 || $detail['status'] == 0)$this->error('该视频已下线');
         $detail['follow_switch'] =  PlatformSwitch::checkSwitch($this->user_id,$detail['id'],2);
+        $detail['switch_open'] =  PlatformSwitch::checkSwitch($this->user_id,$detail['id'],7);
         $detail['label_name'] = [];
         if($detail['label']) {
             $detail['label_name'] = explode(',',trim($detail['label'],','));
@@ -662,7 +664,7 @@ class Video extends Base
         $url_id = input('post.url_id',0);
         $content = input('post.content',0);
         if(!$content) $this->error('请输入评论内容');
-        $res =  VideoComment::create(['user_id'=>$this->user_id,'content'=>$content,'video_id'=>$video_id,'url_id'=>$url_id,'video_type'=>$video_type]);;
+        $res =  VideoComment::create(['user_id'=>$this->user_id,'content'=>$content,'video_id'=>$video_id,'url_id'=>$url_id,'video_type'=>$video_type]);
         $detail  =VideoComment::where('c.id',$res->id)
             ->alias('c')
             ->field('c.id,c.content,c.user_id,c.create_at,u.name,u.headimg')

+ 9 - 2
application/common/model/PlatformSwitch.php

@@ -6,7 +6,14 @@ use think\Model;
 class PlatformSwitch extends Model
 {
     static $type_desc = [
-        1=>'问答通知开关', 2=>'视频追更', 3=>'图文追更', 4=>'资料追更', 5=>'供应商追更', 6=>'招聘追更'
+        1=>'问答通知开关',
+        2=>'视频追更',
+        3=>'图文追更',
+        4=>'资料追更',
+        5=>'供应商追更',
+        6=>'招聘追更',
+        7=>'视频通知',
+        8=>'图文通知',
     ];
 
     /**
@@ -19,7 +26,7 @@ class PlatformSwitch extends Model
     public static function checkSwitch($user_id,$id,$type){
         $switch_value = self::where(['user_id'=>$user_id,'switch_id'=>$id,'type'=>$type])->value('switch_value');
         if($switch_value !== null) return $switch_value;
-        return in_array($type,[1]) ?  1 : 0;
+        return in_array($type,[2,3,4,5,6]) ?  0 : 1;
     }
     /**
      * @param $user_id