$user_id,'switch_id'=>$id,'type'=>$type])->value('id') ? 1:0; } /** * @param $user_id * @param $id * @param $type 1论坛 */ public static function userSwitch($user_id,$id,$type) { $ret_val = 0; $check_tags = self::checkSwitch($user_id,$id,$type); if($check_tags) { self::where(['user_id'=>$user_id,'switch_id'=>$id,'type'=>$type])->delete(); }else{ Data::save('PlatformSwitch', ['user_id'=>$user_id,'switch_id'=>$id,'type'=>$type],'user_id', ['user_id'=>$user_id,'switch_id'=>$id,'type'=>$type]); $ret_val = 1; } return $ret_val; } }